Wednesday 2 November 2011

Ben ain't heavy

Stuff I forget:


#run a web service with full detail debugging, xml file is a soap message
wget --debug --post-file='things.xml' --header='Content-Type:application/soap+xml;charset=UTF-8'  http://localhost:8088/someService

#monitor all traffic for a web service (this will not be as useful with HTTPS as the https data will appear as encrypted)
sudo /usr/sbin/tcpdump host 10.1.1.2 -i eth0 -vv

#search all jars; unzip and search for stuff
find . -type f -name '*.jar' -print0 | xargs -n1 -0i sh -c 'unzip -t "{}" | grep -nH SomeSearchCriteria && echo "{}"'

#find anything and grep it in a file that is not a log file
sudo find . -type f \( ! -iwholename "*log*" \) -exec grep -HniI "someTerm" {} \;

sudo find . -type f \( ! -iwholename "*log*" \) -exec egrep -Hn "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" {} \;

#search inside zips
find . -type f -name '*.zip' -print0 | xargs -n1 -0i sh -c 'unzip -t "{}" | grep -nH sql && echo "{}"'

#find any hardcoded IP addresses
sudo find . -type f \( ! -iwholename "*log*" \) -exec egrep -HnI "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" {} \;

#find and grep
find . -type f -exec sed -i 's/Default/BC/g' {} \;

No comments:

Post a Comment