Skip to content

Instantly share code, notes, and snippets.

@sente
Last active November 23, 2015 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sente/ab3b8a2db14ec8dc06d2 to your computer and use it in GitHub Desktop.
Save sente/ab3b8a2db14ec8dc06d2 to your computer and use it in GitHub Desktop.
# Sort+Unique IP Addresses
cat IP-List.txt|sort -n -u -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
# Grep IP Addresses in File
egrep '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' Filename.txt
# Dig A Record to CSV (Format: Hostname,IP Address)
for i in `cat Host-List.txt`;do dig +short ${i} a|awk '!/[a-z]/'|sed "s/^/${i},/g";done
# Remove Password from PDF
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=Unencrypted.pdf -c .setpdfwrite -f Encrypted.pdf
# Auto-Nikto in IP-Port.txt Report Format (Host-List in IP:PORT Format)
for i in $(cat Host-List.txt);do host=`echo ${i}|sed 's/:/-/'` && nikto -host ${i} -output ${host}.txt;done
# Pin APT Packages
echo [PACKAGE] hold|dpkg --set-selections
# Release Pinned APT Packages
echo [PACKAGE] install|dpkg --set-selections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment