Skip to Main Content
Wicked Cool Perl Scripts
book

Wicked Cool Perl Scripts

by Steve Oualline
February 2006
Intermediate to advanced content levelIntermediate to advanced
304 pages
6h 16m
English
No Starch Press
Content preview from Wicked Cool Perl Scripts

#8 Hacker Detection

There are a lot of dumb hackers and worms out there. Many of them try to break into my web server using old exploits that work on Microsoft systems. Many of these exploits are used to try to access the program cmd.exe in the WINNT directory.

I run Linux, so I can tell you that no matter what you send to my box, you're not going to get access to an MS-DOS command prompt.

To identify the bad guys, I created a small script that scans the Apache error log looking for obvious hacking attempts and printing out the top hackers.

The Code

 1 #!/usr/bin/perl 2 # 3 # Print out a list of who tried to hack 4 # the system. 5 # 6 # Uses a simple technique to detect hacking 7 # entries, specifically 8 # 9 # 1) Attempts to access any URL ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl Debugged

Perl Debugged

Peter Scott, Ed Wright
Perl & LWP

Perl & LWP

Sean M. Burke
Pro Perl

Pro Perl

Peter Wainwright

Publisher Resources

ISBN: 1593270623Catalog PageErrata