O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
  Books     O'Reilly Gear     Newsletters     Press Room     Jobs     About O'Reilly  

 
• List of Titles
• Got a Hack?
• Suggestion Box
• About Hacks
Bioinformatics
C/C++
Databases
Digital Media
Enterprise Development
Game Development
Java
Linux/Unix
Macintosh/OS X
.NET
Open Source
Oracle
Perl
Python
Scripting
Security
SysAdmin/Networking
Web
Web Services
Windows
Wireless
XML
Annoyances
CD Bookshelves
Cookbooks
Developer's Notebooks
Hacks
Head First
In A Nutshell
Missing Manuals
Pocket References
Personal Trainer
Technology & Society
No Starch Press
Paraglyph Press
Pragmatic Bookshelf
SitePoint
Syngress Publishing
LinuxDevCenter.com
MacDevCenter.com
ONDotnet.com
ONJava.com
ONLamp.com
OpenP2P.com
Perl.com
WebServices.XML.com
WindowsDevCenter.com
XML.com
Ask Tim
Beta Chapters
Events
From the Editors List
Letters
MAKE
Open Books
tim.oreilly.com
Academic
Corporate Services
Government
About O'Reilly
Bookstores
Catalog Request
Contact Us
International
User Groups
Writing for O'Reilly
Traveling to
a tech show?

Lubbock Hotels
Kihei Hotels
Ann Arbor Hotels
Fargo Hotels
Florence Hotels
Fredericksburg Hotels
Santa Cruz Hotels
Englewood Hotels



 
Buy the book!
Network Security Hacks
By Andrew Lockhart
April 2004
More Info

How do these hacks stand up? Comment on a hack from the book by choosing the associated "Discuss" link below. You can also view the code from any of the hacks by clicking on the "Listing" or "Code" links. A number of hacks have been selected to be featured online in their entirety; you may view those hacks by clicking on the hack titles that are linked.

Jump to: Unix Host Security  | Windows Host Security  | Network Security  | Logging  | Monitoring and Trending  | Secure Tunnels  | Network Intrusion Detection  | Recovery and Response

Unix Host Security

HACK
#1

Secure Mount Points
Use mount options to help prevent intruders from further escalating a compromise
[Discuss (0) | Link to this hack]

HACK
#2

Scan for SUID and SGID Programs
Quickly check for potential root-exploitable programs and backdoors
[Discuss (0) | Link to this hack]

HACK
#3

Scan For World- and Group-Writable Directories
Quickly scan for directories with loose permissions
[Discuss (0) | Link to this hack]

HACK
#4

Create Flexible Permissions Hierarchies with POSIX ACLs
When Unix mode-based permissions just aren't enough, use an ACL
[Discuss (0) | Link to this hack]

HACK
#5

Protect Your Logs from Tampering
Use file attributes to prevent intruders from removing traces of their break-in
[Discuss (0) | Link to this hack]

HACK
#6

Delegate Administrative Roles
Let others do your work for you without giving away root privileges
[Discuss (0) | Link to this hack]

HACK
#7

Automate Cryptographic Signature Verification
Use scripting and key servers to automate the chore of checking software authenticity
[Discuss (0) | Link to this hack]

HACK
#8

Check for Listening Services
Find out whether unneeded services are listening and looking for possible backdoors
[Discuss (0) | Link to this hack]

HACK
#9

Prevent Services from Binding to an Interface
Keep services from listening on a port instead of firewalling them
[Discuss (0) | Link to this hack]

HACK
#10

Restrict Services with Sandboxed Environments
Mitigate system damage by keeping service compromises contained
[Discuss (0) | Link to this hack]

HACK
#11

Use proftp with a MySQL Authentication Source
Make sure that your database system's OS is running as efficiently as possible with these tweaks
[Discuss (0) | Link to this hack]

HACK
#12

Prevent Stack-Smashing Attacks
Learn how to prevent stack-based buffer overflows
[Discuss (0) | Link to this hack]

HACK
#13

Lock Down Your Kernel with grsecurity
Harden your system against attacks with the grsecurity kernel patch
[Discuss (0) | Link to this hack]

HACK
#14

Restrict Applications with grsecurity
Use Linux capabilities and grsecurity's ACLs to restrict applications on your system
[Discuss (0) | Link to this hack]

HACK
#15

Restrict System Calls with Systrace
Keep your programs from performing tasks they weren't meant to do
[Discuss (0) | Link to this hack]

