Scarlett Johansson's lawyer is on the attack -- warning a bunch of websites that Scarlett owns the copyright to her HACKED nude pics and anyone who doesn't take 'em down will FACE HIS WRATH!!!!

TMZ has learned ... Scarlett's attorney -- legal pit bull Marty Singer -- has fired off threatening letters to various sites including TheDirty.com ... demanding that the sites remove the "stolen copyright protected private photographs" immediately ... or face legal action.

Singer claims, "The highly personal and private photographs at issue capture our client self-posing in her own home in a state of undress and/or topless."

And just to make sure he's perfectly clear, Singer concludes ... "If you fail to comply, you will be acting at your own peril. Please govern yourselves accordingly."

TheDirty tells TMZ ... the site will adhere to Singer's request and take down the photos.