Python 2.4 syntax compatibility (try-except-finally, ternary operator)

Backported functions check_output and CalledProcessError
Lack of ssl module is now non-blocker. Responder will start with HTTPS server disabled
This commit is contained in:
Gifts 2017-01-12 15:46:40 +03:00
commit 15c8f53459
12 changed files with 188 additions and 109 deletions

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import optparse import optparse
import ssl
from SocketServer import TCPServer, UDPServer, ThreadingMixIn from SocketServer import TCPServer, UDPServer, ThreadingMixIn
from threading import Thread from threading import Thread
@ -23,6 +22,12 @@ from utils import *
import struct import struct
banner() banner()
try:
import ssl
except ImportError:
ssl = False
print color("[!] Module 'ssl' is unavailable. HTTPS is disabled")
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 = 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('-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, you can use 'ALL' as a wildcard for all interfaces", dest="Interface", metavar="eth0", default=None) parser.add_option('-I','--interface', action="store", help="Network interface to use, you can use 'ALL' as a wildcard for all interfaces", dest="Interface", metavar="eth0", default=None)
@ -35,7 +40,7 @@ parser.add_option('-r', '--wredir', action="store_true", help="Enable ans
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) 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)
parser.add_option('-f','--fingerprint', action="store_true", help="This option allows you to fingerprint a host that issued an NBT-NS or LLMNR query.", dest="Finger", default=False) parser.add_option('-f','--fingerprint', action="store_true", help="This option allows you to fingerprint a host that issued an NBT-NS or LLMNR query.", dest="Finger", default=False)
parser.add_option('-w','--wpad', action="store_true", help="Start the WPAD rogue proxy server. Default value is False", dest="WPAD_On_Off", default=False) parser.add_option('-w','--wpad', action="store_true", help="Start the WPAD rogue proxy server. Default value is False", dest="WPAD_On_Off", default=False)
parser.add_option('-u','--upstream-proxy', action="store", help="Upstream HTTP proxy used by the rogue WPAD Proxy for outgoing requests (format: host:port)", dest="Upstream_Proxy", default=None) parser.add_option('-u','--upstream-proxy', action="store", help="Upstream HTTP proxy used by the rogue WPAD Proxy for outgoing requests (format: host:port)", dest="Upstream_Proxy", default=False)
parser.add_option('-F','--ForceWpadAuth', action="store_true", help="Force NTLM/Basic authentication on wpad.dat file retrieval. This may cause a login prompt. Default: False", dest="Force_WPAD_Auth", default=False) parser.add_option('-F','--ForceWpadAuth', action="store_true", help="Force NTLM/Basic authentication on wpad.dat file retrieval. This may cause a login prompt. Default: False", dest="Force_WPAD_Auth", default=False)
parser.add_option('-P','--ProxyAuth', action="store_true", help="Force NTLM (transparently)/Basic (prompt) authentication for the proxy. WPAD doesn't need to be ON. This option is highly effective when combined with -r. Default: False", dest="ProxyAuth_On_Off", default=False) parser.add_option('-P','--ProxyAuth', action="store_true", help="Force NTLM (transparently)/Basic (prompt) authentication for the proxy. WPAD doesn't need to be ON. This option is highly effective when combined with -r. Default: False", dest="ProxyAuth_On_Off", default=False)
@ -237,7 +242,7 @@ def main():
from servers.HTTP import HTTP from servers.HTTP import HTTP
threads.append(Thread(target=serve_thread_tcp, args=('', 80, HTTP,))) threads.append(Thread(target=serve_thread_tcp, args=('', 80, HTTP,)))
if settings.Config.SSL_On_Off: if settings.Config.SSL_On_Off and ssl:
from servers.HTTP import HTTPS from servers.HTTP import HTTPS
threads.append(Thread(target=serve_thread_SSL, args=('', 443, HTTPS,))) threads.append(Thread(target=serve_thread_SSL, args=('', 443, HTTPS,)))

View file

@ -22,7 +22,7 @@ from odict import OrderedDict
from utils import HTTPCurrentDate, RespondWithIPAton from utils import HTTPCurrentDate, RespondWithIPAton
# Packet class handling all packet generation (see odict.py). # Packet class handling all packet generation (see odict.py).
class Packet(): class Packet:
fields = OrderedDict([ fields = OrderedDict([
("data", ""), ("data", ""),
]) ])

View file

@ -144,8 +144,10 @@ def ServeOPTIONS(data):
return False return False
def ServeFile(Filename): def ServeFile(Filename):
with open (Filename, "rb") as bk: bk = open(Filename, "rb")
return bk.read() data = bk.read()
bk.close()
return data
def RespondWithFile(client, filename, dlname=None): def RespondWithFile(client, filename, dlname=None):

View file

@ -236,17 +236,17 @@ class HTTP_Proxy(BaseHTTPServer.BaseHTTPRequestHandler):
soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try: try:
if self._connect_to(self.path, soc): try:
self.wfile.write(self.protocol_version +" 200 Connection established\r\n") if self._connect_to(self.path, soc):
self.wfile.write("Proxy-agent: %s\r\n" % self.version_string()) self.wfile.write(self.protocol_version +" 200 Connection established\r\n")
self.wfile.write("\r\n") self.wfile.write("Proxy-agent: %s\r\n" % self.version_string())
try: self.wfile.write("\r\n")
self._read_write(soc, 300) try:
except: self._read_write(soc, 300)
pass except:
except: pass
pass except:
pass
finally: finally:
soc.close() soc.close()
self.connection.close() self.connection.close()
@ -266,36 +266,36 @@ class HTTP_Proxy(BaseHTTPServer.BaseHTTPRequestHandler):
soc = self.socket_proxy(socket.AF_INET, socket.SOCK_STREAM) soc = self.socket_proxy(socket.AF_INET, socket.SOCK_STREAM)
else: else:
soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try: try:
URL_Unparse = urlparse.urlunparse(('', '', path, params, query, '')) try:
URL_Unparse = urlparse.urlunparse(('', '', path, params, query, ''))
if self._connect_to(netloc, soc): if self._connect_to(netloc, soc):
soc.send("%s %s %s\r\n" % (self.command, URL_Unparse, self.request_version)) soc.send("%s %s %s\r\n" % (self.command, URL_Unparse, self.request_version))
Cookie = self.headers['Cookie'] if "Cookie" in self.headers else '' Cookie = self.headers.get('Cookie', '')
if settings.Config.Verbose: if settings.Config.Verbose:
print text("[PROXY] Client : %s" % color(self.client_address[0], 3)) print text("[PROXY] Client : %s" % color(self.client_address[0], 3))
print text("[PROXY] Requested URL : %s" % color(self.path, 3)) print text("[PROXY] Requested URL : %s" % color(self.path, 3))
print text("[PROXY] Cookie : %s" % Cookie) print text("[PROXY] Cookie : %s" % Cookie)
self.headers['Connection'] = 'close' self.headers['Connection'] = 'close'
del self.headers['Proxy-Connection'] del self.headers['Proxy-Connection']
del self.headers['If-Range'] del self.headers['If-Range']
del self.headers['Range'] del self.headers['Range']
for k, v in self.headers.items(): for k, v in self.headers.items():
soc.send("%s: %s\r\n" % (k.title(), v)) soc.send("%s: %s\r\n" % (k.title(), v))
soc.send("\r\n") soc.send("\r\n")
try: try:
self._read_write(soc, netloc) self._read_write(soc, netloc)
except: except:
pass pass
except: except:
pass pass
finally: finally:
soc.close() soc.close()

View file

