I tried something similar before switching to a transistor amp with headphone out. Attenuators need to vent a lot of heat and that can get really scary, especially when you try to build your own like I did.
I had the grounding problem running guitar thru a USB powered Zoom H4n and discovered if I plugged a USB data cable from Zoom into the desktop computer port, that would ground the guitar. i.e. USB direct power sources (I got a power cable for that) may be two prong from the wall. Computer is 3 prong and everything is grounded. I'd guess that plugging USB into a spare port on a PC monitor would accomplish this too.