Print Active Connections To Port 80 Per IP Address

by Rick on

netstat -plan | grep :80 | grep -E "(EST|LIST)" | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1

Remove Iframe Injected Code

by Kyle on

If your index.html and index.php files have suffered from an iframe injection, you can use the following grep/sed command for clearing it out.

Please be careful and test first with just the grep command to ensure you don't clear out anything you don't need.

This command does not backup files!

grep -lr -e '<iframe src="http://.*</iframe>' * | xargs sed -i 's/<iframe src="http:\/\/.*<\/iframe>//g'

Search Inside Files And List Matches

by Kyle on

find . -type f -exec grep -l 'KEYWORDS' {} /dev/null \;

Search Strings In PHP Code

by Kyle on

find . -name "*.php" -exec grep string {} \; -exec echo -e {} \;

Hide Sidebar