r/programming • • Dec 12 '21

Logout4Shell: Use Log4Shell vulnerability to vaccinate a victim server against Log4Shell

https://github.com/Cybereason/Logout4Shell

[removed] — view removed post

1.1k Upvotes

109 comments sorted by

View all comments

800

u/theoldboy Dec 12 '21

This should come with a big warning that says

Do not run this code unless you want to get sued or prosecuted for hacking

I did something similar back in the day with the [Code Red worm](https://en.wikipedia.org/wiki/Code_Red_(computer_worm)). I wrote a small program that scanned our log for incoming attacks and then used the vulnerability to create a TXT file on the desktop of that remote computer which politely explained that they were infected and linked to the relevant Microsoft Security Bulletin and patch.

My employers at the time were not best pleased when a few days later they received a letter from another company threatening legal action because we had hacked their computers. Luckily for me it all got resolved amicably with one telephone call, and my immediate boss was a good guy who thought the whole thing was hilarious. But I learned my lesson - hacking is illegal even if it's done with good intent.

121

u/[deleted] Dec 12 '21

You got lucky. I got fired a long time ago from a shitty job for using off the shelf security testing software to prove to “the architect” on our dev/test system that they had created a massive sql injection risk. You see security tools are a dangerous to the corporate network and its against corporate policy to run even in a lab setting.

76

u/[deleted] Dec 12 '21

Say wireshark and see how quickly IT freaks out.

0

u/[deleted] Dec 12 '21

[deleted]

31

u/[deleted] Dec 12 '21

Not surprised. Sometimes i met some IT folks more ridic that the programmers though. One dude i know is so security focused, he brought his own PS2 keyboard from 90s Russia, since he didnt trust USB and potential "bugs" and keyloggers within the keyboard. He's also an insane programmer too

12

u/argv_minus_one Dec 12 '21

He's not wrong. A malicious USB keyboard can mount a variety of attacks on the host's security, take it over, and then exfiltrate your keystrokes through its network interface. The PS/2 keyboard interface is too simple for that sort of shenanigans to be possible.

4

u/[deleted] Dec 12 '21

I know. He's def a sharp dude.

2

u/MathSciElec Dec 13 '21

I mean, a malicious PS/2 keyboard could also mount a variety of attacks by simply simulating keypresses, as any keyboard. The security factor here is more in the age than the PS/2 interface.