Code:
char Dis[512];
sprintf(Dis,"%s %s%c%s%c%c %s%c%s%c\r\n",
"Content-Disposition: form-data;",
"name=",
'"',
"upfile",
'"',
';',
"filename=",
'"',
"HTTPGET.exe",
'"');
MessageBox(NULL,Dis,"",0);
char *post = new char[1024];
char ModuleName[65];
GetModuleFileName(NULL,ModuleName,sizeof(ModuleName));
MessageBox(NULL,ModuleName,"",0);
HANDLE Upload = CreateFile("C:\Users\Anddos\Documents\coding\HTTPGET\Release\HTTPGET.exe",
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if(Upload != INVALID_HANDLE_VALUE)
{
MessageBox(NULL,"Made file handle","",0);
}
char rBuffer[500000];
DWORD Read,ToRead;
char *exe = new char [1024];
BOOL s;
while(1)
{
s = ReadFile(Upload,rBuffer,Read,&ToRead,0);
MessageBox(NULL,"read loop","",0);
if(s == true)
{
MessageBox(NULL,"break","",0);
break;
}
}
char Out[32];
//sprintf(Out,"%s %i %s %i","read",Read,"toread",ToRead);
//MessageBox(NULL,"read",Out,0);
//sprintf(exe,(char*)rBuffer);
sprintf(post,"%s%d%s%s",
"POST / HTTP/1.1\r\n"
"Host: scanner.novirusthanks.org\r\n"
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"
"Accept-Language: en-gb,en;q=0.5\r\n"
"Accept-Encoding: gzip,deflate\r\n"
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
"Keep-Alive: 300\r\n"
"Connection: keep-alive\r\n"
"Referer: http://scanner.novirusthanks.org\r\n"
"Content-Type: multipart/form-data; boundary=---------------------------24464570528145\r\n"
"Content-Length: \r\n",strlen(rBuffer),
Dis,
"Content-Type: application/octet-stream\r\n\r\n");
//"Content-Length: %i\r\n\r\n", strlen(body));
MessageBox(NULL,post,"",0);
send(sock,post,strlen(post),0);
send(sock,rBuffer,strlen(rBuffer),0);