Difference between revisions of "Network/Tools"

From LunaSys
Jump to navigation Jump to search
(Created page with "== Nice commands == taken from: - [http://www.cyberciti.biz/tips/linux-investigate-sockets-network-connections.html] - [http://www.cyberciti.biz/tips/netstat-command-tutori...")
(No difference)

Revision as of 12:49, 21 March 2012

Nice commands

taken from:

- [1]
- [2]

useful to find out if your server is under attack or not. You can also list abusive IP address using this method.

# netstat -nat | awk '{print $6}' | sort | uniq -c | sort -n

Dig out more information about a specific ip address:

# netstat -nat |grep {IP-address} | awk '{print $6}' | sort | uniq -c | sort -n

To print list of all unique IP address connected to server, enter:

# netstat -nat | awk '{ print $5}' | cut -d: -f1 | sed -e '/^$/d' | uniq

If you think your Linux box is under attack, print out a list of open connections on your box and sorts them by according to IP address, enter:

# netstat -atun | awk '{print $5}' | cut -d: -f1 | sed -e '/^$/d' |sort | uniq -c | sort -n