@ -22,6 +22,35 @@ from utils import *
__version__ = 'Responder 2.3.3.2' __version__ = 'Responder 2.3.3.2'
# Backport (monkeypatch) check_output and CalledProcessError
if not hasattr(subprocess, 'CalledProcessError'):
class CalledProcessError(Exception):
def __init__(self, returncode, cmd, output=None):
self.returncode = returncode
self.cmd = cmd
self.output = output
def __str__(self):
return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
subprocess.CalledProcessError = CalledProcessError
if not hasattr(subprocess, 'check_output'):
def check_output(*popenargs, **kwargs):
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.')
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
raise subprocess.CalledProcessError(retcode, cmd, output=output)
return output
subprocess.check_output = check_output
class Settings: class Settings:
def __init__(self): def __init__(self):
@ -229,17 +258,17 @@ class Settings:
try: try:
NetworkCard = subprocess.check_output(["ifconfig", "-a"]) NetworkCard = subprocess.check_output(["ifconfig", "-a"])
except subprocess.CalledProcessError as ex: except Exception,ex:
NetworkCard = "Error fetching Network Interfaces:", ex NetworkCard = "Error fetching Network Interfaces:", ex
pass pass
try: try:
DNS = subprocess.check_output(["cat", "/etc/resolv.conf"]) DNS = subprocess.check_output(["cat", "/etc/resolv.conf"])
except subprocess.CalledProcessError as ex: except subprocess.CalledProcessError,ex:
DNS = "Error fetching DNS configuration:", ex DNS = "Error fetching DNS configuration:", ex
pass pass
try: try:
RoutingInfo = subprocess.check_output(["netstat", "-rn"]) RoutingInfo = subprocess.check_output(["netstat", "-rn"])
except subprocess.CalledProcessError as ex: except subprocess.CalledProcessError,ex:
RoutingInfo = "Error fetching Routing information:", ex RoutingInfo = "Error fetching Routing information:", ex
pass pass
@ -247,7 +276,7 @@ class Settings:
try: try:
utils.DumpConfig(self.ResponderConfigDump, Message) utils.DumpConfig(self.ResponderConfigDump, Message)
utils.DumpConfig(self.ResponderConfigDump,str(self)) utils.DumpConfig(self.ResponderConfigDump,str(self))
except AttributeError as ex: except AttributeError, ex:
print "Missing Module:", ex print "Missing Module:", ex
pass pass

View file

@ -222,7 +222,10 @@ class DHCPInformACK(Packet):
self.fields["Op252Len"] = struct.pack(">b",len(str(self.fields["Op252Str"]))) self.fields["Op252Len"] = struct.pack(">b",len(str(self.fields["Op252Str"])))
def SpoofIP(Spoof): def SpoofIP(Spoof):
return ROUTERIP if Spoof else Responder_IP if Spoof:
return ROUTERIP
else:
return Responder_IP
def RespondToThisIP(ClientIp): def RespondToThisIP(ClientIp):
if ClientIp.startswith('127.0.0.'): if ClientIp.startswith('127.0.0.'):

View file

