Skip to content

Commit

Permalink
added the ability to provide external IP on WPAD poison via DHCP
Browse files Browse the repository at this point in the history
lgandx committed Dec 10, 2021

Verified

This commit was signed with the committer’s verified signature.
jvnipers Juniper
1 parent 5680487 commit ba885b9
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion poisoners/DHCP.py
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ def __str__(self):
RespondTo = [_f for _f in [x.upper().strip() for x in config.get('Responder Core', 'RespondTo').strip().split(',')] if _f]
DontRespondTo = [_f for _f in [x.upper().strip() for x in config.get('Responder Core', 'DontRespondTo').strip().split(',')] if _f]
Interface = settings.Config.Interface
Responder_IP = FindLocalIP(Interface, None)
Responder_IP = RespondWithIP()
ROUTERIP = Responder_IP # Set to Responder_IP in case we fall on a static IP network and we don't get a DHCP Offer. This var will be updated with the real dhcp IP if present.
NETMASK = "255.255.255.0"
DNSIP = "0.0.0.0"
14 changes: 8 additions & 6 deletions settings.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@

from utils import *

__version__ = 'Responder 3.0.8.0'
__version__ = 'Responder 3.0.9.0'

class Settings:

@@ -131,11 +131,7 @@ def populate(self, options):
self.Verbose = options.Verbose
self.ProxyAuth_On_Off = options.ProxyAuth_On_Off
self.CommandLine = str(sys.argv)

if self.ExternalIP:
self.ExternalIPAton = socket.inet_aton(self.ExternalIP)

self.Bind_To = utils.FindLocalIP(self.Interface, self.OURIP)
self.Bind_To = utils.FindLocalIP(self.Interface, self.OURIP)

if self.Interface == "ALL":
self.Bind_To_ALL = True
@@ -146,6 +142,12 @@ def populate(self, options):
self.IP_aton = socket.inet_aton(self.OURIP)
else:
self.IP_aton = socket.inet_aton(self.Bind_To)

if self.ExternalIP:
self.ExternalIPAton = socket.inet_aton(self.ExternalIP)
self.ExternalResponderIP = utils.RespondWithIP()
else:
self.ExternalResponderIP = self.Bind_To

self.Os_version = sys.platform

12 changes: 12 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
@@ -128,6 +128,18 @@ def RespondWithIPAton():
else:
return settings.Config.IP_aton.decode('latin-1')

def RespondWithIP():
if settings.Config.PY2OR3 == "PY2":
if settings.Config.ExternalIP:
return settings.Config.ExternalIP
else:
return settings.Config.Bind_To
else:
if settings.Config.ExternalIP:
return settings.Config.ExternalIP
else:
return settings.Config.Bind_To

def OsInterfaceIsSupported():
if settings.Config.Interface != "Not set":
return not IsOsX()

0 comments on commit ba885b9

Please sign in to comment.