HACK
#16

Automated Systrace Policy Creation
Let Systrace's automated mode do your work for you
[Discuss (0) | Link to this hack]

HACK
#17

Control Login Access with PAM
Seize fine-grained control of when and where your users can access your system
[Discuss (0) | Link to this hack]

HACK
#18

Restricted Shell Environments
Keep your users from shooting themselves (and you) in the foot
[Discuss (0) | Link to this hack]

HACK
#19

Enforce User and Group Resource Limits
Make sure resource-hungry users don't bring down your entire system
[Discuss (0) | Link to this hack]

HACK
#20

Automate System Updates
Patch security holes in a timely manner to prevent intrusions
[Discuss (0) | Link to this hack]

Windows Host Security

HACK
#21

Check Servers for Applied Patches
Make sure your Windows servers have the latest patches installed
[Discuss (0) | Link to this hack]

HACK
#22

Get a List of Open Files and Their Owning Processes
Look for suspicious activity by monitoring file accesses
[Discuss (0) | Link to this hack]

HACK
#23

List Running Services and Open Ports
Check for remotely accessible services the Windows way
[Discuss (0) | Link to this hack]

HACK
#24

Enable Auditing
Log suspicious activity to help spot intrusions
[Discuss (0) | Link to this hack]

HACK
#25

Secure Your Event Logs
Keep your system's logs from being tampered with
[Discuss (0) | Link to this hack]

HACK
#26

Change Your Maximum Log File Sizes
Change your log properties so that they see the whole picture
[Discuss (0) | Link to this hack]

HACK
#27

Disable Default Shares
Stop sharing all your files with the world
[Discuss (1) | Link to this hack]

HACK
#28

Encrypt Your Temp Folder
Keep prying eyes out of your temporary files
[Discuss (2) | Link to this hack]

HACK
#29

Clear the Paging File at Shutdown
Prevent information leaks by automatically clearing the swap file before shutting down
[Discuss (0) | Link to this hack]

HACK
#30

Restrict Applications Available to Users
Prevent your users from running potentially dangerous applications
[Discuss (0) | Link to this hack]

Network Security

HACK
#31

Detect ARP Spoofing
Find out if there's a "man in the middle" impersonating your server
[Discuss (0) | Link to this hack]

HACK
#32

Create a Static ARP Table
Use static ARP table entries to combat spoofing and other nefarious activities
[Discuss (0) | Link to this hack]

HACK
#33

Firewall with Netfilter
Protect your network with Linux's powerful firewalling features
[Discuss (0) | Link to this hack]

HACK
#34

Firewall with OpenBSD's PacketFilter
Use OpenBSD's firewalling features to protect your network
[Discuss (0) | Link to this hack]

HACK
#35

Create an Authenticated Gateway
Use PF to keep unauthorized users off the network
[Discuss (0) | Link to this hack]

HACK
#36

Firewall with Windows
Yes, you can use Windows as a firewall
[Discuss (0) | Link to this hack]

HACK
#37

Keep Your Network Self-Contained
Use egress filtering to mitigate attacks and information leaks coming from your network
[Discuss (0) | Link to this hack]

HACK
#38

Test Your Firewall
Find out if your firewall really works the way you think it should
[Discuss (0) | Link to this hack]

HACK
#39

MAC Filtering with Netfilter
Keep unwanted machines off your network with MAC address whitelisting
[Discuss (0) | Link to this hack]

HACK
#40

Block OS Fingerprinting
Keep outsiders on a need-to-know basis regarding your operating systems
[Discuss (0) | Link to this hack]

HACK
#41

Fool Remote Operating System Detection Software
Evade remote OS detection attempts by disguising your TCP/IP stack
[Discuss (0) | Link to this hack]

HACK
#42

Keep an Inventory of Your Network
Use Nmap to keep track of the devices and services on your network
[Discuss (0) | Link to this hack]

HACK
#43

Scan Your Network for Vulnerabilities
Use Nessus to quickly and easily scan your network for services that are vulnerable to attack
[Discuss (0) | Link to this hack]

HACK
#44

Keep Server Clocks Synchronized
Make log analysis easier by keeping the time on your systems in sync
[Discuss (0) | Link to this hack]

HACK
#45

Create Your Own Certificate Authority
Sign your own certificates to use in securing your network
[Discuss (0) | Link to this hack]

