Advertisement
Guest User

Untitled

a guest
Nov 27th, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 13.17 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdio.h>
  3. #include<conio.h>
  4. #include<string>
  5. #include<windows.h>
  6. #include<fstream>
  7. #include<ctime>
  8. #include <time.h>
  9. #include <stdlib.h>
  10. #include <cstdlib>
  11.  
  12. #define NCOMPUTERS 10 //BROJ KOMPJUTERA ZA NAPRAVIT
  13.  
  14. using namespace std;
  15. string TARGET_IP;
  16. int TARGET_PORT;
  17. int TARGET_PING;
  18. string TARGET_OS;
  19. string COMP_IPS[10];
  20. string TARGET_EXPLOIT;
  21. int MONEY;
  22. //INIT_VAR#######################################
  23. void Initgame();
  24. void LogIn();
  25. void LogInSucess();
  26. void Interface();
  27. void MakeComputers();
  28. void DisplayComputers();
  29. void DisplayMain();
  30. void InputAlgoritam(string input);
  31. void Ping();
  32. void TargetIP();
  33. void Scan();
  34. void ScanAnimation();
  35. void Nmap();
  36. void Exploit();
  37. void ReadIPFile();
  38. void CreateExploits();
  39. void DisplayExploits();
  40. void ExploitDB();
  41. void DarkShop();
  42. void DarkShopAnimation();
  43. //###########################################
  44.  
  45.  
  46. class Exploits{
  47.     public:
  48.       int id;
  49.       string exploit_name;
  50.       string exploit_desc;
  51.       string exploit_os;
  52.       int exploit_port;
  53.       int exploit_price;
  54.  
  55.       string exploit_nname[5]{
  56.                "Windows Reverse TCP",
  57.                "Linux Reverse TCP",
  58.                "Hail Mary",
  59.                "Binder",
  60.                "Windows Shell"
  61.       };
  62.       string exploit_ddesc[5]{
  63.                "Used for control of TARGET Windows/Windows Server PC",
  64.                "Used Used for control of TARGET Linux Based PC",
  65.                "Text ALL exploits on TARGET PC",
  66.                "Binding Agent, used for gathering input informations",
  67.                "Shell for code executing on TARGET PC"
  68.       };
  69.       string exploit_oos[5]{
  70.                "Windows 10",
  71.                "Windows Server",
  72.                "Linux",
  73.                "Debian",
  74.                "DOS"
  75.       };
  76. }Exploitt[5],UserExploits[5];
  77. void CreateExploits(){
  78.       int i;
  79.         for(i=0;i<5;i++){
  80.           Exploitt[i].id = i;
  81.           Exploitt[i].exploit_name = Exploitt[i].exploit_nname[i];
  82.           Exploitt[i].exploit_desc = Exploitt[i].exploit_ddesc[i];
  83.           Exploitt[i].exploit_os = Exploitt[i].exploit_oos[i];
  84.        }
  85. }
  86. void DisplayExploits(){
  87.       int i;
  88.       for(i=0;i<5;i++){
  89.         cout <<"Exploit ID: "<< Exploitt[i].id << " Exploit name: " << Exploitt[i].exploit_name << " Exploit desc: " << Exploitt[i].exploit_desc << " Exploit OS: " << Exploitt[i].exploit_os << endl;
  90.       }
  91.  
  92. }
  93.  
  94. class Computers{
  95.  public:
  96.     int comp_id;
  97.     string comp_name;
  98.     string comp_ip;
  99.     string comp_os;
  100.     string comp_location;
  101.     int comp_port;
  102.     int comp_ping;
  103.     bool isAlive;
  104.  
  105.     string comp_names[5]{
  106.         "Chinese Server",
  107.         "Personal Computer",
  108.         "Bank",
  109.         "IBM",
  110.         "VPN"
  111.     };
  112.     string comp_oss[5]{
  113.         "Windows 10",
  114.         "Windows Server",
  115.         "Linux",
  116.         "Debian",
  117.         "DOS"
  118.     };
  119.     string comp_locations[5]{
  120.         "Europe",
  121.         "America",
  122.         "China",
  123.         "Russia",
  124.         "Africa"
  125.     };
  126.     int comp_ports[5]{
  127.         20,
  128.         22,
  129.         80,
  130.         120,
  131.         450
  132.     };
  133.     string comp_ips[10];
  134.     //FUNKCIJE DEKLARACIJA
  135.     void MakeComputers();
  136.  
  137.  
  138. }kompovi[NCOMPUTERS];
  139.  
  140. void MakeComputers(){
  141.         int i;
  142.         for(i=0;i<NCOMPUTERS;i++){
  143.         kompovi[i].comp_id = i;
  144.         kompovi[i].comp_name = kompovi[i].comp_names[rand() % 4];
  145.         kompovi[i].comp_ip = COMP_IPS[i];
  146.         kompovi[i].comp_os = kompovi[i].comp_oss[rand() % 4];
  147.         kompovi[i].comp_location = kompovi[i].comp_locations[rand() % 4];
  148.         kompovi[i].comp_port = kompovi[i].comp_ports[rand() % 4];
  149.         kompovi[i].isAlive = rand() % 2;
  150.        }
  151. }
  152. void DisplayComputers(){
  153.         int i;
  154.         for(i=0;i<NCOMPUTERS;i++){
  155.             cout << "Komp " << kompovi[i].comp_id << " ,Komp name: " << kompovi[i].comp_name << " ,Komp IP: " << kompovi[i].comp_ip << " ,Komp OS: " << kompovi[i].comp_os << ", Komp Loc: " <<kompovi[i].comp_location << " ,Komp Port: " << kompovi[i].comp_port << " ,Komp ziv: " << kompovi[i].isAlive <<endl;
  156.         }
  157.  
  158. }
  159. //INIT FUNKCIJA##
  160. void Initgame(){
  161.       LogIn();
  162. }
  163.  
  164.  
  165. //#################################################
  166. void GameText(int id){
  167.  
  168.  
  169.     switch(id){
  170.           case 1:
  171.                cout<<"Ping TARGET - Ping IP Address"<< endl;
  172.                cout<<"Target (IP) - Targets IP for further use"<< endl;
  173.                cout<<"scan  - Scans IP Addresses"<<endl;
  174.                cout<<"nmap TARGET - Scans IP Address for OS and Exploit dettection"<<endl;
  175.                cout<<"exploitdb - Database of private exploits to use on TARGET"<<endl;
  176.                cout<<"exploit TARGET - exploits port of IP with custom exploit"<<endl;
  177.                cout<<"darkshop - exploits shopping" << endl;
  178.                break;
  179.           case 2:
  180.                cout<<"######  ##    ## ##    ## ##    ## ######## ######## "<<endl;
  181.                cout<<"##    ## ##   ##   ##  ##  ###   ## ##          ##    "<<endl;
  182.                cout<<"##       ##  ##     ####   ####  ## ##          ##    "<<endl;
  183.                cout<<" ######  #####       ##    ## ## ## ######      ##    "<<endl;
  184.                cout<<"      ## ##  ##      ##    ##  #### ##          ##    "<<endl;
  185.                cout<<"##    ## ##   ##     ##    ##   ### ##          ##    "<<endl;
  186.                cout<<" ######  ##    ##    ##    ##    ## ########    ##    "<<endl;
  187.                break;
  188.           case 3:
  189.                cout << "__________________________" << endl;
  190.                cout << "TARGET_IP| "<<TARGET_IP <<" |" << endl;
  191.                cout << "--------------------------" << endl;
  192.                cout << "TARGET_PORT| "<<TARGET_PORT <<" |" << endl;
  193.                cout << "--------------------" << endl;
  194.                cout << "TARGET_PING| "<<TARGET_PING <<" |" << endl;
  195.                cout << "-----------------" << endl;
  196.                cout << "TARGET_OS| "<<TARGET_OS << " |"<< endl;
  197.                cout << "-----------------" << endl;
  198.                cout << "TARGET_EXPLOIT| "<<TARGET_EXPLOIT << " |"<<endl;
  199.                cout << "----------------------------------------"<<endl;
  200.                break;
  201.           case 4:
  202.                cout<<" ######  ##    ## ##    ## ##    ## ######## ########         ########    ###    ##    ## ########  #######  ##     ## ######## ########  "<<endl;
  203.                cout<<"##    ## ##   ##   ##  ##  ###   ## ##          ##               ##      ## ##   ##   ##  ##       ##     ## ##     ## ##       ##     ## "<<endl;
  204.                cout<<"##       ##  ##     ####   ####  ## ##          ##               ##     ##   ##  ##  ##   ##       ##     ## ##     ## ##       ##     ## "<<endl;
  205.                cout<<" ######  #####       ##    ## ## ## ######      ##               ##    ##     ## #####    ######   ##     ## ##     ## ######   ########  "<<endl;
  206.                cout<<"      ## ##  ##      ##    ##  #### ##          ##               ##    ######### ##  ##   ##       ##     ##  ##   ##  ##       ##   ##   "<<endl;
  207.                cout<<"##    ## ##   ##     ##    ##   ### ##          ##               ##    ##     ## ##   ##  ##       ##     ##   ## ##   ##       ##    ##  "<<endl;
  208.                cout<<" ######  ##    ##    ##    ##    ## ########    ##    #######    ##    ##     ## ##    ## ########  #######     ###    ######## ##     ## "<<endl;
  209.                break;
  210.           case 5:
  211.                cout << "CASH: " << MONEY << "$" <<endl;
  212.                break;
  213.           case 6:
  214.                cout<<"########     ###    ########  ##    ##  ######  ##     ##  #######  ########  "<<endl;
  215.                cout<<"##     ##   ## ##   ##     ## ##   ##  ##    ## ##     ## ##     ## ##     ## "<<endl;
  216.                cout<<"##     ##  ##   ##  ##     ## ##  ##   ##       ##     ## ##     ## ##     ## "<<endl;
  217.                cout<<"##     ## ##     ## ########  #####     ######  ######### ##     ## ########  "<<endl;
  218.                cout<<"##     ## ######### ##   ##   ##  ##         ## ##     ## ##     ## ##        "<<endl;
  219.                cout<<"##     ## ##     ## ##    ##  ##   ##  ##    ## ##     ## ##     ## ##        "<<endl;
  220.                cout<<"########  ##     ## ##     ## ##    ##  ######  ##     ##  #######  ##        "<<endl;
  221.                break;
  222.           case 7:
  223.                cout<<"browse - Browse Database of Exploits"<<endl;
  224.                cout<<"hardware - Browse Hardware to for PC upgrading"<<endl;
  225.                cout<<"disconnect - Leave server"<<endl;
  226.                break;
  227.  
  228.     }
  229.  
  230.  
  231. }
  232. //ATTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTACK
  233. void Ping(){
  234.    int i, pingg;
  235.    pingg = rand() % 500;
  236.    cout << "Pinging " << TARGET_IP << endl;
  237.    for(i=0;i<NCOMPUTERS;i++){
  238.     if(kompovi[i].comp_ip == TARGET_IP){
  239.         kompovi[i].comp_ping = pingg;
  240.         TARGET_PING = pingg;
  241.     }
  242.    }
  243.    Sleep(5000);
  244.    system("CLS");
  245.    Interface();
  246.  
  247.  
  248. }
  249. void TargetIP(){
  250.      string t_ip;
  251.      int i;
  252.      cout << "Enter IP to target: ";
  253.      cin >> t_ip;
  254.      for(i=0;i< NCOMPUTERS;i++){
  255.         if(kompovi[i].comp_ip == t_ip){
  256.             TARGET_IP = kompovi[i].comp_ip;
  257.             TARGET_PORT = kompovi[i].comp_port;
  258.         }
  259.      }
  260.      system("CLS");
  261.      Interface();
  262. }
  263.  
  264. //SCAN ART
  265. void ScanAnimation(){
  266.      cout << "Scanning Vunerable IP's.";
  267.      Sleep(3000);
  268.      cout <<".";
  269.      Sleep(3000);
  270.      cout <<".";
  271.      Sleep(3000);
  272. }
  273. void ScanResult(){
  274.      int rand_num;
  275.      int i;
  276.      rand_num = rand() % 3;
  277.      cout << "Found " << rand_num << " vulnerable IP addresse's: " << endl;
  278.      for(i=0;i< rand_num;i++){
  279.         cout <<"Computer ID " <<kompovi[i].comp_id << " COMPUTER IP " << kompovi[i].comp_ip << " COMPUTER PORT " << kompovi[i].comp_port << " COMPUTER SYSTEM " << kompovi[i].comp_os << " COMPUTER LOCATION " << kompovi[i].comp_location << endl;
  280.      }
  281. }
  282. /////////////////////////////
  283. void Scan(){
  284.      ScanAnimation();
  285.      ScanResult();
  286.  
  287. }
  288. void NmapAnimation(){
  289.      cout<< "Executing.";
  290.      Sleep(3000);
  291.      cout<< ".";
  292.      Sleep(3000);
  293.      cout<<".";
  294.      Sleep(3000);
  295.  
  296. }
  297. void NmapResult(){
  298.      int i;
  299.      cout << "Looking for OS..."<<endl;
  300.      for(i=0;i<NCOMPUTERS;i++){
  301.         if(kompovi[i].comp_ip == TARGET_IP){
  302.            TARGET_OS = kompovi[i].comp_os;
  303.         }
  304.      }
  305.      Interface();
  306. }
  307. void Nmap(){
  308.      NmapAnimation();
  309.      NmapResult();
  310. }
  311.  
  312. void ExploitDB(){
  313.  
  314. }
  315.  
  316. void Exploit(){}
  317.  
  318. void EncryptAnimation(int repeat){
  319.      int i;
  320.      for(i=0;i<repeat;i++){
  321.         cout <<"0011010111001010"<<endl;
  322.         Sleep(500);
  323.         cout <<"0100010011001010"<<endl;
  324.         Sleep(500);
  325.         cout <<"0001001001001001"<<endl;
  326.         Sleep(500);
  327.         cout <<"0000111010010100"<<endl;
  328.         Sleep(500);
  329.         cout <<"0100100100100101"<<endl;
  330.      }
  331.  
  332. }
  333. void DarkShopAnimation(){
  334.      cout << "Connecting to http://pwoah7foa6au2pul.onion/.php?aff=41211.";
  335.      Sleep(3000);
  336.      cout << ".";
  337.      Sleep(3000);
  338.      cout << "."<<endl;
  339.      Sleep(3000);
  340.      cout << "Connected, encrypting connection..."<<endl;
  341.      EncryptAnimation(5);
  342.  
  343. }
  344. void DarkShopStore(){
  345.  
  346.      GameText(6);
  347.      GameText(7);
  348.  
  349. }
  350. void DarkShop(){
  351.      DarkShopAnimation();
  352.      cout << "Encripting Sucessfull."<<endl;
  353.      Sleep(3000);
  354.      system("CLS");
  355.      DarkShopStore();
  356.  
  357. }
  358. //############################################################
  359.  
  360. void DisplayMain(){
  361.      system("CLS");
  362.      GameText(2); //SKYNET
  363.      GameText(5);//CASH
  364.      GameText(3); //TARGET IP/PORT
  365.      GameText(1); //COMMANDS
  366. }
  367.  
  368. void Interface(){      //GLAVNO ZA INPUT
  369.      string input;
  370.      DisplayMain();
  371.      while(true){
  372.         cin >> input;
  373.         InputAlgoritam(input);
  374.      }
  375. }
  376.  
  377. void InputAlgoritam(string input){
  378.  
  379.       if(input == "ping"){
  380.             Ping();
  381.       }
  382.       else if(input == "target") {
  383.             TargetIP();
  384.       }
  385.       else if(input == "scan") {
  386.             Scan();
  387.       }
  388.       else if(input == "nmap") {
  389.             Nmap();
  390.       }
  391.       else if(input == "exploitdb"){
  392.             ExploitDB();
  393.       }
  394.       else if(input == "exploit") {
  395.             Exploit();
  396.       }
  397.       else if(input == "darkshop"){
  398.             DarkShop();
  399.       }
  400.  
  401.  
  402. }
  403.  
  404.  
  405. void LogInSucess(){
  406.     cout << "LOGIN SUCESSFUL. WELCOME TO SKYNET CONSOLE" << endl;
  407.     system("CLS");
  408.     Interface();
  409. }
  410.  
  411. void LogIn(){
  412.     string uname,upass;
  413.     GameText(2);
  414.     cout << "USERNAME: ";
  415.     cin >> uname;
  416.     cout << "PASSWORD: ";
  417.     cin >> upass;
  418.  
  419.     if(uname == "admin" && upass == "admin"){
  420.        LogInSucess();
  421.     }
  422.     else {
  423.         cout << "BAD LOGIN" << endl;
  424.         return LogIn();
  425.     }
  426.  
  427. }
  428.  
  429. //#################################################
  430. //STREAM FILE
  431. void ReadIPFile(){
  432.      int i;
  433.      ifstream ipfile;
  434.      string line;
  435.      ipfile.open("ipfile.txt");
  436.      if(ipfile.is_open()){
  437.         for(i=0;i<10;i++){
  438.             ipfile >> COMP_IPS[i];
  439.         }
  440.      }
  441.  
  442.  
  443. }
  444. ////////////////////////////////////////////////
  445.  
  446.  
  447. int main(){
  448.   TARGET_IP = "000.000.0.0";
  449.   TARGET_PORT = 0;
  450.   MONEY = 1000;
  451.  
  452.   ReadIPFile(); //ISCITAVA AJPIJEVE
  453.   MakeComputers(); //PRAVI KOMPJUTENS
  454.   //DisplayComputers(); //DEBAG
  455.   CreateExploits();
  456.   DisplayExploits();
  457.   Initgame();
  458.   return 0;
  459.  
  460. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement