-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathForm1.cs
111 lines (102 loc) · 3.93 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HiveJack
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button9_Click(object sender, EventArgs e)
{
Process sam = new Process();
sam.StartInfo.Verb = "runas";
sam.StartInfo.FileName = "cmd.exe";
sam.StartInfo.Arguments = "/c reg.exe save hklm\\sam c:\\temp\\sam.save";
sam.StartInfo.UseShellExecute = false;
sam.StartInfo.RedirectStandardOutput = true;
sam.StartInfo.RedirectStandardError = true;
sam.Start();
//* Read the output (or the error)
string output = sam.StandardOutput.ReadToEnd();
textBox1.Text = output;
sam.WaitForExit();
}
private void button1_Click(object sender, EventArgs e)
{
Process secu = new Process();
secu.StartInfo.Verb = "runas";
secu.StartInfo.FileName = "cmd.exe";
secu.StartInfo.Arguments = "/c reg.exe save hklm\\security c:\\temp\\security.save";
secu.StartInfo.UseShellExecute = false;
secu.StartInfo.RedirectStandardOutput = true;
secu.StartInfo.RedirectStandardError = true;
secu.Start();
//* Read the output (or the error)
string output2 = secu.StandardOutput.ReadToEnd();
textBox1.Text = output2;
secu.WaitForExit();
}
private void button2_Click(object sender, EventArgs e)
{
Process syst = new Process();
syst.StartInfo.Verb = "runas";
syst.StartInfo.FileName = "cmd.exe";
syst.StartInfo.Arguments = "/c reg.exe save hklm\\system c:\\temp\\system.save";
syst.StartInfo.UseShellExecute = false;
syst.StartInfo.RedirectStandardOutput = true;
syst.StartInfo.RedirectStandardError = true;
syst.Start();
//* Read the output (or the error)
string output3 = syst.StandardOutput.ReadToEnd();
textBox1.Text = output3;
syst.WaitForExit();
}
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
private void button4_Click(object sender, EventArgs e)
{
Process cle = new Process();
cle.StartInfo.Verb = "runas";
cle.StartInfo.FileName = "cmd.exe";
cle.StartInfo.Arguments = "/c DEL /S /Q c:\\temp\\*.save";
cle.StartInfo.UseShellExecute = false;
cle.StartInfo.RedirectStandardOutput = true;
cle.StartInfo.RedirectStandardError = true;
cle.Start();
//* Read the output (or the error)
string output4 = cle.StandardOutput.ReadToEnd();
textBox1.Text = output4;
cle.WaitForExit();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
Process op1 = new Process();
op1.StartInfo.Verb = "runas";
op1.StartInfo.FileName = "cmd.exe";
op1.StartInfo.Arguments = "/c start c:\\temp\\";
op1.StartInfo.UseShellExecute = false;
op1.StartInfo.RedirectStandardOutput = true;
op1.StartInfo.RedirectStandardError = true;
op1.Start();
//* Read the output (or the error)
string output5 = op1.StandardOutput.ReadToEnd();
textBox1.Text = output5;
op1.WaitForExit();
}
}
}