diff --git a/.bash_functions b/.bash_functions index 11a7895..879629b 100644 --- a/.bash_functions +++ b/.bash_functions @@ -1,26 +1,44 @@ ### list of functions to source ### randpw() + { -openssl rand -base64 12 + openssl rand -base64 12 } cipher_check() + { -nmap --script ssl-enum-ciphers "$1" + nmap --script ssl-enum-ciphers "$1" } check_gzip() + { -curl -I -H 'Accept-Encoding: gzip,deflate' "$1" 2> /dev/null | grep --color 'Content-Encoding' && 'echo gzip enabled' || echo 'gzip not enabled' + curl -I -H 'Accept-Encoding: gzip,deflate' "$1" 2> /dev/null | grep --color 'Content-Encoding' && 'echo gzip enabled' || echo 'gzip not enabled' } ns() + { -dig +short "$1" + dig +short "$1" } mx() + { -dig +short MX "$1" + dig +short MX "$1" +} + +open_urls() + +{ + xargs -a "$1" firefox -new-tab "$line" + +} + +check_open_resolver() + +{ + nmap -sU -p 53 -sV -P0 --script "dns-recursion" "$1" } diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..0934715 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,10 @@ +# +# ~/.bash_profile +# + + +[[ -f ~/.bashrc ]] && . ~/.bashrc +[[ -f ~/.bash_functions ]] && . ~/.bash_functions +[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases +[[ -f ~/.env ]] && . ~/.env + diff --git a/.env b/.env new file mode 100644 index 0000000..dcf16c2 --- /dev/null +++ b/.env @@ -0,0 +1,9 @@ +# Enviroment Variables + +# Path variable +export PATH=$PATH:$HOME/bin + +# Bash prompt color - green +export PS1="\e[0;32m[\u@\h \W]\$ \e[m " + + diff --git a/.speedswapper b/.speedswapper new file mode 100644 index 0000000..72c4957 --- /dev/null +++ b/.speedswapper @@ -0,0 +1,5 @@ +! Swap caps lock and escape +remove Lock = Caps_Lock +keysym Escape = Caps_Lock +keysym Caps_Lock = Escape +add Lock = Caps_Lock diff --git a/bin/rblscan b/bin/rblscan new file mode 100755 index 0000000..5b16382 --- /dev/null +++ b/bin/rblscan @@ -0,0 +1,260 @@ +#!/bin/bash +# Scans IP against blocklists +# Enter the IP address to test it + +# Uses input to define needed information +ADDRESS=$1 + +# Verifies address is correct format and length +if [[ $ADDRESS =~ ([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3}) ]] ; then + : +else + echo "" + echo "Please supply a valid address" + echo "" + echo "Usage: rblscan [ip address] " >&2 + echo "" + + exit 1 +fi + +# Creates needed variables + +BACKADDRESS=$(echo $ADDRESS | sed -r 's/([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})/\4.\3.\2.\1/') +REVERSE=$(dig -x $ADDRESS +short) +SUBNETCIDR=$2 + +# Subnet hosts based on CIDR +if [[ $SUBNETCIDR = 31 ]] ; then + SUBNETSPAN="2" +elif [[ $SUBNETCIDR = 30 ]] ; then + SUBNETSPAN="4" +elif [[ $SUBNETCIDR = 29 ]] ; then + SUBNETSPAN="8" +elif [[ $SUBNETCIDR = 28 ]] ; then + SUBNETSPAN="16" +elif [[ $SUBNETCIDR = 27 ]] ; then + SUBNETSPAN="32" +elif [[ $SUBNETCIDR = 26 ]] ; then + SUBNETSPAN="64" +elif [[ $SUBNETCIDR = 25 ]] ; then + SUBNETSPAN="128" +elif [[ $SUBNETCIDR = 24 ]] ; then + SUBNETSPAN="256" +elif [[ $SUBNETCIDR = 23 ]] ; then + SUBNETSPAN="512" +elif [[ $SUBNETCIDR = 22 ]] ; then + SUBNETSPAN="1024" +elif [[ $SUBNETCIDR = 21 ]] ; then + SUBNETSPAN="2048" +elif [[ $SUBNETCIDR = 20 ]] ; then + SUBNETSPAN="4096" +elif [[ $SUBNETCIDR = 19 ]] ; then + SUBNETSPAN="8192" +elif [[ $SUBNETCIDR = 18 ]] ; then + SUBNETSPAN="16384" +elif [[ $SUBNETCIDR = 17 ]] ; then + SUBNETSPAN="32768" +elif [[ $SUBNETCIDR = 16 ]] ; then + SUBNETSPAN="65536" +elif [[ -z $SUBNETCIDR ]] ; then + : +else + echo "Please supply a valid CIDR" + echo "/16 is the largest scannable range" + exit +fi + +# List of RBLs +LISTS=" +b.barracudacentral.org +bb.barracudacentral.org +bl.deadbeef.com +bl.emailbasura.org +bl.spamcannibal.org +bl.spamcop.net +blackholes.five-ten-sg.com +blacklist.woody.ch +bogons.cymru.com +cbl.abuseat.org +cdl.anti-spam.org.cn +cidr.bl.mcafee.com +combined.abuse.ch +combined.rbl.msrbl.net +db.wpbl.info +dnsbl-1.uceprotect.net +dnsbl-2.uceprotect.net +dnsbl-3.uceprotect.net +dnsbl.cyberlogic.net +dnsbl.inps.de +dnsbl.njabl.org +dnsbl.sorbs.net +drone.abuse.ch +drone.abuse.ch +duinv.aupads.org +dul.dnsbl.sorbs.net +dul.ru +dyna.spamrats.com +dynip.rothen.com +http.dnsbl.sorbs.net +images.rbl.msrbl.net +ips.backscatterer.org +ix.dnsbl.manitu.net +korea.services.net +misc.dnsbl.sorbs.net +noptr.spamrats.com +ohps.dnsbl.net.au +omrs.dnsbl.net.au +orvedb.aupads.org +osps.dnsbl.net.au +osrs.dnsbl.net.au +owfs.dnsbl.net.au +owps.dnsbl.net.au +pbl.spamhaus.org +phishing.rbl.msrbl.net +probes.dnsbl.net.au +proxy.bl.gweep.ca +proxy.block.transip.nl +psbl.surriel.com +rbl.interserver.net +rbl.megarbl.net +rdts.dnsbl.net.au +relays.bl.gweep.ca +relays.bl.kundenserver.de +relays.nether.net +residential.block.transip.nl +ricn.dnsbl.net.au +rmst.dnsbl.net.au +sbl.spamhaus.org +short.rbl.jp +smtp.dnsbl.sorbs.net +socks.dnsbl.sorbs.net +spam.abuse.ch +spam.dnsbl.sorbs.net +spam.rbl.msrbl.net +spam.spamrats.com +spamlist.or.kr +spamrbl.imp.ch +t3direct.dnsbl.net.au +tor.dnsbl.sectoor.de +torserver.tor.dnsbl.sectoor.de +ubl.lashback.com +ubl.unsubscore.com +virbl.bit.nl +virus.rbl.jp +virus.rbl.msrbl.net +web.dnsbl.sorbs.net +wormrbl.imp.ch +xbl.spamhaus.org +zen.spamhaus.org +zombie.dnsbl.sorbs.net +" + +## Basic Functions ## +# All of the basic functions are here. + +# Checks if you're scanning a range or not +function rangecheck { + if [[ -n "$SUBNETCIDR" ]] ; then + rangebuild + rangeoutput + rangescan + fi +} + +# Builds range based on CIDR +function rangebuild { + ADDRLOCTET=$(echo $ADDRESS | sed -r 's/([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})/\4/') + ADDRNET=$(echo $ADDRESS | sed -r 's/([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})/\1.\2.\3./') + RANGEEND=$(expr $ADDRLOCTET + $SUBNETSPAN) + RANGELOCTS=$(seq $ADDRLOCTET $RANGEEND) + RANGEARRAY=$(for i in $RANGELOCTS ; do echo $ADDRNET$i ; done) + BACKRANGEARRAY=$(for RANGEARRA in ${RANGEARRAY} ; do echo ${RANGEARRA} | sed -r 's/([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})/\4.\3.\2.\1/' ; done) +} + +# Scans range +function rangescan { + for BACKRANGEARRA in ${BACKRANGEARRAY} ; do + for LIST in ${LISTS} ; do + if [[ $(dig +short ${BACKRANGEARRA}.${LIST}.) =~ 127.0.0.[2-50] ]] ; then + echo "" + echo $(echo $BACKRANGEARRA | sed -r 's/([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})/\4.\3.\2.\1/') " is listed in $LIST" + fi + done + done + echo "" + echo "Scan completed!!!" + echo "" + exit +} + + +# Runs the check against the list of RBLs then prints a result if it is listed +function defaultscan { + for LIST in ${LISTS} ; do + if [[ $(dig +short ${BACKADDRESS}.${LIST}.) =~ 127.0.0.[2-50] ]] ; then + echo "Listed in ${LIST}" + fi + done + echo "" + echo "Scan completed!!!" + echo "" +} + +# Begin Output +function defaultout { + echo "" + echo "+----------------------------------------------------------------------+" + echo "" + echo " IP Address is: " $ADDRESS + echo " Reverse DNS (if any) is: " $REVERSE + echo "" + echo "+----------------------------------------------------------------------+" + echo "" + echo "" + echo "Running query now, this may take some time..." + echo "If nothing comes up, you're not listed on known blacklists." +} + +# Range Output +function rangeoutput { + echo "" + echo "+----------------------------------------------------------------------+" + echo "" + echo " Range scan started on: " $ADDRESS + echo " Subnet size: /"$SUBNETCIDR + echo "" + echo "+----------------------------------------------------------------------+" + echo "" + echo "" + echo "Running scan against this range, this may take some time..." + echo "" + echo "If nothing comes up, your range is not listed on known blocklists." +} + +# Help Menu with -h +while getopts ":h" SWITCH; do + case $SWITCH in + h) + echo "" + echo "IP Blocklist checker" >&2 + echo "" + echo "Usage: rblscan [ip address] " >&2 + echo "" + exit 1 + ;; + \?) + echo "" + echo "Invalid option: -$OPTARG" >&2 + echo "Please use -h for help" >&2 + echo "Usage: rblscan [ip address] " + exit 1 + ;; + esac +done + +rangecheck +defaultout +defaultscan + +exit diff --git a/bin/rebind_caps_to_esc b/bin/rebind_caps_to_esc new file mode 100755 index 0000000..ebe36ef --- /dev/null +++ b/bin/rebind_caps_to_esc @@ -0,0 +1,10 @@ +#!/bin/bash +# rebinds caps lock key to esc +# requires ~/.sweepswapper + +if [ ! -e ~/.speedswapper ]; then + echo "$HOME/.speedswapper does not exist." + exit +fi + +xmodmap ~/.speedswapper