Skip to content

Instantly share code, notes, and snippets.

@hook-s3c
Created May 10, 2018 20:36
Show Gist options
  • Select an option

  • Save hook-s3c/bc25a09ef7986493ccb10faed820440c to your computer and use it in GitHub Desktop.

Select an option

Save hook-s3c/bc25a09ef7986493ccb10faed820440c to your computer and use it in GitHub Desktop.
Quick utils / alias bash script for convenience when using nmap/airodump/mitmf
alias mygateway="print $(route -n | grep 'UG[ \t]' | awk '{print $2}')"
alias myinterface="print $(route -n | grep 'UG[ \t]' | awk '{print $8}')"
alias mysubnet="print $(ip -o -f inet addr show | awk '/scope global/ {print $4}')"
@hook-s3c

hook-s3c commented May 10, 2018

Copy link
Copy Markdown
Author

Installing

wget https://gist.githubusercontent.com/hook-s3c/bc25a09ef7986493ccb10faed820440c/raw/1a2ae605ce4d7aa7627adad58af7a1a18f41da92/net_utils.sh ~/net_utils.sh
echo "source ~/net_utils.sh" >> ~/.zshrc
source ~/.zshrc

References / discussion

CIDR subnet line taken from;
https://stackoverflow.com/questions/33150176/get-subnet-mask-in-linux-using-bash

Gateway and interface;
https://serverfault.com/questions/31170/how-to-find-the-gateway-ip-address-in-linux

@hook-s3c

Copy link
Copy Markdown
Author

MITMf example;

 ./mitmf.py --arp --spoof -i $(myinterface) --gateway $(mygateway) --upsidedownternet

@hook-s3c

Copy link
Copy Markdown
Author

nmap example for local network scanning;

nmap $(mysubnet) -Pn -sV

@hook-s3c

Copy link
Copy Markdown
Author

airodump example;

airodump-ng $(myinterface) --manufacturer --ignore-negative-one --beacons -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment