Repository Analysis

fortra/impacket

Impacket is a collection of Python classes for working with network protocols.

11.8 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of fortra/impacket, a Python project with 16,048 GitHub stars. SynthScan v2.0 examined 196,164 lines of code across 356 source files, recording 2124 pattern matches distributed across 18 syntactic categories. The overall adjusted score of 11.8 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

11.8
Adjusted Score
11.8
Raw Score
100%
Time Factor
2026-08-28
Last Push
16.0K
Stars
Python
Language
196.2K
Lines of Code
356
Files
2.1K
Pattern Hits
2026-08-29
Scan Date
0.06
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 3HIGH 19MEDIUM 115LOW 1987

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 2124 distinct pattern matches across 18 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Excessive Try-Catch Wrapping587 hits · 611 pts
SeverityFileLineSnippetContext
LOWsetup.py41except Exception:CODE
LOWimpacket/IP6_Address.py249 except Exception:CODE
MEDIUMimpacket/IP6_Address.py244def is_a_valid_text_representation(cls, text_representation):CODE
LOWimpacket/ntlm.py54except Exception:CODE
MEDIUMimpacket/tds.py1141def _open_pipe(self):CODE
MEDIUMimpacket/tds.py1439def disconnect(self):CODE
LOWimpacket/tds.py1191 except Exception as e:CODE
LOWimpacket/tds.py1196 except Exception as e:CODE
LOWimpacket/tds.py1201 except Exception as e:CODE
LOWimpacket/tds.py1112 except Exception as e:CODE
LOWimpacket/tds.py1407 except Exception:CODE
LOWimpacket/tds.py1431 except Exception:CODE
LOWimpacket/tds.py1716 except Exception as e:CODE
LOWimpacket/tds.py1723 except Exception:CODE
LOWimpacket/tds.py1880 except Exception as e:CODE
LOWimpacket/smb.py3095 except Exception:CODE
MEDIUMimpacket/smbserver.py3035def _kerberos_auth(token, connData, smbServer):CODE
LOWimpacket/smbserver.py1577 except Exception as e:CODE
LOWimpacket/smbserver.py1588 except Exception as e:CODE
LOWimpacket/smbserver.py3717 except Exception as e:CODE
LOWimpacket/smbserver.py3731 except Exception as e:CODE
LOWimpacket/smbserver.py240 except Exception as e:CODE
LOWimpacket/smbserver.py383 except Exception as e:CODE
LOWimpacket/smbserver.py704 except Exception as e:CODE
LOWimpacket/smbserver.py980 except Exception as e:CODE
LOWimpacket/smbserver.py1174 except Exception as e:CODE
LOWimpacket/smbserver.py1312 except Exception as e:CODE
LOWimpacket/smbserver.py1449 except Exception as e:CODE
LOWimpacket/smbserver.py1636 except Exception as e:CODE
LOWimpacket/smbserver.py1671 except Exception as e:CODE
LOWimpacket/smbserver.py1719 except Exception as e:CODE
LOWimpacket/smbserver.py1917 except Exception as e:CODE
LOWimpacket/smbserver.py1963 except Exception as e:CODE
LOWimpacket/smbserver.py2016 except Exception as e:CODE
LOWimpacket/smbserver.py2203 except Exception as e:CODE
LOWimpacket/smbserver.py2303 except Exception as e:CODE
LOWimpacket/smbserver.py2333 except Exception as e:CODE
LOWimpacket/smbserver.py2743 except Exception as e:CODE
LOWimpacket/smbserver.py2866 except Exception as e:CODE
LOWimpacket/smbserver.py3313 except Exception as e:CODE
LOWimpacket/smbserver.py3593 except Exception as e:CODE
LOWimpacket/smbserver.py3623 except Exception as e:CODE
LOWimpacket/smbserver.py3890 except Exception as e:CODE
LOWimpacket/smbserver.py3961 except Exception as e:CODE
LOWimpacket/smbserver.py4012 except Exception as e:CODE
LOWimpacket/smbserver.py4040 except Exception as e:CODE
LOWimpacket/smbserver.py4314 except Exception as e:CODE
LOWimpacket/smbserver.py4387 except Exception as e:CODE
LOWimpacket/smbserver.py5010 except Exception as e:CODE
LOWimpacket/smbserver.py5073 except Exception as e:CODE
LOWimpacket/mqtt.py279 except Exception:CODE
LOWimpacket/mqtt.py356 except Exception as e:CODE
LOWimpacket/ese.py952 except Exception:CODE
LOWimpacket/acl.py382 except Exception as e:CODE
LOWimpacket/crypto.py30except Exception:CODE
LOWimpacket/structure.py144 except Exception as e:CODE
LOWimpacket/structure.py170 except Exception as e:CODE
LOWimpacket/structure.py491 except Exception:CODE
LOWimpacket/winregistry.py242 except Exception as e:CODE
LOWimpacket/winregistry.py824 except Exception:CODE
527 more matches not shown…
Over-Commented Block445 hits · 432 pts
SeverityFileLineSnippetContext
LOWsetup.py1#!/usr/bin/env pythonCOMMENT
LOWimpacket/ICMP6.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/eap.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/hresult_errors.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/dns.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/dns.py21# - 2181 - Clarifications to the DNS Specification [https://www.ietf.org/rfc/rfc2181.txt]COMMENT
LOWimpacket/dns.py421 # Preference Unsigned 16-bit integer.COMMENT
LOWimpacket/smb3.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/smb3.py21#COMMENT
LOWimpacket/smb3.py781 sessionKey = TGT['sessionKey']COMMENT
LOWimpacket/smb3.py941 # otherwise, the case-sensitive ASCII string "SMB2APP" as the label. Session.PreauthIntegrityHashValueCOMMENT
LOWimpacket/smb3.py1141 if user == '' or self.isGuestSession():COMMENT
LOWimpacket/smb3.py1641 # do the following:COMMENT
LOWimpacket/IP6_Address.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/ntlm.py61NTLM_AUTH_PKT = 4COMMENT
LOWimpacket/ntlm.py101# If set, requests the usage of the LMOWF (section 3.3). An alternate name for this field isCOMMENT
LOWimpacket/ntlm.py121# TargetName field of the CHALLENGE_MESSAGE. If this bit is set, then NTLMSSP_TARGET_TYPE_DOMAIN MUST NOT be set.COMMENT
LOWimpacket/ntlm.py161NTLMSSP_RESERVED_8 = 0x00000100COMMENT
LOWimpacket/ntlm.py701 # Full keyCOMMENT
LOWimpacket/NDP.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/tds.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/tds.py21# Aurélien Chalot (@Defte_) added support for MSSQL via named pipeCOMMENT
LOWimpacket/tds.py1621 # Something like TDS_PACKET["Data"] = TLS_ENCRYPTED(data)COMMENT
LOWimpacket/smb.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/smb.py21#COMMENT
LOWimpacket/smb.py41# [ ] Try [SMB]transport fragmentation using Transact requestsCOMMENT
LOWimpacket/smb.py2901 # least significant 32 bits of the SecuritySignature field and the remainingCOMMENT
LOWimpacket/smbserver.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/smbserver.py3901 # elif setInfo['InfoType'] == smb2.SMB2_0_INFO_FILESYSTEM:COMMENT
LOWimpacket/smbserver.py4521COMMENT
LOWimpacket/smbserver.py4641 # WHERE:COMMENT
LOWimpacket/smbserver.py4701 def unregisterSmbCommand(self, smbCommand):COMMENT
LOWimpacket/smbserver.py4721 # SMBCommand: the SMBCommand itself, with its data and parameters.COMMENT
LOWimpacket/smbserver.py4801COMMENT
LOWimpacket/smbserver.py4821 # CALL MD5Init( md5context )COMMENT
LOWimpacket/smbserver.py4961 # connId : representing the data for this specific connectionCOMMENT
LOWimpacket/smbserver.py5081 connData = self.getConnectionData(connId, False)COMMENT
LOWimpacket/system_errors.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/ImpactDecoder.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/__init__.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/cdp.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/Dot11Crypto.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/mqtt.py1#!/usr/bin/env pythonCOMMENT
LOWimpacket/ese.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/ese.py801 return self.getNextRow(cursor, filter_tables = filter_tables)COMMENT
LOWimpacket/Dot11KeyManager.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/negoex.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/dot11.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/dot11.py41 # +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+COMMENT
LOWimpacket/dot11.py1921 def get_dB_ant_noise( self ):COMMENT
LOWimpacket/spnego.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/spnego.py161 # reject (2),COMMENT
LOWimpacket/acl.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/crypto.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/crypto.py41# + Algorithm Generate_Subkey +COMMENT
LOWimpacket/crypto.py101COMMENT
LOWimpacket/crypto.py121# + +COMMENT
LOWimpacket/crypto.py181def AES_CMAC_PRF_128(VK, M, VKlen, Mlen):COMMENT
LOWimpacket/http.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
LOWimpacket/wps.py1# Impacket - Collection of Python classes for working with network protocols.COMMENT
385 more matches not shown…
Unused Imports341 hits · 333 pts
SeverityFileLineSnippetContext
LOWsetup.py20CODE
LOWimpacket/smb3.py33CODE
LOWimpacket/smb3.py34CODE
LOWimpacket/smb3.py48CODE
LOWimpacket/dpapi_ng.py12CODE
LOWimpacket/ntlm.py12CODE
LOWimpacket/ntlm.py13CODE
LOWimpacket/tds.py32CODE
LOWimpacket/tds.py33CODE
LOWimpacket/smb.py52CODE
LOWimpacket/smb.py53CODE
LOWimpacket/mqtt.py27CODE
LOWimpacket/ese.py29CODE
LOWimpacket/ese.py30CODE
LOWimpacket/spnego.py18CODE
LOWimpacket/spnego.py19CODE
LOWimpacket/crypto.py25CODE
LOWimpacket/crypto.py26CODE
LOWimpacket/http.py30CODE
LOWimpacket/structure.py12CODE
LOWimpacket/structure.py13CODE
LOWimpacket/ImpactPacket.py21CODE
LOWimpacket/ImpactPacket.py22CODE
LOWimpacket/winregistry.py25CODE
LOWimpacket/winregistry.py26CODE
LOWimpacket/nmb.py37CODE
LOWimpacket/nmb.py38CODE
LOWimpacket/nmb.py39CODE
LOWimpacket/smbconnection.py31CODE
LOWimpacket/smb3structs.py18CODE
LOWimpacket/smb3structs.py19CODE
LOWimpacket/dpapi.py27CODE
LOWimpacket/dpapi.py28CODE
LOWimpacket/uuid.py19CODE
LOWimpacket/uuid.py20CODE
LOWimpacket/dcerpc/v5/srvs.py26CODE
LOWimpacket/dcerpc/v5/srvs.py27CODE
LOWimpacket/dcerpc/v5/drsuapi.py27CODE
LOWimpacket/dcerpc/v5/drsuapi.py28CODE
LOWimpacket/dcerpc/v5/dcomrt.py33CODE
LOWimpacket/dcerpc/v5/dcomrt.py34CODE
LOWimpacket/dcerpc/v5/bkrp.py30CODE
LOWimpacket/dcerpc/v5/bkrp.py31CODE
LOWimpacket/dcerpc/v5/even.py27CODE
LOWimpacket/dcerpc/v5/even.py28CODE
LOWimpacket/dcerpc/v5/transport.py17CODE
LOWimpacket/dcerpc/v5/transport.py18CODE
LOWimpacket/dcerpc/v5/transport.py32CODE
LOWimpacket/dcerpc/v5/dhcpm.py27CODE
LOWimpacket/dcerpc/v5/dhcpm.py28CODE
LOWimpacket/dcerpc/v5/tsts.py29CODE
LOWimpacket/dcerpc/v5/tsts.py34CODE
LOWimpacket/dcerpc/v5/tsts.py36CODE
LOWimpacket/dcerpc/v5/lsad.py26CODE
LOWimpacket/dcerpc/v5/lsad.py27CODE
LOWimpacket/dcerpc/v5/dtypes.py18CODE
LOWimpacket/dcerpc/v5/dtypes.py19CODE
LOWimpacket/dcerpc/v5/rpch.py19CODE
LOWimpacket/dcerpc/v5/rpch.py20CODE
LOWimpacket/dcerpc/v5/ndr.py21CODE
281 more matches not shown…
Deep Nesting337 hits · 294 pts
SeverityFileLineSnippetContext
LOWimpacket/dns.py372CODE
LOWimpacket/smb3.py427CODE
LOWimpacket/smb3.py989CODE
LOWimpacket/smb3.py1820CODE
LOWimpacket/IP6_Address.py129CODE
LOWimpacket/IP6_Address.py203CODE
LOWimpacket/ntlm.py896CODE
LOWimpacket/tds.py851CODE
LOWimpacket/tds.py1745CODE
LOWimpacket/tds.py2236CODE
LOWimpacket/tds.py2310CODE
LOWimpacket/tds.py2374CODE
LOWimpacket/tds.py2700CODE
LOWimpacket/tds.py2819CODE
LOWimpacket/smb.py326CODE
LOWimpacket/smb.py1042CODE
LOWimpacket/smb.py2952CODE
LOWimpacket/smb.py3622CODE
LOWimpacket/smb.py3992CODE
LOWimpacket/smb.py4093CODE
LOWimpacket/smb.py4250CODE
LOWimpacket/smbserver.py391CODE
LOWimpacket/smbserver.py445CODE
LOWimpacket/smbserver.py582CODE
LOWimpacket/smbserver.py726CODE
LOWimpacket/smbserver.py825CODE
LOWimpacket/smbserver.py878CODE
LOWimpacket/smbserver.py1007CODE
LOWimpacket/smbserver.py1055CODE
LOWimpacket/smbserver.py1122CODE
LOWimpacket/smbserver.py1266CODE
LOWimpacket/smbserver.py1404CODE
LOWimpacket/smbserver.py1557CODE
LOWimpacket/smbserver.py1608CODE
LOWimpacket/smbserver.py1690CODE
LOWimpacket/smbserver.py1736CODE
LOWimpacket/smbserver.py1783CODE
LOWimpacket/smbserver.py1831CODE
LOWimpacket/smbserver.py1878CODE
LOWimpacket/smbserver.py1936CODE
LOWimpacket/smbserver.py1982CODE
LOWimpacket/smbserver.py2172CODE
LOWimpacket/smbserver.py2220CODE
LOWimpacket/smbserver.py2401CODE
LOWimpacket/smbserver.py2538CODE
LOWimpacket/smbserver.py3123CODE
LOWimpacket/smbserver.py3338CODE
LOWimpacket/smbserver.py3521CODE
LOWimpacket/smbserver.py3685CODE
LOWimpacket/smbserver.py3755CODE
LOWimpacket/smbserver.py3816CODE
LOWimpacket/smbserver.py3924CODE
LOWimpacket/smbserver.py3973CODE
LOWimpacket/smbserver.py4352CODE
LOWimpacket/smbserver.py4929CODE
LOWimpacket/ImpactDecoder.py73CODE
LOWimpacket/ImpactDecoder.py130CODE
LOWimpacket/ImpactDecoder.py163CODE
LOWimpacket/ImpactDecoder.py435CODE
LOWimpacket/ImpactDecoder.py525CODE
277 more matches not shown…
Hyper-Verbose Identifiers238 hits · 255 pts
SeverityFileLineSnippetContext
LOWimpacket/ICMP6.py151 def __get_message_description(self):CODE
LOWimpacket/ICMP6.py339 def get_neighbor_advertisement_flags(self):CODE
LOWimpacket/ICMP6.py342 def set_neighbor_advertisement_flags(self, flags):CODE
LOWimpacket/ICMP6.py388 def __build_node_information_message(class_object, type, code, payload = None):CODE
LOWimpacket/ICMP6.py505 def set_node_information_data(self, data):CODE
LOWimpacket/ICMP6.py510 def get_note_information_data(self):CODE
LOWimpacket/ICMP6.py529 def get_originating_packet_data(self):CODE
LOWimpacket/dns.py372 def __process_answer_structure(self, offset, num):CODE
LOWimpacket/smb3.py2126 def perform_hostname_validation(self):CODE
LOWimpacket/IP6_Address.py129 def get_human_readable_address_type(self):CODE
LOWimpacket/IP6_Address.py148 def __is_address_in_compressed_form(self, address):CODE
LOWimpacket/IP6_Address.py163 def __count_compressed_groups(self, address):CODE
LOWimpacket/IP6_Address.py168 def __count_compression_marker(self, address):CODE
LOWimpacket/IP6_Address.py185 def __expand_compressed_address(self, address):CODE
LOWimpacket/IP6_Address.py203 def __trim_longest_zero_chain(self, address):CODE
LOWimpacket/IP6_Address.py244 def is_a_valid_text_representation(cls, text_representation):CODE
LOWimpacket/dpapi_ng.py281def generate_kek_secret_from_pubkey(gke: GroupKeyEnvelope, key_id: KeyIdentifier,l2_key: bytes):CODE
LOWimpacket/tds.py1337 def _has_active_tls_channel_binding(self):CODE
LOWimpacket/tds.py1369 def _create_named_pipe_transport(CODE
LOWimpacket/tds.py1592 def generate_cbt_from_tls_unique(self):CODE
LOWimpacket/smb.py3401 def get_server_dns_domain_name(self):CODE
LOWimpacket/smb.py3438 def perform_hostname_validation(self):CODE
LOWimpacket/smbserver.py109def _parse_negotiate_contexts(data: bytes) -> dict:CODE
LOWimpacket/Dot11KeyManager.py22 def __get_bssid_hasheable_type(self, bssid):CODE
LOWimpacket/dot11.py2219 def __calculate_elements_length(self, elements):CODE
LOWimpacket/dot11.py2658 def get_authentication_algorithm(self):CODE
LOWimpacket/dot11.py2662 def set_authentication_algorithm(self, algorithm):CODE
LOWimpacket/dot11.py2666 def get_authentication_sequence(self):CODE
LOWimpacket/dot11.py2670 def set_authentication_sequence(self, seq):CODE
LOWimpacket/dot11.py2674 def get_authentication_status(self):CODE
LOWimpacket/dot11.py2678 def set_authentication_status(self, status):CODE
LOWimpacket/acl.py166 def get_readable_standard_rights(self):CODE
LOWimpacket/acl.py184 def get_readable_specific_rights(self):CODE
LOWimpacket/IP6_Extension_Headers.py125 def get_header_extension_length(self):CODE
LOWimpacket/IP6_Extension_Headers.py131 def set_header_extension_length(self, header_extension_length):CODE
LOWimpacket/nmb.py609 def name_registration_request(self, nbname, destaddr, qtype, scope, nb_flags=0, nb_address='0.0.0.0'):CODE
LOWimpacket/dcerpc/v5/rpcrt.py1373 def set_default_max_fragment_size(self):CODE
LOWimpacket/dcerpc/v5/transport.py255 def set_default_max_fragment_size(self):CODE
LOWimpacket/dcerpc/v5/rpch.py783 def handle_out_of_sequence_rts(self, response_data):CODE
LOWimpacket/krb5/pac.py340def _normalize_pac_checksum_type(signature_type, signature_length, aes_key, infer_aes_signature_type):CODE
LOWimpacket/krb5/crypto.py731def get_kerberos_key_for_enctype(enctype, nt_hash=None, generic_aes_key=None, aes128_key=None, aes256_key=None):CODE
LOWimpacket/krb5/asn1.py74def _sequence_optional_component(name, tag_value, type, **subkwargs):CODE
LOWimpacket/examples/secretsdump.py1660 def __decrypt_history_entries_aes(self, rid_int, entries):CODE
LOWimpacket/examples/secretsdump.py1698 def __decode_aes_history_block(self, rid_int, data, offset, length):CODE
LOWimpacket/examples/secretsdump.py2620def _derive_trust_kerberos_keys(rawSecret, domain, partner, isIncoming):CODE
LOWimpacket/examples/smbclient.py890 def _resolve_path_with_dfs_boundary(self, line):CODE
LOWimpacket/examples/smbclient.py981 def _restore_original_connection(self):CODE
LOWimpacket/examples/ldap_shell.py387 def toggle_account_enable_disable(self, user_name, enable):CODE
LOWimpacket/examples/__init__.py13def _insecure_create_default_context(purpose=ssl.Purpose.SERVER_AUTH, *, cafile=None, capath=None, cadata=None):CODE
LOWimpacket/examples/__init__.py21def monkeypatch_ssl_create_default_context():CODE
LOWimpacket/examples/__init__.py35def monkeypatch_readline_backend():CODE
LOWimpacket/examples/regsecrets.py423 def __decrypt_history_entries_aes(self, rid_int, entries):CODE
LOWimpacket/examples/regsecrets.py461 def __decode_aes_history_block(self, rid_int, data, offset, length):CODE
LOWimpacket/examples/ntlmrelayx/clients/ldaprelayclient.py178 def create_authenticate_message(self):CODE
LOWimpacket/examples/ntlmrelayx/utils/rdp_ssl.py52def generate_self_signed_cert(common_name="RDP-Server"):CODE
LOWimpacket/examples/ntlmrelayx/servers/rdprelayserver.py372 def build_tsrequest_challenge(self, challenge_data):CODE
LOWimpacket/examples/ntlmrelayx/servers/socksserver.py284class SocksRequestHandler(socketserver.BaseRequestHandler):CODE
LOW…cket/examples/ntlmrelayx/servers/socksplugins/mssql.py98 def _should_wrap_sql_batch_for_backend(self):CODE
LOWimpacket/examples/ntlmrelayx/attacks/ldapattack.py71def _password_set_at_account_creation(attributes):CODE
LOWimpacket/examples/ntlmrelayx/attacks/ldapattack.py806 def is_template_for_authentification(entry):CODE
178 more matches not shown…
Self-Referential Comments35 hits · 104 pts
SeverityFileLineSnippetContext
MEDIUMimpacket/tds.py1455 # This function is the generic sendTDS packet which is used to embed data into a regular TDS packetCOMMENT
MEDIUMimpacket/tds.py1484 # This function is a wrapper that is used to dispatch packets to send depending of the TLS contextCOMMENT
MEDIUMimpacket/tds.py1521 # This function is the generic recvTDS packet which is used to extract data from a regular TDS packetCOMMENT
MEDIUMimpacket/tds.py1559 # This function is a wrapper that is used to dispatch packets to read depending of the TLS contextCOMMENT
MEDIUMimpacket/tds.py1609 # This function is used to set the TLS context, process the handshak in memoryCOMMENT
MEDIUMimpacket/smb.py128SMB_O_CREAT = 0x10 # Create the file if file does not exists. Otherwise, operation fails.CODE
MEDIUMimpacket/examples/serviceinstall.py97 # Create the serviceCOMMENT
MEDIUMimpacket/examples/ntlmrelayx/clients/dcsyncclient.py265 # Initialize NTDSHashes objectCOMMENT
MEDIUMimpacket/examples/ntlmrelayx/utils/ssl.py34 # Create a private keyCOMMENT
MEDIUMimpacket/examples/ntlmrelayx/utils/ssl.py38 # Create the certificateCOMMENT
MEDIUMimpacket/examples/ntlmrelayx/utils/ssl.py57 # Create a context, we don't really care about the SSL/TLSCOMMENT
MEDIUMimpacket/examples/ntlmrelayx/attacks/ldapattack.py1122 # Create a nice shiny new user for the escalationCOMMENT
MEDIUMimpacket/examples/ntlmrelayx/attacks/ldapattack.py1148 # Create a nice shiny new user for the escalationCOMMENT
MEDIUMimpacket/examples/ntlmrelayx/attacks/ldapattack.py1360# Create an object ACE with the specified privguid and our sidCOMMENT
MEDIUMimpacket/examples/ntlmrelayx/attacks/ldapattack.py1377# Create an ALLOW ACE with the specified sidCOMMENT
MEDIUMtests/SMB_RPC/test_acl.py114 # Create a new ACE for a different user with R,W permissionsCOMMENT
MEDIUMexamples/secretsdump.py147 # Create the baseDNCOMMENT
MEDIUMexamples/GetADComputers.py64 # Create the baseDNCOMMENT
MEDIUMexamples/dacledit.py374 # This function is called before any writing action (write, remove or restore)COMMENT
MEDIUMexamples/badsuccessor.py88 # Create the baseDN if not providedCOMMENT
MEDIUMexamples/GetLAPSPassword.py87 # Create the baseDNCOMMENT
MEDIUMexamples/raiseChild.py209 # Create the pipes threadsCOMMENT
MEDIUMexamples/GetNPUsers.py90 # Create the baseDNCOMMENT
MEDIUMexamples/findDelegation.py97 # Create the baseDNCOMMENT
MEDIUMexamples/rbcd.py55# Create an ALLOW ACE with the specified sidCOMMENT
MEDIUMexamples/goldenPac.py162 # Create the pipes threadsCOMMENT
MEDIUMexamples/addcomputer.py114 # Create the baseDNCOMMENT
MEDIUMexamples/GetADUsers.py60 # Create the baseDNCOMMENT
MEDIUMexamples/changepasswd.py945 # Create a password management sessionCOMMENT
MEDIUMexamples/ping6.py47# Create a new IP packet and set its source and destination addresses.COMMENT
MEDIUMexamples/GetUserSPNs.py23# This module provides a Python implementation for this attack, adding also the ability to PtH/Ticket/Key.COMMENT
MEDIUMexamples/GetUserSPNs.py103 # Create the baseDNCOMMENT
MEDIUMexamples/ping.py46# Create a new IP packet and set its source and destination addresses.COMMENT
MEDIUMexamples/ping.py52# Create a new ICMP packet of type ECHO.COMMENT
MEDIUMexamples/psexec.py183 # Create the pipes threadsCOMMENT
Redundant / Tautological Comments48 hits · 76 pts
SeverityFileLineSnippetContext
LOWimpacket/smb.py130SMB_O_OPEN = 0x01 # Open the file if the file existsCODE
LOWimpacket/smbserver.py1581 # Check if the file was marked for removalCOMMENT
LOWimpacket/smbserver.py3721 # Check if the file was marked for removalCOMMENT
LOWimpacket/smbserver.py2130 # Check if the Tid matches the Tid trying to disconnectCOMMENT
LOWimpacket/smbserver.py2154 # Check if the Uid matches the user trying to logoffCOMMENT
LOWimpacket/smbserver.py4161 # Check if the next data will exceed the OutputBufferLengthCOMMENT
LOWimpacket/smb3structs.py181FILE_OPEN_IF = 0x00000003 # Open the file if it already exists; otherwise, create the file. This value SHOULDCODE
LOWimpacket/dcerpc/v5/transport.py515 # Check if we have a smb connection already setupCOMMENT
LOWimpacket/dcerpc/v5/rpch.py678 # Check if the previous chunk is still thereCOMMENT
LOWimpacket/examples/secretsdump.py869 # Check if remoteName is FQDN, otherwise it will likely be the hostname onlyCOMMENT
LOWimpacket/examples/secretsdump.py2499 # Check if old LSA secrets values are also need to be shownCOMMENT
LOWimpacket/examples/regsecrets.py81 # Check if remoteName is FQDN, otherwise it will likely be the hostname only and we can't build the saltCOMMENT
LOWimpacket/examples/regsecrets.py1029 # Check if old LSA secrets values are also need to be shownCOMMENT
LOWimpacket/examples/regsecrets.py1065 # Check if old LSA secrets values are also need to be shownCOMMENT
LOWimpacket/examples/ntlmrelayx/clients/httprelayclient.py58 #Check if server wants authCOMMENT
LOWimpacket/examples/ntlmrelayx/utils/targetsutils.py70 # Check if we have a single target, with no URI formCOMMENT
LOWimpacket/examples/ntlmrelayx/servers/rdprelayserver.py339 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOWimpacket/examples/ntlmrelayx/servers/rpcrelayserver.py396 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOW…acket/examples/ntlmrelayx/servers/winrmsrelayserver.py531 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOW…packet/examples/ntlmrelayx/servers/winrmrelayserver.py517 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOWimpacket/examples/ntlmrelayx/servers/rawrelayserver.py187 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOWimpacket/examples/ntlmrelayx/servers/smbrelayserver.py935 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOWimpacket/examples/ntlmrelayx/servers/httprelayserver.py550 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOWimpacket/examples/ntlmrelayx/servers/wcfrelayserver.py327 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOW…packet/examples/ntlmrelayx/servers/mssqlrelayserver.py424 # Check if SOCKS is enabled and if we support the target schemeCOMMENT
LOW…cket/examples/ntlmrelayx/servers/socksplugins/mssql.py166 # Check if we have a connection for the userCOMMENT
LOW…packet/examples/ntlmrelayx/servers/socksplugins/smb.py360 # Check if we have a connection for the userCOMMENT
LOW…packet/examples/ntlmrelayx/servers/socksplugins/smb.py514 # Check if we have a connection for the userCOMMENT
LOW…acket/examples/ntlmrelayx/servers/socksplugins/http.py65 # Check if we have a connection for the userCOMMENT
LOW…acket/examples/ntlmrelayx/servers/socksplugins/http.py179 # Check if the body is larger than 1 packetCOMMENT
LOW…acket/examples/ntlmrelayx/servers/socksplugins/smtp.py102 # Check if we have a connection for the userCOMMENT
LOW…acket/examples/ntlmrelayx/servers/socksplugins/imap.py95 # Check if we have a connection for the userCOMMENT
LOWimpacket/examples/ntlmrelayx/attacks/imapattack.py47 #Check if search workedCOMMENT
LOWimpacket/examples/ntlmrelayx/attacks/ldapattack.py611 # Check if the ACE has restrictions on object type (inherited case)COMMENT
LOWimpacket/examples/ntlmrelayx/attacks/ldapattack.py615 # Verify if the ACE applies to this object typeCOMMENT
LOWimpacket/examples/ntlmrelayx/attacks/ldapattack.py621 # Check if this applies to our objecttypeCOMMENT
LOWimpacket/examples/ntlmrelayx/attacks/ldapattack.py653 # Check if the ACE is an OBJECT ACE, if so the WRITE_DACL is applied toCOMMENT
LOWimpacket/examples/ntlmrelayx/attacks/ldapattack.py1408# Check if an ACE allows for creation of usersCOMMENT
LOWimpacket/examples/ntlmrelayx/attacks/ldapattack.py1416# Check if an ACE allows for adding membersCOMMENT
LOWexamples/badsuccessor.py276 # Check if ACE has relevant rightsCOMMENT
LOWexamples/GetLAPSPassword.py111 # Check if item is in cacheCOMMENT
LOWexamples/raiseChild.py184 # Check if we need to copy a file for executionCOMMENT
LOWexamples/findDelegation.py40 # Check if SPN existsCOMMENT
LOWexamples/rpcdump.py112 # Display results.COMMENT
LOWexamples/samrdump.py91 # Display results.COMMENT
LOWexamples/split.py130 # Open fileCOMMENT
LOWexamples/goldenPac.py137 # Check if we need to copy a file for executionCOMMENT
LOWexamples/psexec.py158 # Check if we need to copy a file for executionCOMMENT
Cross-File Repetition9 hits · 45 pts
SeverityFileLineSnippetContext
HIGH…acket/examples/ntlmrelayx/servers/winrmsrelayserver.py0<?xml version="1.0"?><d:multistatus xmlns:d="dav:"><d:response><d:href>http://webdavrelay/file/image.jpg/</d:href><d:proSTRING
HIGH…packet/examples/ntlmrelayx/servers/winrmrelayserver.py0<?xml version="1.0"?><d:multistatus xmlns:d="dav:"><d:response><d:href>http://webdavrelay/file/image.jpg/</d:href><d:proSTRING
HIGHimpacket/examples/ntlmrelayx/servers/httprelayserver.py0<?xml version="1.0"?><d:multistatus xmlns:d="dav:"><d:response><d:href>http://webdavrelay/file/image.jpg/</d:href><d:proSTRING
HIGH…acket/examples/ntlmrelayx/servers/winrmsrelayserver.py0<?xml version="1.0"?><d:multistatus xmlns:d="dav:"><d:response><d:href>http://webdavrelay/file/</d:href><d:propstat><d:pSTRING
HIGH…packet/examples/ntlmrelayx/servers/winrmrelayserver.py0<?xml version="1.0"?><d:multistatus xmlns:d="dav:"><d:response><d:href>http://webdavrelay/file/</d:href><d:propstat><d:pSTRING
HIGHimpacket/examples/ntlmrelayx/servers/httprelayserver.py0<?xml version="1.0"?><d:multistatus xmlns:d="dav:"><d:response><d:href>http://webdavrelay/file/</d:href><d:propstat><d:pSTRING
HIGHexamples/raiseChild.py0lcd {path} - changes the current local directory to {path} exit - terminates the server process (and this session) lput STRING
HIGHexamples/goldenPac.py0lcd {path} - changes the current local directory to {path} exit - terminates the server process (and this session) lput STRING
HIGHexamples/psexec.py0lcd {path} - changes the current local directory to {path} exit - terminates the server process (and this session) lput STRING
AI Structural Patterns42 hits · 38 pts
SeverityFileLineSnippetContext
LOWimpacket/smb3.py190CODE
LOWimpacket/smb3.py729CODE
LOWimpacket/tds.py1210CODE
LOWimpacket/tds.py1369CODE
LOWimpacket/tds.py1745CODE
LOWimpacket/tds.py2070CODE
LOWimpacket/acl.py239CODE
LOWimpacket/nmb.py625CODE
LOWimpacket/smbconnection.py63CODE
LOWimpacket/smbconnection.py296CODE
LOWimpacket/smbconnection.py422CODE
LOWimpacket/smbconnection.py489CODE
LOWimpacket/dcerpc/v5/dcomrt.py997CODE
LOWimpacket/dcerpc/v5/dcomrt.py1177CODE
LOWimpacket/dcerpc/v5/transport.py479CODE
LOWimpacket/dcerpc/v5/transport.py605CODE
LOWimpacket/dcerpc/v5/scmr.py1254CODE
LOWimpacket/dcerpc/v5/scmr.py1272CODE
LOWimpacket/ldap/ldap.py206CODE
LOWimpacket/ldap/ldap.py518CODE
LOWimpacket/krb5/kpasswd.py284CODE
LOWimpacket/krb5/kpasswd.py317CODE
LOWimpacket/krb5/gssapi.py352CODE
LOWimpacket/krb5/gssapi.py357CODE
LOWimpacket/examples/secretsdump.py2154CODE
LOWimpacket/examples/secretsdump.py2797CODE
LOWimpacket/examples/utils.py91CODE
LOWimpacket/examples/regsecrets.py693CODE
LOW…acket/examples/ntlmrelayx/servers/socksplugins/smtp.py159CODE
LOWtests/SMB_RPC/test_rpcrt.py32CODE
LOWexamples/rpcmap.py57CODE
LOWexamples/samrdump.py42CODE
LOWexamples/machine_role.py51CODE
LOWexamples/lookupsid.py44CODE
LOWexamples/goldenPac.py430CODE
LOWexamples/changepasswd.py140CODE
LOWexamples/changepasswd.py183CODE
LOWexamples/dcomexec.py68CODE
LOWexamples/smbexec.py119CODE
LOWexamples/atexec.py48CODE
LOWexamples/wmiexec.py52CODE
LOWexamples/psexec.py68CODE
Cross-Language Confusion8 hits · 36 pts
SeverityFileLineSnippetContext
HIGHimpacket/hresult_errors.py2908 0xC026250A: ("ERROR_GRAPHICS_OPM_INVALID_POINTER", "The function failed because an invalid pointer parameter wasCODE
HIGHimpacket/hresult_errors.py2908 0xC026250A: ("ERROR_GRAPHICS_OPM_INVALID_POINTER", "The function failed because an invalid pointer parameter wasCODE
HIGHimpacket/smbserver.py82 """SHA-512(current || data), one step of the SMB 3.1.1 pre-auth integrity hash chain.STRING
HIGHimpacket/nt_errors.py1598 0xC01E050A: ("STATUS_GRAPHICS_OPM_INVALID_POINTER","The function failed because an invalid pointer parameter wasCODE
HIGHimpacket/nt_errors.py1598 0xC01E050A: ("STATUS_GRAPHICS_OPM_INVALID_POINTER","The function failed because an invalid pointer parameter wasCODE
HIGHimpacket/nt_errors.py1639 0xC01E05E4: ("STATUS_GRAPHICS_INVALID_POINTER","The function failed because an invalid pointer parameter was pasCODE
HIGHimpacket/nt_errors.py1639 0xC01E05E4: ("STATUS_GRAPHICS_INVALID_POINTER","The function failed because an invalid pointer parameter was pasCODE
HIGHtests/SMB_RPC/test_wmi.py326 # PowerShell "gwmi win32_currenttime" command output shows it empty indicating it is $null, so it should be NoneSTRING
Decorative Section Separators12 hits · 36 pts
SeverityFileLineSnippetContext
MEDIUMimpacket/mapi_constants.py869# ====================COMMENT
MEDIUMimpacket/mapi_constants.py1565# ====================COMMENT
MEDIUMimpacket/examples/utils.py64# ----------COMMENT
MEDIUMimpacket/examples/utils.py249# ----------COMMENT
MEDIUMimpacket/examples/utils.py360# ----------COMMENT
MEDIUMimpacket/examples/utils.py385# ----------COMMENT
MEDIUMtests/misc/test_ntfs_read.py21# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/misc/test_ntfs_read.py23# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/misc/test_ntfs_read.py43# ===========================================================================COMMENT
MEDIUMtests/misc/test_ntfs_read.py45# ===========================================================================COMMENT
MEDIUMtests/misc/test_ntfs_read.py190# ===========================================================================COMMENT
MEDIUMtests/misc/test_ntfs_read.py192# ===========================================================================COMMENT
Hallucination Indicators3 hits · 22 pts
SeverityFileLineSnippetContext
CRITICALtests/SMB_RPC/test_wmi.py336 The following lines were added in the impacket.dcerpc.v5.dcom.wmi.IWbemClassObject.SpawnInstance():STRING
CRITICALtests/SMB_RPC/test_wmi.py342 # NOTE: I think these shouldn't be strings, see impacket.dcerpc.v5.dcom.wmi.ENCODED_VALUE.getValue() andSTRING
CRITICALtests/SMB_RPC/test_wmi.py343 # impacket.dcerpc.v5.dcom.wmi.CLASS_PART.getProperties() (links below). I won't change that code since ISTRING
AI Response Leakage2 hits · 15 pts
SeverityFileLineSnippetContext
HIGHimpacket/dcerpc/v5/ndr.py229 # (In this version of NDR, n is one of {1, 2, 4, 8}.) An octet stream index indicatesCOMMENT
HIGHimpacket/dcerpc/v5/ndr.py258 # (In this version of NDR, n is one of {1, 2, 4, 8}.) An octet stream index indicatesCOMMENT
AI Slop Vocabulary7 hits · 11 pts
SeverityFileLineSnippetContext
LOWimpacket/smbserver.py711 # For now we just return fake valuesCOMMENT
LOWimpacket/smbserver.py3084 # just use the same keyCOMMENT
LOWimpacket/examples/secretsdump.py581 # If dwExtCaps is not included in the answer, let's just add it so we can unpack DRS_EXTENSIONS_INT right.COMMENT
LOWimpacket/examples/ntlmrelayx/clients/dcsyncclient.py236 # If dwExtCaps is not included in the answer, let's just add it so we can unpack DRS_EXTENSIONS_INT right.COMMENT
LOWtests/dcerpc/test_drsuapi.py58 # If dwExtCaps is not included in the answer, let's just add it so we can unpack DRS_EXTENSIONS_INT right.COMMENT
LOWexamples/raiseChild.py686 # If dwExtCaps is not included in the answer, let's just add it so we can unpack DRS_EXTENSIONS_INT right.STRING
MEDIUMexamples/smbexec.py21# Certainly not a stealthy way.COMMENT
Slop Phrases5 hits · 8 pts
SeverityFileLineSnippetContext
MEDIUMimpacket/dcerpc/v5/transport.py440 # But you can use set_rpc_proxy_url method to set any URL / query you want.COMMENT
LOWimpacket/examples/secretsdump.py2395 LOG.warning("Don't forget to remove sensitive content before sending the data in a Github issue.")CODE
LOWimpacket/examples/regsecrets.py925 LOG.warning("Don't forget to remove sensitive content before sending the data in a Github issue.")CODE
MEDIUMexamples/GetADUsers.py17# If no entries are returned that means users don't have email addresses specified. If so, you can use theCOMMENT
LOWexamples/ntlmrelayx.py292 "are optional, and don't forget to escape the '\\'). If unspecified, it will relay bacCODE
Modern Structural Boilerplate3 hits · 3 pts
SeverityFileLineSnippetContext
LOWimpacket/dcerpc/v5/enum.py15__all__ = ['Enum', 'IntEnum', 'unique']CODE
LOWimpacket/ldap/ldap.py51__all__ = [CODE
LOWimpacket/ldap/ldapasn1.py25__all__ = [CODE
Dead Code1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMimpacket/dcerpc/v5/enum.py671CODE
Structural Annotation Overuse1 hit · 2 pts
SeverityFileLineSnippetContext
LOWimpacket/negoex.py671 #NOTE: This function fails the exchange if the peer doesnt send or pick our authentication schemeCOMMENT