Do the dirty on someone
An abbreviation of play a dirty trick on someone to treat someone scurrilously dates from the late 17th century.