A serial flasher has been convicted of trying to kill a police officer by stabbing him 23 times with a pair of large scissors.