#include
#include
#include
#include
#include
#include
#include
#include
#include"string.h"
#include
#pragma comment(lib,"WS2_32.lib")
#define MAX 50000
char str[10000][5000];
char string[10000][5000];
void readfile( );
int num;
void main()
{
int RET;
SOCKET sc;
WSADATA wsaData;
SOCKADDR_IN scAddr;
HOSTENT * ht;
char Buffer[MAX] = {0};
printf("****************** xmd5.com网站md5密码查询******************\n");
readfile( );
FILE *fHtmlData;
if((fHtmlData=fopen("d:\\save-xmd5.txt","w"))==NULL)
{printf("can not open file2\n");exit(0);}
//fHtmlData = fopen("d:\\readweb.txt", "w");
//printf("总共%d个\n",num);
//char szPage[500] = "GET /getmd5api.aspx q=c75b7ef7915803f9 HTTP/1.1\r\nHost: www.cmd5.com\r\n\r\n";
printf("\n开始查询并把结果保存在d盘根目录下的save-xmd5.txt中......\n\n");
for(int c=0;c { char Buffer[MAX] = {0}; char szPage[6000]="\0"; //"GET /md5/md5check.asp md5pass=baf56627478ec76a HTTP/1.1\r\n" //"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-silverlight, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*\r\n" //"Referer: http://www.xmd5.org/\r\n" //"Accept-Language: zh-cn\r\n" //"Accept-Encoding: gzip, deflate\r\n" // "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; http://bsalsa.com) )\r\n" // "Host: www.xmd5.org\r\n" // "Connection: Keep-Alive\r\n" // "Cookie: AJSTAT_ok_times=1; AJSTAT_ok_pages=47; AJSTAT_ok_times=1; ASPSESSIONIDQASCTSDD=OENPPCBBCIMIMOPNFONANNJO; ASPSESSIONIDQATCSSDC=JNDJIGBBCMDMDLEDELCLENOL\r\n" //"\r\n\r\n\r\n"; // char szPage[1000] = "GET /md5/md5check.asp md5pass=eff9d7295bfc800a HTTP/1.1\r\n Host: xmd5.org\r\n\r\n"; //char szPage[500] = "GET /showthread.php t=44643 HTTP/1.1\r\nHost: bbs.pediy.com\r\n\r\n"; memset(string[c], '\0', sizeof(string)); strcpy(string[c],"GET /md5/md5check.asp md5pass="); strcat(string[c],str[c]); strcat(string[c]," "); strcat(string[c]," HTTP/1.1\r\n"); strcat(string[c],"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-silverlight, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*\r\n"); strcat(string[c],"Referer: http://www.xmd5.org/\r\n"); strcat(string[c],"Accept-Language: zh-cn\r\n"); strcat(string[c],"Accept-Encoding: gzip, deflate\r\n"); strcat(string[c],"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; http://bsalsa.com) )\r\n"); strcat(string[c],"Host: www.xmd5.org\r\n"); strcat(string[c],"Connection: Keep-Alive\r\n"); strcat(string[c],"Cookie: AJSTAT_ok_times=1; AJSTAT_ok_pages=47; AJSTAT_ok_times=1; ASPSESSIONIDQASCTSDD=OENPPCBBCIMIMOPNFONANNJO; ASPSESSIONIDQATCSSDC=JNDJIGBBCMDMDLEDELCLENOL\r\n"); strcat(string[c],"\r\n\r\n\r\n"); printf("正在查询%s...\n",str[c]); strcpy(szPage,string[c]); WSAStartup(0x0202, &wsaData); sc = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, 0); ht = gethostbyname("www.xmd5.org"); scAddr.sin_port = htons(80); scAddr.sin_family = AF_INET; scAddr.sin_addr.s_addr = *