Simply attach a grease rag to the ends of an open U-lock using rubber bands. Hold the lock by the curve with one hand and run the rag's edge between your cogs.
I came up with this because I needed two hands to pull the rag back and forth between my bike's cogs, and a third hand to turn the crank. I know it can be done with the rear wheel off, but I like to be able to clean the drivetrain while it's still on the frame. This saves time and, in some cases, garage space (ours is beyond cluttered.)
Also, the rear wheel will NOT stay where you want it to if you simply lean it against a wall: you must hold it with one of your quindigital body extensions.
Obviously, don't use a rag as dirty as this one for the job. This one will be retired soon.
Step 1: Notes...
The circularity of this idea is...
If you are the kind of person who values their bike, you probably have a good quality U-lock with a removable shackle, and are also probably the kind of person who regularly wipes the chain and cogs with something. These prudent and drivetrain-saving qualities go hand in hand.