-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.cpp
159 lines (148 loc) · 4.72 KB
/
menu.cpp
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#include "menu.h"
#include <iostream>
#include "command.h"
void menu::MainMenu()
{
command c;
while (true)
{
std::cout << "\e[8;15;100t";
system("clear");
HelpMenu();
std::string what;
std::cout << " $ : ";
std::cin >> what;
// ScanCheck
if (what == "1" || what == "-sT")
{
c.scan = "-sT ";
}
else if (what == "2" || what == "-sS")
{
c.scan = "-sS ";
}
else if (what == "3" || what == "-sP")
{
c.scan = "-sP ";
}
else if (what == "4" || what == "-sU")
{
c.scan = "-sU ";
}
// ArgCheck
else if (what == "1a" || what == "1A" || what == "-sV")
{
c.arg += "-sV ";
}
else if (what == "2a" || what == "2A" || what == "-A")
{
c.arg += "-A ";
}
else if (what == "5a" || what == "5A" || what == "--open")
{
c.arg += "--open ";
}
else if (what == "6a" || what == "6A")
{
std::string whatP;
std::cout << " Format (txt,xml,all): ";
std::cin >> whatP;
if (whatP == "txt")
{
std::string FileName;
std::cout << " FileName: ";
std::cin >> FileName;
c.arg += "-oN " + FileName + "." + whatP + " ";
}
else if (whatP == "xml")
{
std::string FileName;
std::cout << " FileName: ";
std::cin >> FileName;
c.arg += "-oX " + FileName + "." + whatP + " ";
}
else if (whatP == "all")
{
std::string FileName;
std::cout << " FileName: ";
std::cin >> FileName;
c.arg += "-oA " + FileName + " ";
}
}
else if (what == "7a" || what == "5A" || what == "--open")
{
std::string FileName;
std::cout << " FileName: ";
std::cin >> FileName;
c.arg += "-iL " + FileName + " ";
}
// ExampleCheck
else if (what == "max" || what == "MAX")
{
c.scan = "";
c.arg = "-n -T5 ";
}
else if (what == "info" || what == "INFO")
{
c.scan = "";
c.arg = "-v -A -sV -p \"*\" ";
}
// CommandCheck
else if (what == "run" || what == "RUN")
{
std::cout << " \033[92mCreated by lomaster\033[0m";
break;
}
else if (what == "clear" || what == "CLEAR")
{
c.scan = "";
c.arg = "";
c.target = "";
}
else if (what == "3a" || what == "3A" || what == "-p")
{
std::string whatP;
std::cout << " Ports: ";
std::cin >> whatP;
c.arg += "-p " + whatP + " ";
}
else if (what == "4a" || what == "4A" || what == "-T")
{
std::string whatP;
std::cout << " Count (1-5): ";
std::cin >> whatP;
c.arg += "-T" + whatP + " ";
}
else if (what == "sudo" || what == "SUDO")
{
c.run = c.sudo + c.run;
}
else
{
c.target = what;
}
std::cout << "\033[0;33m Command:\033[92m " << c.commandInit();
}
std::cout << "\n";
std::string result = c.commandInit();
std::cout << "\e[8;40;100t";
system(result.c_str());
std::string resume;
std::cout << "\n\033[0;33mEnter 1 to continue...\033[0m";
std::cin >> resume;
if (resume == "1"){
MainMenu();
}
}
void menu::HelpMenu()
{
std::cout << "\n\n";
std::cout << " \033[0;33mScaning Arguments Commands Example\n ";
std::cout << " \033[92m[1]\033[0m TCP scan: -sT \033[92m[1a]\033[0m Software host: -sV \033[92m[run]\033[0m StartScan \033[92m[max]\033[0m MaxSpeed\n";
std::cout << " \033[92m[2]\033[0m SYN scan: -sS \033[92m[2a]\033[0m Aggressive info: -A \033[92m[sudo]\033[0m AdminScan \033[92m[info]\033[0m MaxInfo\n";
std::cout << " \033[92m[3]\033[0m Ping scan: -sP \033[92m[3a]\033[0m Insert ports: -p \033[92m[clear]\033[0m Clear\n";
std::cout << " \033[92m[4]\033[0m UDP scan: -sU \033[92m[4a]\033[0m Time sample: -T \033[92m[ ]\033[0m SelectTarget\n";
std::cout << " \033[92m[5a]\033[0m OnlyOpen: --open\n";
std::cout << " \033[92m[6a]\033[0m FileSave: -oN,oX,oA\n";
std::cout << " \033[92m[7a]\033[0m TargetsFromFile: -iL\n";
}