Merge pull request #3 from DanMcInerney/master

Update dev. fork
This commit is contained in:
David Dworken 2014-11-10 13:01:19 -05:00
commit 9b9f6d70a5
2 changed files with 25 additions and 22 deletions

37
LANs.py
View file

@ -64,7 +64,6 @@ from twisted.internet.protocol import Protocol, Factory
from sys import exit from sys import exit
from threading import Thread, Lock from threading import Thread, Lock
import argparse import argparse
import signal
from base64 import b64decode from base64 import b64decode
from subprocess import * from subprocess import *
from zlib import decompressobj, decompress from zlib import decompressobj, decompress
@ -166,23 +165,24 @@ def LANsMain(args):
ipr = Popen(['/sbin/ip', 'route'], stdout=PIPE, stderr=DN) ipr = Popen(['/sbin/ip', 'route'], stdout=PIPE, stderr=DN)
ipr = ipr.communicate()[0] ipr = ipr.communicate()[0]
iprs = ipr.split('\n') iprs = ipr.split('\n')
routerIP = None ipr = ipr.split()
if args.routerip:
routerIP = args.routerip
else:
try:
routerIP = ipr[2]
except:
exit("You must be connected to the internet to use this.")
for r in iprs: for r in iprs:
if '/' in r: if '/' in r:
IPprefix = r.split()[0] IPprefix = r.split()[0]
if r.startswith('default'):
if not args.interface:
interface = r.split()[4]
if not args.routerip:
routerIP = r.split()[2]
if args.routerip:
routerIP = args.routerip
if not routerIP:
exit("[-] You must be connected to the internet to use this.")
if args.interface: if args.interface:
interface = args.interface interface = args.interface
else:
interface = ipr[4]
if 'eth' in interface or 'p3p' in interface: if 'eth' in interface or 'p3p' in interface:
exit('[-] Wired interface found as default route, please connect wirelessly and retry, or specify the active interface with the -i [interface] option. See active interfaces with [ip addr] or [ifconfig].') exit(
'[-] Wired interface found as default route, please connect wirelessly and retry, or specify the active interface with the -i [interface] option. See active interfaces with [ip addr] or [ifconfig].')
if args.ipaddress: if args.ipaddress:
victimIP = args.ipaddress victimIP = args.ipaddress
else: else:
@ -670,14 +670,18 @@ class Parser():
logger.write('[*] ' + url + '\n') logger.write('[*] ' + url + '\n')
if self.args.urlspy: if self.args.urlspy:
tempURL = url
tempURL.split("?")[0] #Strip all data (e.g. www.google.com/?g=5 goes to www.google.com/)
tempURL.strip("/") #Strip all /
fileFilterList = ['.jpg', '.jpeg', '.gif', '.png', '.css', '.ico', '.js', '.svg', '.woff'] fileFilterList = ['.jpg', '.jpeg', '.gif', '.png', '.css', '.ico', '.js', '.svg', '.woff']
domainFilterList = ['adzerk.net', 'adwords.google.com', 'googleads.g.doubleclick.net', 'pagead2.googlesyndication.com']
tempURL = url
tempURL = tempURL.split("?")[0] #Strip all data (e.g. www.google.com/?g=5 goes to www.google.com/)
tempURL = tempURL.strip("/") #Strip all /
printURL = True # default to printing URL printURL = True # default to printing URL
for fileType in fileFilterList: for fileType in fileFilterList: #Used to check if it is one of the blacklisted file types
if tempURL.endswith(fileType): if tempURL.endswith(fileType):
printURL = False #Don't print if it is one of the bad file types printURL = False #Don't print if it is one of the bad file types
for blockedDomain in domainFilterList:
if blockedDomain in tempURL:
printURL = False #Don't print if it is one of the blocked domains
if printURL: if printURL:
if len(url) > 146: if len(url) > 146:
print '[*] ' + url[:145] print '[*] ' + url[:145]
@ -1275,7 +1279,6 @@ def iwconfig():
DN = open(os.devnull, 'w') DN = open(os.devnull, 'w')
proc = Popen(['iwconfig'], stdout=PIPE, stderr=DN) proc = Popen(['iwconfig'], stdout=PIPE, stderr=DN)
for line in proc.communicate()[0].split('\n'): for line in proc.communicate()[0].split('\n'):
print line
if len(line) == 0: continue # Isn't an empty string if len(line) == 0: continue # Isn't an empty string
if line[0] != ' ': # Doesn't start with space if line[0] != ' ': # Doesn't start with space
wired_search = re.search('eth[0-9]|em[0-9]|p[1-9]p[1-9]', line) wired_search = re.search('eth[0-9]|em[0-9]|p[1-9]p[1-9]', line)

View file

@ -7,7 +7,7 @@ LANs.py
* Also can be used to continuously jam nearby WiFi networks. This has an approximate range of a 1 block radius, but this can vary based off of the strength of your WiFi card. This can be fine-tuned to allow jamming of everyone or even just one client. Cannot jam WiFi and spy simultaneously. * Also can be used to continuously jam nearby WiFi networks. This has an approximate range of a 1 block radius, but this can vary based off of the strength of your WiFi card. This can be fine-tuned to allow jamming of everyone or even just one client. Cannot jam WiFi and spy simultaneously.
Prerequisites: Linux, python-scapy, python-nfqueue (nfqueue-bindings 0.4-3), aircrack-ng, python-twisted, BeEF (optional), nmap, nbtscan, and a wireless card capable of promiscuous mode if you don't know the IP of your target. Prerequisites: Linux, python-scapy, python-nfqueue (nfqueue-bindings 0.4-3), aircrack-ng, python-twisted, BeEF (optional), nmap, nbtscan, tcpdump, and a wireless card capable of promiscuous mode if you don't know the IP of your target.
Tested on Kali. In the following examples 192.168.0.5 will be the attacking machine and 192.168.0.10 will be the victim. Tested on Kali. In the following examples 192.168.0.5 will be the attacking machine and 192.168.0.10 will be the victim.