@ -39,7 +39,7 @@ def longueur(payload):
length = struct.pack(">i", len(''.join(payload))) length = struct.pack(">i", len(''.join(payload)))
return length return length
class Packet(): class Packet:
fields = OrderedDict([ fields = OrderedDict([
("data", ""), ("data", ""),
]) ])
@ -55,22 +55,30 @@ class Packet():
# Function used to write captured hashs to a file. # Function used to write captured hashs to a file.
def WriteData(outfile, data, user): def WriteData(outfile, data, user):
if not os.path.isfile(outfile): if not os.path.isfile(outfile):
with open(outfile,"w") as outf: outf = open(outfile,"w")
outf.write(data + '\n') outf.write(data + '\n')
return outf.close()
with open(outfile,"r") as filestr: return
if re.search(user.encode('hex'), filestr.read().encode('hex')):
return False filestr = open(outfile,"r")
elif re.search(re.escape("$"), user): try:
return False if re.search(user.encode('hex'), filestr.read().encode('hex')):
with open(outfile,"a") as outf2: return False
outf2.write(data + '\n') elif re.search(re.escape("$"), user):
return False
finally:
filestr.close()
outf2 = open(outfile,"a")
outf2.write(data + '\n')
outf2.close()
#Function used to verify if a previous auth attempt was made. #Function used to verify if a previous auth attempt was made.
def ReadData(Outfile, Client, User, Domain, Target, cmd): def ReadData(Outfile, Client, User, Domain, Target, cmd):
try: try:
with open(Logs_Path+"logs/"+Outfile,"r") as filestr: filestr = open(Logs_Path+"logs/"+Outfile,"r")
try:
Login = Client+":"+User+":"+Domain+":"+Target+":Logon Failure" Login = Client+":"+User+":"+Domain+":"+Target+":Logon Failure"
if re.search(Login.encode('hex'), filestr.read().encode('hex')): if re.search(Login.encode('hex'), filestr.read().encode('hex')):
print "[+] User %s\\%s previous login attempt returned logon_failure. Not forwarding anymore to prevent account lockout\n"%(Domain,User) print "[+] User %s\\%s previous login attempt returned logon_failure. Not forwarding anymore to prevent account lockout\n"%(Domain,User)
@ -78,6 +86,8 @@ def ReadData(Outfile, Client, User, Domain, Target, cmd):
else: else:
return False return False
finally:
filestr.close()
except: except:
raise raise
@ -267,8 +277,9 @@ def GetReadableSize(size,precision=2):
return "%.*f%s"%(precision,size,suffixes[suffixIndex]) return "%.*f%s"%(precision,size,suffixes[suffixIndex])
def WriteOutputToFile(data, File): def WriteOutputToFile(data, File):
with open(SaveSam_Path+"/"+File, "wb") as file: file = open(SaveSam_Path+"/"+File, "wb")
file.write(data) file.write(data)
file.close()
##This function is one of the main SMB read function. We request all the time 65520 bytes to the server. ##This function is one of the main SMB read function. We request all the time 65520 bytes to the server.
#Add (+32 (SMBHeader) +4 Netbios Session Header + 27 for the ReadAndx structure) +63 and you end up with 65583. #Add (+32 (SMBHeader) +4 Netbios Session Header + 27 for the ReadAndx structure) +63 and you end up with 65583.

View file

@ -20,7 +20,7 @@ from odict import OrderedDict
import datetime import datetime
from base64 import b64decode, b64encode from base64 import b64decode, b64encode
class Packet(): class Packet:
fields = OrderedDict([ fields = OrderedDict([
("data", ""), ("data", ""),
]) ])

View file

@ -176,11 +176,20 @@ def get_user_hashes(user_key, hbootkey):
hash_offset = unpack("<L", V[0x9c:0x9c+4])[0] + 0xCC hash_offset = unpack("<L", V[0x9c:0x9c+4])[0] + 0xCC
lm_exists = True if unpack("<L", V[0x9c+4:0x9c+8])[0] == 20 else False lm_exists = unpack("<L", V[0x9c+4:0x9c+8])[0] == 20
nt_exists = True if unpack("<L", V[0x9c+16:0x9c+20])[0] == 20 else False nt_exists = unpack("<L", V[0x9c+16:0x9c+20])[0] == 20
enc_lm_hash = V[hash_offset+4:hash_offset+20] if lm_exists else "" if lm_exists:
enc_nt_hash = V[hash_offset+(24 if lm_exists else 8):hash_offset+(24 if lm_exists else 8)+16] if nt_exists else "" enc_lm_hash = V[hash_offset+4:hash_offset+20]
lm_hash_offset = 24
else:
enc_lm_hash = ""
lm_hash_offset = 8
if nt_exists:
enc_nt_hash = V[hash_offset+lm_hash_offset:hash_offset+lm_hash_offset+16]
else:
enc_nt_hash = ""
return decrypt_hashes(rid, enc_lm_hash, enc_nt_hash, hbootkey) return decrypt_hashes(rid, enc_lm_hash, enc_nt_hash, hbootkey)

View file

