-
Notifications
You must be signed in to change notification settings - Fork 0
/
eyes.h
191 lines (160 loc) · 4.19 KB
/
eyes.h
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EYES_H
#define EYES_H
#endif
using namespace std;
/************
* Variables *
************/
const char *banner =
" _____\n"
" | ___|\n"
" | |__ _ _ ___ ___\n"
" | __| | | |/ _ \\/ __|\n"
" | |__| |_| | __/\\__ \\\n"
" \\____/\\__, |\\___||___/ v0.0.18\n"
" __/ | Now made with C++!\n"
" |____/\n";
const char *menu =
"1. Whois Lookup\n"
"2. DNS Lookup + CloudFlare detector\n"
"3. Zone Transfer\n"
"4. Port Scan\n"
"5. HTTP Header Grabber\n"
"6. Honeypot Detector\n"
"7. Robots.txt Scanner\n"
"8. Link Grabber\n"
"9. IP Location Finder\n"
"10. Traceroute\n"
"11. Domain-to-IP Lookup\n"
"12. About program\n"
"13. Exit program\n";
/************
* Functions *
************/
void handler(int sig) {
cout << "\nBye" << endl;
exit(0);
}
std::string get_info(std::string url) {
auto r = cpr::Get(cpr::Url{url});
if (r.status_code >= 400)
{
std::string err = "\nSomething went wrong.\n";
return err;
}
else
{
return r.text;
}
}
void eyes() {
std::string choice;
std::string resp;
std::string target;
std::ostringstream url;
cout << menu << endl;
cout << "What do you want to do? ";
cin >> choice;
if (choice == "1")
{
cout << "Enter a domain or IP address: ";
cin >> target;
url << "http://api.hackertarget.com/whois/?q=" << target;
resp = get_info(url.str());
cout << resp << endl;
eyes();
}
else if (choice == "3")
{
cout << "Enter a domain or IP address: ";
cin >> target;
url << "http://api.hackertarget.com/zonetransfer/?q=" << target;
resp = get_info(url.str());
cout << resp << endl;
eyes();
}
else if (choice == "4")
{
cout << "Enter a domain or IP address: ";
cin >> target;
url << "http://api.hackertarget.com/nmap/?q=" << target;
resp = get_info(url.str());
cout << resp << endl;
eyes();
}
else if (choice == "5")
{
cout << "Enter a domain or IP address: ";
cin >> target;
url << "http://api.hackertarget.com/httpheaders/?q=" << target;
resp = get_info(url.str());
cout << resp << endl;
eyes();
}
else if (choice == "7")
{
cout << "This feature makes a direct call to the target -- would you like to continuye? [Y/n] ";
cin >> choice;
if (choice == "y")
{
cout << "Enter domain (without protocol): ";
cin >> target;
url << "http://" << target << "/robots.txt";
resp = get_info(url.str());
cout << resp << endl << endl;
eyes();
}
else if (choice == "n")
{
cout << "Going back to menu..." << endl << endl;
eyes();
}
else
{
cout << "Your choice is invalid." << endl << endl;
eyes();
}
}
else if (choice == "9")
{
cout << "Enter IP address: ";
cin >> target;
url << "http://ipinfo.io/" << target << "/geo";
resp = get_info(url.str());
cout << resp << endl << endl;
eyes();
}
else if (choice == "10")
{
cout << "Enter a domain or IP address: ";
cin >> target;
url << "https://api.hackertarget.com/mtr/?q=" << target;
resp = get_info(url.str());
cout << resp << endl;
eyes();
}
else if (choice == "12")
{
cout << "This program was created by Noah Altunian, and was adapted ";
cout << "from github.com/naltun/eyes.sh. It is licensed under the ";
cout << "terms of the MPL v. 2.0.\n" << endl;
eyes();
}
else if (choice == "13")
{
cout << "Bye" << endl;
exit(0);
}
else
{
cout << "Your choice is invalid.\n" << endl;
eyes();
}
}
void run() {
cout << banner << endl;
eyes();
}