From 7eb4e7ae6e1e3fa89a6ad25b79b7263180a75281 Mon Sep 17 00:00:00 2001 From: mick Date: Sun, 29 Dec 2019 09:39:24 +0100 Subject: [PATCH] Add variables for tcpdump ports --- nac_bypass_setup.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/nac_bypass_setup.sh b/nac_bypass_setup.sh index 8dfc996..6426e01 100644 --- a/nac_bypass_setup.sh +++ b/nac_bypass_setup.sh @@ -39,6 +39,10 @@ OPTION_CONNECTION_SETUP_ONLY=0 OPTION_INITIAL_SETUP_ONLY=0 OPTION_RESET=0 +## Ports for tcpdump +TCPDUMP_PORT_1=88 +TCPDUMP_PORT_2=445 + ## Ports for Responder PORT_UDP_NETBIOS_NS=137 PORT_UDP_NETBIOS_DS=138 @@ -215,14 +219,15 @@ ConnectionSetup() { echo fi - # We pcap any kerberos or smb traffic should be some in Windows land - tcpdump -i $COMPINT -s0 -w $TEMP_FILE -c1 tcp dst port 88 or port 445 + ## We pcap any kerberos or smb traffic should be some in Windows land + ## Default: $TCPDUMP_PORT_1 = 88 and $TCPDUMP_PORT_2 = 445 + tcpdump -i $COMPINT -s0 -w $TEMP_FILE -c1 tcp dst port $TCPDUMP_PORT_1 or port $TCPDUMP_PORT_2 - COMPMAC=`tcpdump -r $TEMP_FILE -nne -c 1 tcp dst port 88 or port 445 | awk '{print $2","$4$10}' | cut -f 1-4 -d.| awk -F ',' '{print $1}'` + COMPMAC=`tcpdump -r $TEMP_FILE -nne -c 1 tcp dst port $TCPDUMP_PORT_1 or port $TCPDUMP_PORT_2 | awk '{print $2","$4$10}' | cut -f 1-4 -d.| awk -F ',' '{print $1}'` if [ -z "$GWMAC" ]; then - GWMAC=`tcpdump -r $TEMP_FILE -nne -c 1 tcp dst port 88 or port 445 | awk '{print $2","$4$10}' |cut -f 1-4 -d.| awk -F ',' '{print $2}'` + GWMAC=`tcpdump -r $TEMP_FILE -nne -c 1 tcp dst port $TCPDUMP_PORT_1 or port $TCPDUMP_PORT_2 | awk '{print $2","$4$10}' |cut -f 1-4 -d.| awk -F ',' '{print $2}'` fi - COMIP=`tcpdump -r $TEMP_FILE -nne -c 1 tcp dst port 88 or port 445 | awk '{print $3","$4$10}' |cut -f 1-4 -d.| awk -F ',' '{print $3}'` + COMIP=`tcpdump -r $TEMP_FILE -nne -c 1 tcp dst port $TCPDUMP_PORT_1 or port $TCPDUMP_PORT_2 | awk '{print $3","$4$10}' |cut -f 1-4 -d.| awk -F ',' '{print $3}'` if [ "$OPTION_AUTONOMOUS" -eq 0 ]; then echo @@ -231,7 +236,7 @@ ConnectionSetup() { echo fi - # Going Silent + ## Going Silent $CMD_ARPTABLES -A OUTPUT -j DROP $CMD_IPTABLES -A OUTPUT -j DROP