-
Notifications
You must be signed in to change notification settings - Fork 0
/
honeyScore.cpp
76 lines (56 loc) · 2.14 KB
/
honeyScore.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
#include <iostream>
#include <fstream>
using namespace std;
void getSize(string);
int main (int argc, const char *argv[])
{
system("clear");
system("");
system("tput setaf 6; echo '███████╗██╗ ██╗ ██████╗ ████████╗██╗███████╗ ██████╗ '");
system("echo '██╔════╝██║ ██╔╝██╔═══██╗╚══██╔══╝██║╚══███╔╝██╔═══██╗'");
system("echo '███████╗█████╔╝ ██║ ██║ ██║ ██║ ███╔╝ ██║ ██║'");
system("echo '╚════██║██╔═██╗ ██║ ██║ ██║ ██║ ███╔╝ ██║ ██║'");
system("echo '███████║██║ ██╗╚██████╔╝ ██║ ██║███████╗╚██████╔╝'");
system("echo '╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ '");
system("tput sgr0; echo");
system("echo 'Scan a list of IPs for honeypots\n'");
cout << "USAGE : " << argv[0] << " ipList.txt > results.txt" << endl;
system("echo '------------------------------------------------------'");
string ip,raw;
if(argv[1]==nullptr)
{
return 0;
}
string filename = argv[1];
getSize(filename);
ifstream infile;
infile.open(filename,ios::in);
while(infile)
{
infile >> ip;
cout << "Result for " << ip <<endl;
raw = "shodan honeyscore " + ip + " && echo";
system(raw.c_str());
}
return 0;
}
void getSize(string filename)
{
ifstream infile(filename, ios::binary);
string buffer;
int i = 0;
while(infile)
{
infile >> buffer;
i++;
}
buffer = "";
cout << "File: " << filename << endl;
cout << "Number of hosts: " << i << " IP addresses" << endl;
system("echo '------------------------------------------------------\n'");
if(i==0)
{
cout << "The file entered is nonexistant or empty" << endl << endl;
}
return;
}