mirror of
https://github.com/lgandx/Responder.git
synced 2025-07-16 10:02:53 -07:00
minor changes
This commit is contained in:
parent
5ab431a4fe
commit
d0f5b9a39e
5 changed files with 62 additions and 32 deletions
10
README.md
10
README.md
|
@ -101,6 +101,16 @@ Edit this file /etc/NetworkManager/NetworkManager.conf and comment the line: `dn
|
|||
|
||||
- This tool is not meant to work on Windows.
|
||||
|
||||
- For OSX, please note: Responder must be launched with an IP address for the -i flag (e.g. -i YOUR_IP_ADDR). There is no native support in OSX for custom interface binding. Using -i en1 will not work. Also to run Responder with the best experience, run the following as root:
|
||||
|
||||
launchcl unload /System/Library/LaunchDaemons/com.apple.Kerberos.kdc.plist
|
||||
|
||||
launchcl unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
|
||||
|
||||
launchcl unload /System/Library/LaunchDaemons/com.apple.smbd.plist
|
||||
|
||||
launchcl unload /System/Library/LaunchDaemons/com.apple.netbiosd.plist
|
||||
|
||||
## Usage ##
|
||||
|
||||
First of all, please take a look at Responder.conf and tweak it for your needs.
|
||||
|
|
|
@ -29,6 +29,7 @@ banner()
|
|||
parser = optparse.OptionParser(usage='python %prog -I eth0 -w -r -f\nor:\npython %prog -I eth0 -wrf', version=settings.__version__, prog=sys.argv[0])
|
||||
parser.add_option('-A','--analyze', action="store_true", help="Analyze mode. This option allows you to see NBT-NS, BROWSER, LLMNR requests without responding.", dest="Analyze", default=False)
|
||||
parser.add_option('-I','--interface', action="store", help="Network interface to use", dest="Interface", metavar="eth0", default=None)
|
||||
parser.add_option('-i','--ip', action="store", help="Local IP to use \033[1m\033[31m(only for OSX)\033[0m", dest="OURIP", metavar="10.0.0.21", default=None)
|
||||
parser.add_option('-b', '--basic', action="store_true", help="Return a Basic HTTP authentication. Default: NTLM", dest="Basic", default=False)
|
||||
parser.add_option('-r', '--wredir', action="store_true", help="Enable answers for netbios wredir suffix queries. Answering to wredir will likely break stuff on the network. Default: False", dest="Wredirect", default=False)
|
||||
parser.add_option('-d', '--NBTNSdomain', action="store_true", help="Enable answers for netbios domain suffix queries. Answering to domain suffixes will likely break stuff on the network. Default: False", dest="NBTNSDomain", default=False)
|
||||
|
@ -44,6 +45,11 @@ if not os.geteuid() == 0:
|
|||
print color("[!] Responder must be run as root.")
|
||||
sys.exit(-1)
|
||||
|
||||
if options.OURIP is None and IsOsX() is True:
|
||||
print "\n\033[1m\033[31mOSX detected, -i mandatory option is missing\033[0m\n"
|
||||
parser.print_help()
|
||||
exit(-1)
|
||||
|
||||
settings.init()
|
||||
settings.Config.populate(options)
|
||||
|
||||
|
|
|
@ -65,12 +65,12 @@ def InjectData(data, client, req_uri):
|
|||
print text("[PROXY] Injecting into HTTP Response: %s" % color(settings.Config.HtmlToInject, 3, 1))
|
||||
|
||||
Content = Content.replace(HasBody[0], '%s\n%s' % (HasBody[0], settings.Config.HtmlToInject))
|
||||
Headers = Headers.replace("Content-Length: "+Len, "Content-Length: "+ str(len(Content)))
|
||||
|
||||
if "content-encoding: gzip" in Headers.lower():
|
||||
Content = zlib.compress(Content)
|
||||
|
||||
data = Headers +'\r\n'+ Content
|
||||
Headers = Headers.replace("Content-Length: "+Len, "Content-Length: "+ str(len(Content)))
|
||||
data = Headers +'\r\n\r\n'+ Content
|
||||
|
||||
else:
|
||||
if settings.Config.Verbose:
|
||||
|
|
|
@ -21,7 +21,9 @@ import utils
|
|||
import logging
|
||||
import ConfigParser
|
||||
|
||||
__version__ = 'Responder 2.2'
|
||||
from utils import IsOsX
|
||||
|
||||
__version__ = 'Responder 2.3'
|
||||
|
||||
class Settings:
|
||||
|
||||
|
@ -66,7 +68,7 @@ class Settings:
|
|||
|
||||
def populate(self, options):
|
||||
|
||||
if options.Interface is None:
|
||||
if options.Interface is None and IsOsX() is False:
|
||||
print utils.color("Error: -I <if> mandatory option is missing", 1)
|
||||
sys.exit(-1)
|
||||
|
||||
|
@ -154,6 +156,7 @@ class Settings:
|
|||
self.Basic = options.Basic
|
||||
self.Finger_On_Off = options.Finger
|
||||
self.Interface = options.Interface
|
||||
self.OURIP = options.OURIP
|
||||
self.Force_WPAD_Auth = options.Force_WPAD_Auth
|
||||
self.Upstream_Proxy = options.Upstream_Proxy
|
||||
self.AnalyzeMode = options.Analyze
|
||||
|
@ -163,7 +166,7 @@ class Settings:
|
|||
if self.HtmlToInject == None:
|
||||
self.HtmlToInject = ''
|
||||
|
||||
self.Bind_To = utils.FindLocalIP(self.Interface)
|
||||
self.Bind_To = utils.FindLocalIP(self.Interface, self.OURIP)
|
||||
|
||||
self.IP_aton = socket.inet_aton(self.Bind_To)
|
||||
self.Os_version = sys.platform
|
||||
|
|
17
utils.py
17
utils.py
|
@ -87,18 +87,29 @@ def OsInterfaceIsSupported():
|
|||
else:
|
||||
return False
|
||||
|
||||
def FindLocalIP(Iface):
|
||||
def IsOsX():
|
||||
Os_version = sys.platform
|
||||
if Os_version == "darwin":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def FindLocalIP(Iface, OURIP):
|
||||
|
||||
if Iface == 'ALL':
|
||||
return '0.0.0.0'
|
||||
|
||||
try:
|
||||
|
||||
if IsOsX():
|
||||
return OURIP
|
||||
else:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
s.setsockopt(socket.SOL_SOCKET, 25, Iface+'\0')
|
||||
s.connect(("127.0.0.1",9))#RFC 863
|
||||
ret = s.getsockname()[0]
|
||||
s.close()
|
||||
|
||||
return ret
|
||||
|
||||
except socket.error:
|
||||
|
@ -251,7 +262,7 @@ def banner():
|
|||
print banner
|
||||
print "\n \033[1;33mNBT-NS, LLMNR & MDNS %s\033[0m" % settings.__version__
|
||||
print ""
|
||||
print " Original work by Laurent Gaffie (lgaffie@trustwave.com)"
|
||||
print " Original work by Laurent Gaffie (lgaffie@trustwave.com) and supported by Laurent Gaffie"
|
||||
print " To kill this script hit CRTL-C"
|
||||
print ""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue