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

#9 Locking Out Hackers

Finding out who's trying to hack your system is one thing. But what do you do about it? One solution is to lock out the attacking machine from your system for 30 minutes. This should slow down attempts by worms and script kiddies to access your system.

The Code

 1 #!/usr/bin/perl 2 # WARNING: There are many different ways to lock 3 # a system out. This script uses 4 # /sbin/route add <ip> reject 5 # Adjust this command to suit your system. 6 # 7 # 8 # When someone tries to hack us, lock him out 9 # of the system for 30 minutes. 10 # 11 # Lockout is accomplished by setting the route 12 # for the bad systems to an impossible value 13 # 14 # 15 # Uses a simple technique to detect hacking 16 # entries, specifically 17 ...
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