to do someone’s dirty work

If you do someone’s dirty work, you complete unpleasant tasks or chores for them and they get the credit for your work.

He does all of John’s dirty work and gets no credit for it. John gets all of the recognition.

Perhaps it’s time that John started to do his own dirty work.