@ -38,7 +38,7 @@ Timeout = 2
Host = options.TARGET Host = options.TARGET
Grep = options.Grep Grep = options.Grep
class Packet(): class Packet:
fields = OrderedDict([ fields = OrderedDict([
]) ])
def __init__(self, **kw): def __init__(self, **kw):

View file

@ -20,7 +20,7 @@ from odict import OrderedDict
__version__ = "0.3" __version__ = "0.3"
Timeout = 0.5 Timeout = 0.5
class Packet(): class Packet:
fields = OrderedDict([ fields = OrderedDict([
]) ])
def __init__(self, **kw): def __init__(self, **kw):
@ -220,8 +220,9 @@ def ShowResults(Host):
Signing, OsVer, LanManClient = SmbFinger(Host) Signing, OsVer, LanManClient = SmbFinger(Host)
enabled = color("SMB signing is mandatory. Choose another target", 1, 1) enabled = color("SMB signing is mandatory. Choose another target", 1, 1)
disabled = color("SMB signing: False", 2, 1) disabled = color("SMB signing: False", 2, 1)
disabled_enabled = (disabled, enabled)
print color("Retrieving information for %s..."%Host[0], 8, 1) print color("Retrieving information for %s..."%Host[0], 8, 1)
print enabled if Signing else disabled print disabled_enabled[Signing]
print color("Os version: '%s'"%(OsVer), 8, 3) print color("Os version: '%s'"%(OsVer), 8, 3)
print color("Hostname: '%s'\nPart of the '%s' domain"%(Hostname, DomainJoined), 8, 3) print color("Hostname: '%s'\nPart of the '%s' domain"%(Hostname, DomainJoined), 8, 3)
except: except:

View file

