Skip to content

Instantly share code, notes, and snippets.

View hackingbutlegal's full-sized avatar
💭
I may be slow to respond.

Jackie Singh hackingbutlegal

💭
I may be slow to respond.
View GitHub Profile
@hackingbutlegal
hackingbutlegal / gist:a37233367b43bfdce46a
Last active May 13, 2022 23:42
Awk script for device discovery
#
# Class C device discovery in under 5 seconds.
# Notice that it will display information on any MAC address that nmap knows about. It's helpful to keep this updated.
# You can also add any MAC address OIDs that are newer or unknown to the file /usr/share/nmap/nmap-mac-prefixes.
#
# How to call this script:
# nmap -n -sP --excludefile $PROJECT_ROOT/output/known.skip 10.10.100-103.1-255 | awk -f $PROJECT_ROOT/mac-sort.awk
#
BEGIN { PROJECT_PATH="/path/to/scripts"; }
@hackingbutlegal
hackingbutlegal / gist:92f268f114ecaec8a6c0
Created August 25, 2014 19:03
Iterate through IP's in a text file and output reverse DNS domain information.
for i in `cat ips.txt` ; do dig -x $i +short >> dns.txt ; done
@hackingbutlegal
hackingbutlegal / gist:e33affeaf2dc3de94753
Created August 26, 2014 07:27
Remove the trailing period when you have a long list of PTR DNS lookups
sed "s/\.$//"
@hackingbutlegal
hackingbutlegal / gist:30b10aa60d9fc646d5f9
Created August 27, 2014 16:38
Query Whois using IP's in a text file and output the important bits to a separate file.
#!/bin/bash
for a in `awk -F: '{print $1}' ip1.txt`
do
echo "$((i++)) $1:" >> whoisdb.txt
whois $a | awk '/NetName/ || /OrgName/{print}' >> whoisdb.txt
echo -e "\n" >> whoisdb.txt
done
@hackingbutlegal
hackingbutlegal / gist:0a4f6dab5c52df71aed6
Created September 12, 2014 13:48
Connect to VPN to check certificate without using VPN client
openssl s_client -connect vpn.yourcompany.com:443
@hackingbutlegal
hackingbutlegal / gist:65c6ab1e0bece3501163
Created September 26, 2014 18:54
Check for ShellShock
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
ip=$( echo $1 | cut -d"/" -f1 )
no=$( echo $1 | cut -d"/" -f2 )
k=`expr 32 - $no`
nu=$(echo "2 ^ $k" | bc)
num=1
new_ip=$( echo $ip | cut -d"." -f1-3 )
while [[ $num -ne $nu ]]
do
echo $new_ip".$num"
(( num = num + 1 ))
@hackingbutlegal
hackingbutlegal / gist:fe19b761fee744eba27c
Created October 12, 2014 17:32
Convert an .iso to .img in OS X
hdiutil convert -format UDRW -o ~/target.img ~/file.iso
@hackingbutlegal
hackingbutlegal / gist:0b0cc8bbfba072da0be7
Created October 13, 2014 03:29
What service is listening on my ports?
lsof -Pnl +M -i4
@hackingbutlegal
hackingbutlegal / gist:080653e37b41eb209e8a
Created October 17, 2014 02:08
Run Chrome Canary for OS X with args to disable SSL 3.0
do shell script "open -a /Applications/Google\ Chrome\ Canary.app --args --ssl-version-min=tls1"