-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgprobe.cpp
More file actions
97 lines (79 loc) · 1.69 KB
/
gprobe.cpp
File metadata and controls
97 lines (79 loc) · 1.69 KB
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
#include <iostream>
#include <cstring>
#include <vector>
#include <sys/types.h>
#include <sys/socket.h>
#include "arguments.h"
#include "CPingSweep.h"
using namespace std;
void displayParamPage();
int scanMode = 0;
vector<string> scanOptions;
string target;
int main(int argc, char* argv[]) {
if (argc == 1) {
displayParamPage();
return 1;
}
// Check scan mode
if (argc >= 2)
{
// Check for ping sweep
if (strcmp(argv[1], "-swp") == 0)
{
scanMode = 1;
}
// Check for FIN scan
if (strcmp(argv[1], "-fin") == 0)
{
scanMode = 2;
}
}
// Check for scan parameters
if (argc >= 4)
{
for (int i = 2; i < argc - 1; i++)
{
scanOptions.push_back(argv[i]);
}
}
// Check for scan target
if (argc >= 3)
{
target = argv[argc - 1];
}
if (scanMode == 1)
{
cout << "Invoking ping sweep on target " << target << endl;
cout << "scan options are: ";
for (int i = 0; i < scanOptions.size(); i++)
{
cout << scanOptions[i] << " ";
}
cout << endl;
cout << endl;
CPingSweep ps(scanOptions, target);
ps.scan();
}
//checkArguments(argc, argv);
return 0;
}
void displayParamPage()
{
cout << "GProbe 0.1" << endl;
cout << "Written by A. Gasser 2011" << endl;
cout << "-------------------------" << endl;
cout << "" << endl;
cout << "gprobe [scan type] [options] [target]" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "SCAN TYPES" << endl;
cout << " -swp Perform a ICMP ping sweep" << endl;
cout << " -fin Perform A TCP FIN scan" << endl;
cout << "" << endl;
cout << "OPTIONS" << endl;
cout << " None at this time" << endl;
cout << "" << endl;
cout << "TARGET" << endl;
cout << " CIDR Subnet or single IP" << endl;
}