Scripts/Linux/Functions/IP_Stuff.sh

20 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2021-11-06 23:27:56 +00:00
## My IP Info
alias myip='MYIP=$(curl -s https://ipecho.net/plain; echo) && curl https://ipinfo.io/"$MYIP" && echo'
## IP infomation
alias ports-in-use='sudo lsof -i -P -n | grep LISTEN'
## View HTTP traffic
function sniff() {
sudo ngrep -d $(ip route | grep '^default' | awk '{print $5}') -t '^(GET|POST) ' 'tcp and port 80'
}
##
function httpdump() {
sudo tcpdump -i $(ip route | grep '^default' | awk '{print $5}') -n -s 0 -w - | grep -a -o -E \"Host\\: .*|GET \\/.*\"
}
## Wireshark Shortcuts
alias wireshark-pfsense="sudo su -c 'wireshark -k -i <(ssh root@192.168.0.3 -p 2222 tcpdump -i lagg0 host not 192.168.120.27 -U -w- )'"
alias wireshark-pfsense-lab="sudo su -c 'wireshark -k -i <(ssh root@10.74.85.11 -p 2222 tcpdump -i xn0 host not 192.168.120.27 -U -w - )'"