All pastes #554427 Raw Edit

First root challenge

public cpp v1 · immutable
·published 2007-06-10 04:06 UTC
rendered paste body
#include <iostream>#include <windows.h>#include <string>#include <cstdlib>using namespace std;void main(){ SetConsoleTitle ("Jenkai's Root Challenge"); System ("color 1");}int main() { string dir; string cd; string cd ..; string telnet; string run; string help; string obj; string del; string disconnect;  cout<<"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n"; cout<<"                     Welcome to Jenkai's first root challenge!\n"; cout<<"              cout<<"\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n";  Sleep (5000); system("cls"); } do { cout<<"C:\> "; cin>> command; if (command == "help"){ cout<<"dir                 This gives you a directory listing of the current folder you're in.\n"; cout<<"cd                  This changes the current directory you're in.\n"; cout<<"telnet              If you don't know what this is, you shouldn't be doing this challenge.\n"; cout<<"run                 Run filename runs the desired file.\n" cout<<"help                Displays list of available commands.\n"; cout<<"obj                 Displays current objective.\n"; cout<<"del                 Del filename deletes the selected file.\n"; } else if (command == "obj"){ cout<<"My father's work computer has been hacked by a notorious hacker who goes by the name Cyph3r.\n"; cout<<"Cyph3r has implemented a rootkit on his computer to allow him total access to his entire network....\n"; cout<<"However, the rootkit only accepts connection from Cyph3r's IP address which is stored in a text file.\n"; cout<<"Your objective is to find the rootkit, delete it, find the text file, nab Cyph3r's IP, gain access \n"; cout<<"to his computer, and delete system.ini  I wish you luck.  Oh, before I forget, my father's \n"; cout<<"IP address is 24.49.29.0.  He has opened up port 65100 for you.\n"; } else if (command == "telnet"){ cout<<"Incorrect Syntax.  Correct syntas: telnet IPADDRESS PORT \n"; } if (command == "telnet 24.49.29.0 65100" cout<<"Connecting to 24.49.29.0 through port 65100...Please wait\n" sleep (5000); system ("cls"); do { SetConsoleTitle ("Remote Computer"); cout>>"C:\> "; while (shell1 == "telnet 24.49.29.0 65100");  do {  cout<<"C:\> ";  cin>> command;  }  if (command == "dir"){  cout<<"A\n";  cout<<"Documents and Settings\n";  cout<<"Program Files\n";  cout<<"WINDOWS\n";  }  if (command == "cd a"){  cout<<"Access denied\n";  }  if (command == "cd documents and settings"){  cout<<"Access denied\n";  }  if (command == "cd program files"){  cout<<"Access denied\n");  }  if (command == "cd windows"){   cout<<"\nC:\WINDOWS\> ";   }   if (command == "dir"){   cout<<"SYSTEM32\n";   cout<<"MEDIA\n";   cout<<"Config\n";   cout<<"Debug\n";   cout<<"rootkit.exe";   cout<<"IP.txt";   }    if (command == "cd system32"){    cout<<"Access Denied\n";    }    if (command == "cd media"){    cout<<"Access Denied\n";    }    if (command == "cd config"){    cout<<"Access Denied\n";    }    if (command == "cd debug"){    cout<<"Access Denied\n";    }    if (command == "run IP.txt"){    cout<<"$OnlyAllowConnections From: 76.110.111.25 \n\n";    cout<<"Good job!  You have his IP!  Now make sure the rootkit is gone, and disconnect.\n";    }    if (command == "del rootkit.exe"){    cout<<"Rootkit.exe has been deleted.";    }    if (command == "disconnect"){    cout<<"You have disconnected from remote host";    }   else {   cout<<"Wrong command.\n";   }  }     } if (command == "telnet 76.110.111.25"){  cout<<"Connecting to 76.110.111.25....\n";  sleep (5000);  system("cls");  do {  SetConsoleTitle ("Remote Computer");  cout>>"C:\> ";  cin>> command;  while (shell2 == "telnet 76.110.111.25");  }  if (command == "dir"){  cout<<"Dev-Cpp\n";  cout<<"Documents and settings\n";  cout<<"graphics\n";  cout<<"Program files\n";  cout<<"Temp\n";  cout<<"WINDOWS\n";  }  if (command == "cd dev-cpp"){  cout<<"Access Denied";  }  if (command == "cd documents and settings"){  cout<<"Access Denied";  }  if (command == "cd graphics"){  cout<<"Access Denied";  }  if (command == "cd program files"){  cout<<"Access Denied";  }  if (command == "cd temp"){  cout<<"Access Denied";  }  if (command == "cd windows"){  cout<<"C:\WINDOWS\> ";  cin>> command;  }  if (command == "dir"){  cout<<"Config";  cout<<"Debug";  cout<<"mui";  cout<<"PCHealth";  cout<<"system.ini";  }  if (command == del system.ini"){  cout<<"system.ini has been deleted";  sleep (1000);  system ("cls");  cout<<"Congratulations!  You passed my rooting challenge! ^_^  \n";  cout<<"© Copyright 2007 Jenkai.  Hacking is learning, not using.";  cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";  cin.get();   }  else {  cout<<"Incorrect command";  } }}