@ -23,6 +23,11 @@ import time
import settings import settings
import datetime import datetime
try:
import ssl
except ImportError:
ssl = False
def RandomChallenge(): def RandomChallenge():
if settings.Config.NumChal == "random": if settings.Config.NumChal == "random":
from random import getrandbits from random import getrandbits
@ -130,21 +135,27 @@ def FindLocalIP(Iface, OURIP):
def WriteData(outfile, data, user): def WriteData(outfile, data, user):
logging.info("[*] Captured Hash: %s" % data) logging.info("[*] Captured Hash: %s" % data)
if not os.path.isfile(outfile): if not os.path.isfile(outfile):
with open(outfile,"w") as outf: outf = open(outfile,"w")
outf.write(data + '\n') outf.write(data + '\n')
outf.close()
return return
with open(outfile,"r") as filestr: filestr = open(outfile,"r")
try:
if re.search(user.encode('hex'), filestr.read().encode('hex')): if re.search(user.encode('hex'), filestr.read().encode('hex')):
return False return False
elif re.search(re.escape("$"), user): elif re.search(re.escape("$"), user):
return False return False
with open(outfile,"a") as outf2: finally:
outf2.write(data + '\n') filestr.close()
outf2 = open(outfile,"a")
outf2.write(data + '\n')
outf2.close()
# Function used to write debug config and network info. # Function used to write debug config and network info.
def DumpConfig(outfile, data): def DumpConfig(outfile, data):
with open(outfile,"a") as dump: dump = open(outfile,"a")
dump.write(data + '\n') dump.write(data + '\n')
dump.close()
def SaveToDb(result): def SaveToDb(result):
# Creating the DB if it doesn't exist # Creating the DB if it doesn't exist
@ -174,21 +185,23 @@ def SaveToDb(result):
(count,) = res.fetchone() (count,) = res.fetchone()
if not count: if not count:
with open(logfile,"a") as outf: outf = open(logfile,"a")
if len(result['cleartext']): # If we obtained cleartext credentials, write them to file if len(result['cleartext']): # If we obtained cleartext credentials, write them to file
outf.write('%s:%s\n' % (result['user'].encode('utf8', 'replace'), result['cleartext'].encode('utf8', 'replace'))) outf.write('%s:%s\n' % (result['user'].encode('utf8', 'replace'), result['cleartext'].encode('utf8', 'replace')))
else: # Otherwise, write JtR-style hash string to file else: # Otherwise, write JtR-style hash string to file
outf.write(result['fullhash'].encode('utf8', 'replace') + '\n') outf.write(result['fullhash'].encode('utf8', 'replace') + '\n')
outf.close()
cursor.execute("INSERT INTO responder VALUES(datetime('now'), ?, ?, ?, ?, ?, ?, ?, ?)", (result['module'], result['type'], result['client'], result['hostname'], result['user'], result['cleartext'], result['hash'], result['fullhash'])) cursor.execute("INSERT INTO responder VALUES(datetime('now'), ?, ?, ?, ?, ?, ?, ?, ?)", (result['module'], result['type'], result['client'], result['hostname'], result['user'], result['cleartext'], result['hash'], result['fullhash']))
cursor.commit() cursor.commit()
if settings.Config.CaptureMultipleHashFromSameHost: if settings.Config.CaptureMultipleHashFromSameHost:
with open(logfile,"a") as outf: outf = open(logfile,"a")
if len(result['cleartext']): # If we obtained cleartext credentials, write them to file if len(result['cleartext']): # If we obtained cleartext credentials, write them to file
outf.write('%s:%s\n' % (result['user'].encode('utf8', 'replace'), result['cleartext'].encode('utf8', 'replace'))) outf.write('%s:%s\n' % (result['user'].encode('utf8', 'replace'), result['cleartext'].encode('utf8', 'replace')))
else: # Otherwise, write JtR-style hash string to file else: # Otherwise, write JtR-style hash string to file
outf.write(result['fullhash'].encode('utf8', 'replace') + '\n') outf.write(result['fullhash'].encode('utf8', 'replace') + '\n')
outf.close()
if not count or settings.Config.Verbose: # Print output if not count or settings.Config.Verbose: # Print output
if len(result['client']): if len(result['client']):
@ -280,6 +293,9 @@ def banner():
def StartupMessage(): def StartupMessage():
enabled = color('[ON]', 2, 1) enabled = color('[ON]', 2, 1)
disabled = color('[OFF]', 1, 1) disabled = color('[OFF]', 1, 1)
unavailable = color('[UNAVAILABLE]', 3, 1)
disabled_enabled = (disabled, enabled)
print "" print ""
print color("[+] ", 2, 1) + "Poisoners:" print color("[+] ", 2, 1) + "Poisoners:"
@ -289,35 +305,38 @@ def StartupMessage():
print "" print ""
print color("[+] ", 2, 1) + "Servers:" print color("[+] ", 2, 1) + "Servers:"
print ' %-27s' % "HTTP server" + (enabled if settings.Config.HTTP_On_Off else disabled) print ' %-27s' % "HTTP server" + disabled_enabled[settings.Config.HTTP_On_Off]
print ' %-27s' % "HTTPS server" + (enabled if settings.Config.SSL_On_Off else disabled) if not ssl and settings.Config.SSL_On_Off:
print ' %-27s' % "WPAD proxy" + (enabled if settings.Config.WPAD_On_Off else disabled) print ' %-27s' % "HTTPS server" + unavailable
print ' %-27s' % "Auth proxy" + (enabled if settings.Config.ProxyAuth_On_Off else disabled) else:
print ' %-27s' % "SMB server" + (enabled if settings.Config.SMB_On_Off else disabled) print ' %-27s' % "HTTPS server" + disabled_enabled[settings.Config.SSL_On_Off]
print ' %-27s' % "Kerberos server" + (enabled if settings.Config.Krb_On_Off else disabled) print ' %-27s' % "WPAD proxy" + disabled_enabled[settings.Config.WPAD_On_Off]
print ' %-27s' % "SQL server" + (enabled if settings.Config.SQL_On_Off else disabled) print ' %-27s' % "Auth proxy" + disabled_enabled[settings.Config.ProxyAuth_On_Off]
print ' %-27s' % "FTP server" + (enabled if settings.Config.FTP_On_Off else disabled) print ' %-27s' % "SMB server" + disabled_enabled[settings.Config.SMB_On_Off]
print ' %-27s' % "IMAP server" + (enabled if settings.Config.IMAP_On_Off else disabled) print ' %-27s' % "Kerberos server" + disabled_enabled[settings.Config.Krb_On_Off]
print ' %-27s' % "POP3 server" + (enabled if settings.Config.POP_On_Off else disabled) print ' %-27s' % "SQL server" + disabled_enabled[settings.Config.SQL_On_Off]
print ' %-27s' % "SMTP server" + (enabled if settings.Config.SMTP_On_Off else disabled) print ' %-27s' % "FTP server" + disabled_enabled[settings.Config.FTP_On_Off]
print ' %-27s' % "DNS server" + (enabled if settings.Config.DNS_On_Off else disabled) print ' %-27s' % "IMAP server" + disabled_enabled[settings.Config.IMAP_On_Off]
print ' %-27s' % "LDAP server" + (enabled if settings.Config.LDAP_On_Off else disabled) print ' %-27s' % "POP3 server" + disabled_enabled[settings.Config.POP_On_Off]
print ' %-27s' % "SMTP server" + disabled_enabled[settings.Config.SMTP_On_Off]
print ' %-27s' % "DNS server" + disabled_enabled[settings.Config.DNS_On_Off]
print ' %-27s' % "LDAP server" + disabled_enabled[settings.Config.LDAP_On_Off]
print "" print ""
print color("[+] ", 2, 1) + "HTTP Options:" print color("[+] ", 2, 1) + "HTTP Options:"
print ' %-27s' % "Always serving EXE" + (enabled if settings.Config.Serve_Always else disabled) print ' %-27s' % "Always serving EXE" + disabled_enabled[settings.Config.Serve_Always]
print ' %-27s' % "Serving EXE" + (enabled if settings.Config.Serve_Exe else disabled) print ' %-27s' % "Serving EXE" + disabled_enabled[settings.Config.Serve_Exe]
print ' %-27s' % "Serving HTML" + (enabled if settings.Config.Serve_Html else disabled) print ' %-27s' % "Serving HTML" + disabled_enabled[settings.Config.Serve_Html]
print ' %-27s' % "Upstream Proxy" + (enabled if settings.Config.Upstream_Proxy else disabled) print ' %-27s' % "Upstream Proxy" + disabled_enabled[settings.Config.Upstream_Proxy]
#print ' %-27s' % "WPAD script" + settings.Config.WPAD_Script #print ' %-27s' % "WPAD script" + settings.Config.WPAD_Script
print "" print ""
print color("[+] ", 2, 1) + "Poisoning Options:" print color("[+] ", 2, 1) + "Poisoning Options:"
print ' %-27s' % "Analyze Mode" + (enabled if settings.Config.AnalyzeMode else disabled) print ' %-27s' % "Analyze Mode" + disabled_enabled[settings.Config.AnalyzeMode]
print ' %-27s' % "Force WPAD auth" + (enabled if settings.Config.Force_WPAD_Auth else disabled) print ' %-27s' % "Force WPAD auth" + disabled_enabled[settings.Config.Force_WPAD_Auth]
print ' %-27s' % "Force Basic Auth" + (enabled if settings.Config.Basic else disabled) print ' %-27s' % "Force Basic Auth" + disabled_enabled[settings.Config.Basic]
print ' %-27s' % "Force LM downgrade" + (enabled if settings.Config.LM_On_Off == True else disabled) print ' %-27s' % "Force LM downgrade" + disabled_enabled[settings.Config.LM_On_Off == True]
print ' %-27s' % "Fingerprint hosts" + (enabled if settings.Config.Finger_On_Off == True else disabled) print ' %-27s' % "Fingerprint hosts" + disabled_enabled[settings.Config.Finger_On_Off == True]
print "" print ""
print color("[+] ", 2, 1) + "Generic Options:" print color("[+] ", 2, 1) + "Generic Options:"