An upstate New York substitute teacher has pleaded guilty to the attempted rape of a 14-year-old girl he was tutoring.