Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void initGhostpress(string downloadLink, string apiKey)
- {
- string m = "[-] ";
- string p = "[+] ";
- try
- {
- bool needDL = false;
- string gpFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SharpEncrypter";
- string gpFile = gpFolder + "\\Ghostpress.exe";
- if (!Directory.Exists(gpFolder)) { Directory.CreateDirectory(gpFolder); }
- if (!File.Exists(gpFile))
- {
- setColor(ConsoleColor.Red); Console.Write(Environment.NewLine + p); setColor(ConsoleColor.Yellow);
- Console.Write("Anti-keylogger module missing! Downloading...");
- WebClient gpDownloader = new WebClient();
- gpDownloader.DownloadFile(downloadLink, gpFile);
- setColor(ConsoleColor.Green); Console.Write(Environment.NewLine + p); setColor(ConsoleColor.Yellow);
- Console.Write("Anti-keylogger module downloaded. Initializing...");
- needDL = true;
- }
- if (!needDL)
- {
- setColor(ConsoleColor.Green); Console.Write(Environment.NewLine + p); setColor(ConsoleColor.Cyan);
- Console.Write("Initializing anti-keylogger module...");
- }
- bool gpWorked = false;
- int gpWorkedI = 2;
- Process.Start(gpFile, "-api=1");
- Thread.Sleep(1000);
- TcpClient tcpClient = new TcpClient();
- tcpClient.Connect("127.0.0.82", 802);
- NetworkStream networkStream = tcpClient.GetStream();
- if ((networkStream.CanWrite) && (networkStream.CanRead))
- {
- do //Not working as intended.
- {
- string initCmd = "CMDInit:" + apiKey;
- Byte[] sendBytes = Encoding.ASCII.GetBytes(initCmd);
- networkStream.Write(sendBytes, 0, sendBytes.Length);
- byte[] bytes = new byte[tcpClient.ReceiveBufferSize + 1];
- networkStream.Read(bytes, 0, Convert.ToInt32(tcpClient.ReceiveBufferSize));
- Thread.Sleep(1000);
- string startCmd = "CMDStart";
- Byte[] sendBytes0 = Encoding.ASCII.GetBytes(startCmd);
- networkStream.Write(sendBytes0, 0, sendBytes0.Length);
- byte[] bytes0 = new byte[tcpClient.ReceiveBufferSize + 1];
- networkStream.Read(bytes0, 0, Convert.ToInt32(tcpClient.ReceiveBufferSize));
- string returnData = Encoding.ASCII.GetString(bytes);
- string returnData0 = Encoding.ASCII.GetString(bytes0);
- gpWorked = ((returnData.Contains("1")) && (returnData0.Contains("1")));
- if (gpWorked) { gpWorkedI = 1; } else { gpWorkedI = 0; }
- } while (gpWorkedI == 2);
- }
- if (gpWorked)
- {
- setColor(ConsoleColor.Green); Console.Write(Environment.NewLine + p); setColor(ConsoleColor.Cyan);
- Console.Write("Anti-keylogger module active!" + Environment.NewLine);
- }
- else
- {
- setColor(ConsoleColor.Red); Console.Write(Environment.NewLine + m); setColor(ConsoleColor.Yellow);
- Console.Write("Failed to initialize anti-keylogger module :(" + Environment.NewLine);
- }
- }
- catch (Exception ex)
- {
- setColor(ConsoleColor.Red); Console.Write(Environment.NewLine + m); setColor(ConsoleColor.Yellow);
- Console.Write("Failed to initialize anti-keylogger module :(" + Environment.NewLine);
- using (StreamWriter sr = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SharpEncrypter\\exception.txt", true))
- {
- sr.Write(Environment.NewLine + ex.ToString());
- sr.Dispose();
- sr.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement