r/Python • • Mar 15 '12

Python code to exploit Windows RDP - Yes , its out in the wild!

http://pastebin.com/fFWkezQH
21 Upvotes

21 comments sorted by

20

u/rmdashrf Mar 15 '12

5

u/zahlman the heretic Mar 16 '12

if you actually attempted to run what was posted you could have put yourself into a world of hurt, as it did not appear to be a working exploit of MS12-020, but instead had traces to an Apache exploit from 2008.

So this somehow compromises the local machine... by attempting to send data to a remote one? Wat?

Anyway, Windows Update automatically patched MS12-020 (with KB2621440), so I don't see why there seems to be so much concern that people will get exploited...

3

u/[deleted] Mar 16 '12

You would be surprised how many machines are left online unpatched for years, even in businesses.

1

u/zahlman the heretic Mar 16 '12

How does it happen, though?

1

u/[deleted] Mar 16 '12

Ignorance.

1

u/[deleted] Mar 18 '12

Turn off automatic Windows Updates (always a good idea with servers, you don't want your server patching itself and breaking your e-commerce server on the busiest day of the year for a patch that isn't actually relevant to you), then either get really busy with stuff so you forget to update manually, or simply have your boss implement a change request system that makes it take 3-4 weeks to get anything done so nobody bothers.

1

u/zahlman the heretic Mar 18 '12

you don't want your server patching itself and breaking your e-commerce server on the busiest day of the year for a patch that isn't actually relevant to you

Doesn't it schedule itself for like 3AM by default?

1

u/kuratkull Mar 18 '12 edited Mar 18 '12

3AM is 3PM somewhere else.

1

u/zahlman the heretic Mar 18 '12

3AM local time, I thought. Patch Tuesday isn't staggered around the world?

3

u/kuratkull Mar 18 '12

What does it matter what the servers local time is? There are people from all over the world using your service. Production servers can't go down for any amount of time.

2

u/R1cket Mar 16 '12

Interesting links come out of the topic of freenode #ms12-020 though... Wish I had time to play with this at the moment. :)

18

u/maryjayjay Mar 15 '12

Saying that's a python exploit is like saying it's the syringe that cures smallpox.

18

u/Samus_ Mar 16 '12

in all fairness it doesn't say "python exploit" it says "python code to exploit"

0

u/[deleted] Mar 15 '12

[deleted]

14

u/maryjayjay Mar 15 '12

The exploit is in machine code, the conveyance to inject the exploit is a python wrapper and could have been written in any language. Hence my comparison of python to the syringe. They both deliver the payload, but are generally unrelated to it.

2

u/flying-sheep Mar 16 '12

thought the same thing. the python here is a very thin wrapper injecting some-python-unrelated binary code somewhere else.

1

u/puffybaba Mar 16 '12

Why did you repost this so many times?

1

u/zahlman the heretic Mar 16 '12

... so what's with the coding style of all these hackers, anyway?

buf = ''
buf += 'bunch of hex'
buf += 'moar hex'

Ugh.

data = ''.join(
    'bunch of hex',
    'moar hex'
)

Much better IMO. DRY wrt the identifier name.

0

u/[deleted] Mar 16 '12

[deleted]

7

u/zahlman the heretic Mar 16 '12

Actually, quite right... adjacent literals are joined at compile time, just like in C. Well spotted :)

1

u/semajames Mar 16 '12

Wow. I didn't know that! TIL! Thank you.

-1

u/minivanmegafun Mar 16 '12

Bleh. This affects way too many of my customers who are away too stupid to comprehend our announcement.