forked from fnmsd/awvs_script_decode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsocks_ping.script
More file actions
115 lines (97 loc) · 3.68 KB
/
Copy pathsocks_ping.script
File metadata and controls
115 lines (97 loc) · 3.68 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#include classSocks.inc;
#include debug_helpers.inc;
#include reporting_helpers.inc;
var testIP = '87.230.63.11';
function ping(strHost, intPort)
{
var capabilities = new Object();
var socks = new classSocks(strHost, intPort, '4');
var retval = socks.Connect(testIP, 80);
if(retval == -2 ) // cannot connect abort
return(null);
if(retval >= 0)
{
capabilities.socks4Support = true;
if(retval == 1)
capabilities.socks4SupportConnect = true;
retval = socks.Bind(testIP, 80);
if(retval == 1)
capabilities.socks4SupportBind = true;
socks.close();
}
socks = new classSocks(strHost, intPort, '5');
socks.intAutentType = 0;
retval = socks.Connect(testIP, 80);
if(retval < 0 ) return(capabilities);
capabilities.socks5Support = true;
if(retval == 1)
{
capabilities.socks5Support_Connect = true;
capabilities.socks5Support_autent_open = true;
//we van test here for the other two methods then
if(socks.Bind(testIP, 80) == 1)
capabilities.socks5Support_Bind = true;
if(socks.AssociateUDP(testIP, 80) == 1)
capabilities.socks5Support_AssociateUDP = true;
}
socks.intAutentType = 1;
retval = socks.Connect(testIP, 80);
if((retval == 0) && (socks.intConnectionStatus != 0x0b))
capabilities.socks5Support_autent_GSSAPI = true;
socks.intAutentType = 2;
retval = socks.Connect(testIP, 80);
if((retval == 0) && (socks.intConnectionStatus != 0x0b))
capabilities.socks5Support_autent_UsernamePassword = true;
socks.close();
return(capabilities);
}
if (IsPortOpen(1080)) {
//de refacut testele pentru mai multe porturi
var response = ping(ScanHost, 1080);
if(response)
{
//avem server socks vezi capabilitatile detectate in response
//response.socks5Support_autent_open => no autentification alert
//response.socks5Support_autent_UsernamePassword => clear text autentification alert (sniffing)
//socks5Support_autent_GSSAPI este recunoscut dar nu este implementat
traceObject(response);
if (response.socks5Support || response.socks4Support) {
info = "";
if (response.socks4Support) {
ReportItem("SOCKS_open.xml", "The SOCKS server is running on TCP port 1080.");
info += "Socks4 support: true\r\n";
if (response.socks4SupportConnect) {
info += "The server can establish a TCP/IP stream connection.\r\n";
}
if (response.socks4SupportBind) {
info += "The server can establish a TCP/IP port binding.\r\n";
}
}
if (response.socks5Support) {
info += "Socks5 support: true\r\n";
if (response.socks5Support_Connect) {
info += "The server can establish a TCP/IP stream connection.\r\n";
}
if (response.socks5Support_Bind) {
info += "The server can establish a TCP/IP port binding.\r\n";
}
if (response.socks5Support_AssociateUDP) {
info += "The server can associate a UDP port.\r\n";
}
if (response.socks5Support_autent_open) {
info += "The server doesn't require authentication.\r\n";
ReportItem("SOCKS_open.xml", "The SOCKS server is running on TCP port 1080.");
}
if (response.socks5Support_autent_UsernamePassword) {
info += "The server supports Username/Password authentication. ()\r\n";
info += "(All information, including passwords, is transmitted unencrypted (making it vulnerable to interception).";
}
if (response.socks5Support_autent_GSSAPI) {
info += "The server supports GSSAPI authentication.\r\n";
}
}
trace(info);
KBase("SOCKS server running", "A SOCKS server is running on TCP port 1080.[break]Server information: [pre]" + info + "[/pre]");
}
}
}