| 125 | } |
| 126 | |
| 127 | char* ForgeHTTPRequestType1(char* ntlmsspType1, int ntlmsspType1Len, int* httpPacketType1Len, wchar_t* httpIp) { |
| 128 | char httpPacketTemplate[] = "GET / HTTP/1.1\r\nHost: %s\r\nAuthorization: NTLM %s\r\n\r\n"; |
| 129 | char* httpPacket = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, DEFAULT_BUFLEN); |
| 130 | int b64ntlmLen; |
| 131 | char httpIp_a[20]; |
| 132 | memset(httpIp_a, 0, 20); |
| 133 | wcstombs(httpIp_a, httpIp, 20); |
| 134 | char* b64ntlmTmp = base64Encode(ntlmsspType1, ntlmsspType1Len, &b64ntlmLen); |
| 135 | char b64ntlm[DEFAULT_BUFLEN]; |
| 136 | memset(b64ntlm, 0, DEFAULT_BUFLEN); |
| 137 | memcpy(b64ntlm, b64ntlmTmp, b64ntlmLen); |
| 138 | *httpPacketType1Len = sprintf(httpPacket, httpPacketTemplate, httpIp_a, b64ntlm); |
| 139 | return httpPacket; |
| 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"; |
no test coverage detected