MCPcopy Create free account
hub / github.com/decoder-it/ADCSCoercePotato / findNTLMBytes

Method findNTLMBytes

ADCSCoercePotato.cpp:69–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68};
69int PotatoAPI::findNTLMBytes(char* bytes, int len) {
70 //Find the NTLM bytes in a packet and return the index to the start of the NTLMSSP header.
71 //The NTLM bytes (for our purposes) are always at the end of the packet, so when we find the header,
72 //we can just return the index
73 char pattern[7] = { 0x4E, 0x54, 0x4C, 0x4D, 0x53, 0x53, 0x50 };
74 int pIdx = 0;
75 int i;
76 for (i = 0; i < len; i++) {
77 if (bytes[i] == pattern[pIdx]) {
78 pIdx = pIdx + 1;
79 if (pIdx == 7) return (i - 6);
80 }
81 else {
82 pIdx = 0;
83 }
84 }
85 return -1;
86}
87void usage()
88{
89 printf("ADCSCoercePotato\n- @decoder_it 2024\n\n", VERSION);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected