justinooo

Ghostpress Implementation

Aug 20th, 2016
753
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private static void initGhostpress(string downloadLink, string apiKey)
  2.         {
  3.             string m = "[-] ";
  4.             string p = "[+] ";
  5.             try
  6.             {
  7.                 bool needDL = false;
  8.                 string gpFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SharpEncrypter";
  9.                 string gpFile = gpFolder + "\\Ghostpress.exe";
  10.                 if (!Directory.Exists(gpFolder)) { Directory.CreateDirectory(gpFolder); }
  11.                 if (!File.Exists(gpFile))
  12.                 {
  13.                     setColor(ConsoleColor.Red); Console.Write(Environment.NewLine + p); setColor(ConsoleColor.Yellow);
  14.                     Console.Write("Anti-keylogger module missing! Downloading...");
  15.                     WebClient gpDownloader = new WebClient();
  16.                     gpDownloader.DownloadFile(downloadLink, gpFile);
  17.                     setColor(ConsoleColor.Green); Console.Write(Environment.NewLine + p); setColor(ConsoleColor.Yellow);
  18.                     Console.Write("Anti-keylogger module downloaded. Initializing...");
  19.                     needDL = true;
  20.                 }
  21.                 if (!needDL)
  22.                 {
  23.                     setColor(ConsoleColor.Green); Console.Write(Environment.NewLine + p); setColor(ConsoleColor.Cyan);
  24.                     Console.Write("Initializing anti-keylogger module...");
  25.                 }
  26.                 bool gpWorked = false;
  27.                 int gpWorkedI = 2;
  28.                 Process.Start(gpFile, "-api=1");
  29.                 Thread.Sleep(1000);
  30.                 TcpClient tcpClient = new TcpClient();
  31.                 tcpClient.Connect("127.0.0.82", 802);
  32.                 NetworkStream networkStream = tcpClient.GetStream();
  33.                 if ((networkStream.CanWrite) && (networkStream.CanRead))
  34.                 {
  35.                     do //Not working as intended.
  36.                     {
  37.                         string initCmd = "CMDInit:" + apiKey;
  38.                         Byte[] sendBytes = Encoding.ASCII.GetBytes(initCmd);
  39.                         networkStream.Write(sendBytes, 0, sendBytes.Length);
  40.                         byte[] bytes = new byte[tcpClient.ReceiveBufferSize + 1];
  41.                         networkStream.Read(bytes, 0, Convert.ToInt32(tcpClient.ReceiveBufferSize));
  42.                         Thread.Sleep(1000);
  43.                         string startCmd = "CMDStart";
  44.                         Byte[] sendBytes0 = Encoding.ASCII.GetBytes(startCmd);
  45.                         networkStream.Write(sendBytes0, 0, sendBytes0.Length);
  46.                         byte[] bytes0 = new byte[tcpClient.ReceiveBufferSize + 1];
  47.                         networkStream.Read(bytes0, 0, Convert.ToInt32(tcpClient.ReceiveBufferSize));
  48.                         string returnData = Encoding.ASCII.GetString(bytes);
  49.                         string returnData0 = Encoding.ASCII.GetString(bytes0);
  50.                         gpWorked = ((returnData.Contains("1")) && (returnData0.Contains("1")));
  51.                         if (gpWorked) { gpWorkedI = 1; } else { gpWorkedI = 0; }
  52.                     } while (gpWorkedI == 2);
  53.                 }
  54.                 if (gpWorked)
  55.                 {
  56.                     setColor(ConsoleColor.Green); Console.Write(Environment.NewLine + p); setColor(ConsoleColor.Cyan);
  57.                     Console.Write("Anti-keylogger module active!" + Environment.NewLine);
  58.                 }
  59.                 else
  60.                 {
  61.                     setColor(ConsoleColor.Red); Console.Write(Environment.NewLine + m); setColor(ConsoleColor.Yellow);
  62.                     Console.Write("Failed to initialize anti-keylogger module :(" + Environment.NewLine);
  63.                 }
  64.             }
  65.             catch (Exception ex)
  66.             {
  67.                 setColor(ConsoleColor.Red); Console.Write(Environment.NewLine + m); setColor(ConsoleColor.Yellow);
  68.                 Console.Write("Failed to initialize anti-keylogger module :(" + Environment.NewLine);
  69.                 using (StreamWriter sr = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SharpEncrypter\\exception.txt", true))
  70.                 {
  71.                     sr.Write(Environment.NewLine + ex.ToString());
  72.                     sr.Dispose();
  73.                     sr.Close();
  74.                 }
  75.             }
  76.         }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×