HACK
#46

Distribute Your CA to Clients
Be sure all of your clients trust your new Certificate Authority
[Discuss (0) | Link to this hack]

HACK
#47

Encrypt IMAP and POP with SSL
Keep your email safe from prying eyes while also protecting your POP and IMAP passwords
[Discuss (0) | Link to this hack]

HACK
#48

Set Up TLS-Enabled SMTP
Protect your users' in-transit email from eavesdroppers
[Discuss (0) | Link to this hack]

HACK
#49

Detect Ethernet Sniffers Remotely
Detect potential spies on your network without having to trust compromised machines
[Discuss (0) | Link to this hack]

HACK
#50

Install Apache with SSL and suEXEC
Help secure your web applications with mod_ssl and suEXEC
[Discuss (0) | Link to this hack]

HACK
#51

Secure BIND
Lock down your BIND setup to help contain potential security problems
[Discuss (0) | Link to this hack]

HACK
#52

Secure MySQL
Basic steps you can take to harden your MySQL installation
[Discuss (0) | Link to this hack]

HACK
#53

Share Files Securely in Unix
Use SFS to help secure your remote filesystems
[Discuss (0) | Link to this hack]

Logging

HACK
#54

Run a Central Syslog Server
Keep your logs safe from attackers by storing them remotely
[Discuss (0) | Link to this hack]

HACK
#55

Steer Syslog
Make syslog work harder, and spend less time looking through huge log files
[Discuss (0) | Link to this hack]

HACK
#56

Integrate Windows into Your Syslog Infrastructure
Keep track of all of your Windows hosts the Unix way
[Discuss (0) | Link to this hack]

HACK
#57

Automatically Summarize Your Logs
Wade through that haystack of logs to find the proverbial needle
[Discuss (0) | Link to this hack]

HACK
#58

Monitor Your Logs Automatically
Use swatch to alert you to possible problems as they happen
[Discuss (0) | Link to this hack]

HACK
#59

Aggregate Logs from Remote Sites
Integrate collocated and other remote systems or networks into your central syslog infrastructure
[Discuss (0) | Link to this hack]

HACK
#60

Log User Activity with Process Accounting
Keep a detailed audit trail of what's being done on your systems
[Discuss (0) | Link to this hack]

Monitoring and Trending

HACK
#61

Monitor Availability
Use Nagios to keep tabs on your network
[Discuss (1) | Link to this hack]

HACK
#62

Graph Trends
Use RRDtool to easily generate graphs for just about anything
[Discuss (0) | Link to this hack]

HACK
#63

Run ntop for Real-Time Network Stats
See who's doing what on your network over time with ntop
[Discuss (0) | Link to this hack]

HACK
#64

Audit Network Traffic
Use Argus to monitor your network and to keep an audit trail of your traffic
[Discuss (0) | Link to this hack]

HACK
#65

Collect Statistics with Firewall Rules
Make your firewall ruleset do the work for you when you want to collect statistics
[Discuss (0) | Link to this hack]

HACK
#66

Sniff the Ether Remotely
Monitor your networks remotely with rpcapd
[Discuss (0) | Link to this hack]

Secure Tunnels

HACK
#67

Set Up IPsec Under Linux
Secure your traffic in Linux with FreeS/WAN
[Discuss (0) | Link to this hack]

HACK
#68

Set Up IPsec Under FreeBSD
Use FreeBSD's built-in IPsec support to secure your traffic
[Discuss (0) | Link to this hack]

HACK
#69

Set Up IPsec in OpenBSD
Use IPsec the OpenBSD way
[Discuss (0) | Link to this hack]

HACK
#70

PPTP Tunneling
Set up quick and easy VPN access using the Point-to-Point Tunneling Protocol
[Discuss (0) | Link to this hack]

HACK
#71

Opportunistic Encryption with FreeS/WAN
Use FreeS/WAN and DNS TXT records to automatically create encrypted connections between machines
[Discuss (0) | Link to this hack]

HACK
#72

Forward and Encrypt Traffic with SSH
Keep network traffic to arbitrary ports secure with ssh port forwarding
[Discuss (0) | Link to this hack]

HACK
#73

Quick Logins with SSH Client Keys
Use SSH keys instead of password authentication to speed up and automate logins
[Discuss (0) | Link to this hack]

HACK
#74

Squid Proxy over SSH
Secure your web traffic from prying eyes—and improve performance in the process
[Discuss (0) | Link to this hack]

HACK
#75

Use SSH as a SOCKS Proxy
Protect your web traffic using the basic VPN functionality built into SSH itself
[Discuss (0) | Link to this hack]

HACK
#76

Encrypt and Tunnel Traffic with SSL
Use stunnel to add SSL encryption to any network service
[Discuss (0) | Link to this hack]

HACK
#77

Tunnel Connections Inside HTTP
Break through draconian firewalls by using httptunnel
[Discuss (0) | Link to this hack]

HACK
#78

Tunnel with VTun and SSH
Connect two networks using VTun and a single SSH connection
[Discuss (0) | Link to this hack]

HACK
#79

Automatic vtund.conf Generator
Generate a vtund.conf on the fly to match changing network conditions
[Discuss (0) | Link to this hack]

HACK
#80

Create a Cross-Platform VPN
Use OpenVPN to easily tie your networks together
[Discuss (0) | Link to this hack]

HACK
#81

Tunnel PPP
Use PPP and SSH to create a secure VPN tunnel
[Discuss (0) | Link to this hack]

Network Intrusion Detection

HACK
#82

Detect Intrusions with Snort
Use one of the most powerful (and free) network intrusion detection systems available to help you keep an eye on your network
[Discuss (0) | Link to this hack]

HACK
#83

Keep Track of Alerts
Use ACID to make sense of your IDS logs
[Discuss (0) | Link to this hack]

HACK
#84

Real-Time Monitoring
Use Sguil's advanced GUI to monitor and analyze IDS events in a timely manner
[Discuss (0) | Link to this hack]

HACK
#85

Manage a Sensor Network
Use SnortCenter's easy-to-use web interface to manage your NIDS sensors
[Discuss (0) | Link to this hack]

HACK
#86

Write Your Own Snort Rules
Customize Snort for your own needs quickly and easily by leveraging its flexible rule engine and language
[Discuss (0) | Link to this hack]

HACK
#87

Prevent and Contain Intrusions with Snort_inline
Install Snort_inline on your firewall to contain intrusions, or to stop them as they're happening
[Discuss (0) | Link to this hack]

HACK
#88

Automated Dynamic Firewalling with SnortSam
Use SnortSam to prevent intrusions by putting dynamic firewall rules in place to stop in-progress attacks
[Discuss (0) | Link to this hack]

HACK
#89

Detect Anomalous Behavior
Detect attacks and intrusions by monitoring your network for abnormal traffic, regardless of the actual content
[Discuss (0) | Link to this hack]

HACK
#90

Automatically Update Snort's Rules
Keep your Snort rules up-to-date with Oinkmaster
[Discuss (0) | Link to this hack]

HACK
#91

Create a Distributed Stealth Sensor Network
Keep your IDS sensors safe from attack, while still giving yourself access to their data
[Discuss (0) | Link to this hack]

HACK
#92

Use Snort in High-Performance Environments with Barnyard
Decouple Snort's output stage so it can keep pace with the packets
[Discuss (0) | Link to this hack]

HACK
#93

Detect and Prevent Web Application Intrusions
Protect your web server and dynamic content from intrusions
[Discuss (0) | Link to this hack]

HACK
#94

Simulate a Network of Vulnerable Hosts
Use honeyd to fool would-be attackers into chasing ghosts
[Discuss (0) | Link to this hack]

HACK
#95

Record Honeypot Activity
Keep track of everything that happens on your honeypot
[Discuss (0) | Link to this hack]

Recovery and Response

HACK
#96

Image Mounted Filesystems
Make a bit-for-bit copy of your system's disk for forensic analysis
[Discuss (0) | Link to this hack]

HACK
#97

Verify File Integrity and Find Compromised Files
Use Tripwire to alert you to compromised files or verify file integrity in the event of a compromise
[Discuss (0) | Link to this hack]

HACK
#98

Find Compromised Packages with RPM
Verify operating system installed files in an RPM-based distribution
[Discuss (0) | Link to this hack]

HACK
#99

Scan for Root Kits
Use chkrootkit to determine the extent of a compromise
[Discuss (1) | Link to this hack]

HACK
#100

Find the Owner of a Network
Track down network contacts using WHOIS databases
[Discuss (0) | Link to this hack]


O'Reilly Home | Privacy Policy

© 2005, O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.