下载样本

下载来自http://www.cs.columbia.edu/CAVE/databases/pubfig/的样本。

C++程序:

//#define _AFXDLL//动态连接MFC,若不加此句,右键工程的属性->配置属性->常规->MFC的使用->在共享DLL中使用MFC得到同样效果
#include <afxinet.h>//MFC下封装socket的一个头文件,主管各种网络连接
#include <string>
#include <stdio.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>

using namespace std;
long DownLoadImg(CString szpUrl,char* szpBuff,char* imgName);
//BOOL DownLoadFile(LPCTSTR szRemoteURI, LPCTSTR szLocalPath);
//#define  __BUFFER_SIZE 1024
int main(int argc,char** argv)
{
	ifstream in("dev_urls.txt");
	string temp;

	int line=0;
	while(getline(in,temp))
	{
		line++;
		if(line==1||line==2)
			continue;
		istringstream ss(temp);//istringstream对象可以绑定一行字符串,然后以空格为分隔符把该行分隔开来
		string s;
		int j=0;
		while(ss>>s)
		{
			j++;
			if(j==4)
			{
          
				char* szpBuff;
				szpBuff = new char[10<<20];
				if(szpBuff == NULL)
				{
					cout<<"内存分配失败!"<<endl;
					delete szpBuff;
					break;
				}

				char imgName[10];
				itoa(line-2,imgName,10);
				*const int len=s.length();
				char *szpUrl;
				szpUrl=new char[len+1];
				strcpy(szpUrl,s.c_str());*/
				CString szpUrl;
				szpUrl=s.c_str();
				//DownLoadFile(szpUrl, "");
				if(DownLoadImg(szpUrl,szpBuff,imgName))
				{
					cout<<"下载,失败!"<<endl;
					delete szpBuff;
					//delete szpUrl;
					break;
				}
				delete szpBuff;
				delete szpUrl;
			}
		}	
	}
	in.close();

    //DownLoadImg("http://lh5.ggpht.com/_wKqf41I-J5A/SF2AaMunTnI/AAAAAAAABo0/diBN91bfheo/Aishworiya+(96).jpg",szpBuff,"test.jpg");

    //delete szpBuff;
	return 0;
}


long DownLoadImg(CString szpUrl,char* szpBuff,char* imgName)
//szpUrl表示要访问的网址
//szpBuff
{
	//CInternetSession session;如果是MFC应用程序,可以这样定义变量
	CInternetSession session("My Session");//如果是控制台应用程序,则必须加上后面的"My Session"
	CHttpFile *httpFile = NULL;

	/*try
	{*/
		httpFile=(CHttpFile *)session.OpenURL(szpUrl);
	/*}
	catch(CInternetException * m_pException)
	{
		httpFile = NULL;
		m_pException->m_dwError;
		m_pException->Delete();
		session.Close();
	}*/
	if(httpFile==NULL) 
	{
		httpFile->Close();
		session.Close();
		return -1;
	}
	CStdioFile  imgFile;
	imgFile.Open(imgName, CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
	DWORD dwStatusCode;
	httpFile->QueryInfoStatusCode(dwStatusCode);
	if(dwStatusCode == HTTP_STATUS_OK) 
	{
		int size=0;
		do 
		{
			size = httpFile->Read(szpBuff,1024);    // 读取图片
			imgFile.Write(szpBuff,size);
		}while(size > 0);
	}
	httpFile->Close();
	session.Close();

	return 0;
}

//BOOL DownLoadFile(LPCTSTR szRemoteURI, LPCTSTR szLocalPath)
//{
//	//ENSURE_ARG_EX(NULL != szRemoteURI && NULL != szLocalPath);
//	CInternetSession session("My Session") ;
//	CHttpConnection* pHttpConnection = NULL;
//	CHttpFile* pHttpFile             = NULL;
//	CString strServer   = _T(""), strObject = _T("");
//	INTERNET_PORT wPort = 0;
//	DWORD dwType        = 0;
//	HANDLE hFile = NULL;
//	TCHAR  pszBuffer[__BUFFER_SIZE];
//	DWORD  dwFileSize = 0;
//	const int nTimeOut = 2000;
//	session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, nTimeOut);
//	session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 1);       
//	BOOL bResult = FALSE;
//	/*try
//	{*/
//		AfxParseURL(szRemoteURI, dwType, strServer, strObject, wPort);
//		pHttpConnection = session.GetHttpConnection(strServer, wPort, NULL, NULL);
//		//VERIFY_EX(NULL != pHttpConnection);
//		pHttpFile = pHttpConnection->OpenRequest(CHttpConnection::HTTP_VERB_GET, strObject);
//		//VERIFY_EX(NULL != pHttpFile);
//		if(!pHttpFile->SendRequest())
//			goto _err_handler;
//		DWORD dwStateCode;
//		pHttpFile->QueryInfoStatusCode(dwStateCode);
//		if(dwStateCode != HTTP_STATUS_OK)
//			goto _err_handler;
//		hFile = CreateFile(szLocalPath, GENERIC_WRITE,
//			FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 
//		if(hFile == INVALID_HANDLE_VALUE)
//			goto _err_handler;
//		BOOL bRet = pHttpFile->QueryInfo(HTTP_QUERY_CONTENT_LENGTH, dwFileSize);
//		if (!bRet)
//			goto _err_handler;
//
//		DWORD dwWrite = 0, dwTotalWrite = 0;
//		UINT nRead = 0;
//		do
//		{
//			nRead = pHttpFile->Read(pszBuffer, __BUFFER_SIZE);
//			if (nRead <= 0) break;
//			WriteFile(hFile, pszBuffer, nRead, &dwWrite, NULL);
//			//VERIFY_EX(nRead == dwWrite);
//			dwTotalWrite += dwWrite;
//		} while (TRUE);
//		if (dwTotalWrite != dwFileSize)
//			goto _err_handler;
//		bResult = TRUE;
//	/*}
//	catch (CFileException* e)
//	{
//		e->Delete();
//		REPORT_CACHED_EXCEPTION(_T("CFileException"));
//	}
//	catch (CInternetException* e)
//	{
//		CString sError;
//		sError.Format(_T("Inernet connection error : %d"), e->m_dwError);
//		e->Delete();
//		REPORT_CACHED_EXCEPTION(sError);
//	}*/
//_err_handler:
//	if (pHttpFile)
//	{
//		pHttpFile->Close();
//		delete pHttpFile;
//	}
//	if (pHttpConnection)
//	{
//		pHttpConnection->Close();
//		delete pHttpConnection;
//	}
//	session.Close();
//	if (hFile) CloseHandle(hFile);
//	return bResult;
//}

未调通,时间关系,转战matlab

clc;clear;close all;
fidin=fopen('dev_urls.txt','r');
i=0;
while ~feof(fidin)
    tline=fgetl(fidin);
    urlstart=strfind(tline,'http');
    urlend=strfind(tline,'.jpg');
    if(isempty(urlstart)||isempty(urlend))
        continue;
    end
    url=tline(urlstart:urlend+3);
    %imgName=tline(1:urlstart-1);
    i=i+1;
    imgName=[num2str(i) '.jpg'];
    disp(['正在下载...' num2str(i)]);
    [f,status] = urlwrite(url,imgName,'Timeout',3);
    if(status==0)
        disp(['第' num2str(i) '个链接无效..']);
    else
        disp(['第' num2str(i) '个链接有效..']);
    end
    clear url;
end
disp('下载完毕!');
fclose(fidin);

设置matlab的网络代理:File->Preferences->web


病毒名称:Worm.WhBoy.h 病毒中文名:熊猫烧香(武汉男生),近日又化身为“金猪报喜” 病毒类型:蠕虫 危险级别:★★★★★ 影响平台:Win 9x/ME,Win 2000/NT,Win XP,Win 2003 专杀工具:金山专杀工具 安天专杀工具 江民专杀工具 安博士专杀工具 赛门铁克专杀工具 病毒描述: “武汉男生”,俗称“熊猫烧香”,这是一个感染型的蠕虫病毒,它能感染系统中exe,com,pif,src,html,asp等文件,它还能中止大量的反病毒软件进程并且会删除扩展名为gho的文件,该文件是一系统备份工具GHOST的备份文件,使用户的系统备份文件丢失。被感染的用户系统中所有.exe可执行文件全部被改成熊猫举着三根香的模样。 1:拷贝文件 病毒运行后,会把自己拷贝到C:\\WINDOWS\\System32\\Drivers\\spoclsv.exe 2:添加注册表自启动 病毒会添加自启动项HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run svcshare -> C:\\WINDOWS\\System32\\Drivers\\spoclsv.exe 3:病毒行为 a:每隔1秒寻找桌面窗口,并关闭窗口标题中含有以下字符的程序: QQKav、QQAV、防火墙、进程、VirusScan、网镖、杀毒、毒霸、瑞星、江民、黄山IE、超级兔子、优化大师、木马克星、木马清道夫、QQ病毒、注册表编辑器、系统配置实用程序、卡巴斯基反病毒、Symantec AntiVirus、Duba、esteem proces、绿鹰PC、密码防盗、噬菌体、木马辅助查找器、System Safety Monitor、Wrapped gift Killer、Winsock Expert、游戏木马检测大师、msctls_statusbar32、pjf(ustc)、IceSword 并使用的键盘映射的方法关闭安全软件IceSword 添加注册表使自己自启动 HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run svcshare -> C:\\WINDOWS\\System32\\Drivers\\spoclsv.exe 并中止系统中以下的进程: Mcshield.exe、VsTskMgr.exe、naPrdMgr.exe、UpdaterUI.exe、TBMon.exe、scan32.exe、Ravmond.exe、CCenter.exe、RavTask.exe、Rav.exe、Ravmon.exe、RavmonD.exe、RavStub.exe、KVXP.kxp、kvMonXP.kxp、KVCenter.kxp、KVSrvXP.exe、KRegEx.exe、UIHost.exe、TrojDie.kxp、FrogAgent.exe、Logo1_.exe、Logo_1.exe、Rundl132.exe b:每隔18秒点击病毒作者指定的网页,并用命令行检查系统中是否存在共享,共存在的话就运行net share命令关闭admin$共享 c:每隔10秒下载病毒作者指定的文件,并用命令行检查系统中是否存在共享,共存在的话就运行net share命令关闭admin$共享 d:每隔6秒删除安全软件在注册表中的键值 并修改以下值不显示隐藏文件 HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\Folder\\Hidden\\SHOWALL CheckedValue -> 0x00 删除以下服务: navapsvc、wscsvc、KPfwSvc、SNDSrvc、ccProxy、ccEvtMgr、ccSetMgr、SPBBCSvc、Symantec Core LC、NPFMntor MskService、FireSvc e:感染文件 病毒会感染扩展名为exe,pif,com,src的文件,把自己附加到文件的头部,并在扩展名为htm,html, asp,php,jsp,aspx的文件中添加一网址,用户一但打开了该文件,IE就会不断的在后台点击写入的网址,达到增加点击量的目的,但病毒不会感染以下文件夹名中的文件: WINDOW、Winnt、System Volume Information、Recycled、Windows NT、WindowsUpdate、Windows Media Player、Outlook Express、Internet Explorer、NetMeeting、Common Files、ComPlus Applications、Messenger、InstallShield Installation Information、MSN、Microsoft Frontpage、Movie Maker、MSN Gamin Zone g:删除文件 病毒会删除扩展名为gho的文件,该文件是一系统备份工具GHOST的备份文件使用户的系统备份文件丢失。 工具更新: 2007-01-12  1.增加病毒变种特征。 2.增加对htm,html,asp,aspx,php等文件的查杀。 3:修正对病毒清除的流程。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值