lgandx / Responder

Responder is a LLMNR, NBT-NS and MDNS poisoner, with built-in HTTP/SMB/MSSQL/FTP/LDAP rogue authentication server supporting NTLMv1/NTLMv2/LMv2, Extended Security NTLMSSP and Basic HTTP authentication.
GNU General Public License v3.0
5.39k stars 768 forks source link

MacOsX support #272

Open r4z0r5 opened 6 months ago

r4z0r5 commented 6 months ago

https://github.com/lgandx/Responder/blob/1a2f2fdb22a2bf8b04e0ac99219831457b7ba43a/settings.py#L182

This line is causing the following error:

File "/Users/whatever/Repositories/Responder/settings.py", line 182, in populate
    self.IP_aton   = socket.inet_aton(self.Bind_To)

OSError: illegal IP address string passed to inet_aton

Responder started as: sudo python3.9 ./Responder.py -I en0

I debugged the problem a bit and found out the interface name (in my case 'en0') is passed to socket.inet_aton. As a temporary workaround I have changed the code a bit:

        #IPV4
        if self.Interface == "ALL":
            self.IP_aton   = socket.inet_aton(self.OURIP)
        else:
            print(self.Bind_To)
            self.IP_aton = socket.inet_aton(netifaces.ifaddresses(self.Bind_To)[netifaces.AF_INET][0]['addr'])
        #IPV6

This resolves the OSError, perhaps this fix should be included in next version.

Sincerly, Darwin 22.6.0 Darwin Kernel Version 22.6.0 arm64