@@ -40,9 +40,8 @@ def initialize
40
40
[
41
41
OptAddress . new ( 'SAPROUTER_HOST' , [ true , 'SAPRouter address' , '' ] ) ,
42
42
OptPort . new ( 'SAPROUTER_PORT' , [ true , 'SAPRouter TCP port' , '3299' ] ) ,
43
- OptEnum . new ( 'MODE' , [ true , 'Connection Mode: 0 for NI_MSG_IO (SAP), 1 for NI_RAW_IO ( TCP), 2 for NI_ROUT_IO (ROUTER) ' , 0 , [ 0 , 1 , 2 ] ] ) ,
43
+ OptEnum . new ( 'MODE' , [ true , 'Connection Mode: SAP_PROTO or TCP ' , 'SAP_PROTO' , [ 'SAP_PROTO' , 'TCP' ] ] ) ,
44
44
OptString . new ( 'PORTS' , [ true , 'Ports to scan (e.g. 22-25,80,110-900)' , '3200-3299' ] ) ,
45
- OptInt . new ( 'TIMEOUT' , [ true , 'The socket connect timeout in milliseconds' , 1000 ] ) ,
46
45
OptInt . new ( 'CONCURRENCY' , [ true , 'The number of concurrent ports to check per host' , 10 ] ) ,
47
46
] , self . class )
48
47
@@ -52,7 +51,8 @@ def initialize
52
51
53
52
def build_ni_packet ( routes )
54
53
55
- mode = datastore [ 'MODE' ] . to_i
54
+ mode = { 'SAP_PROTO' => 0 , 'TCP' => 1 } [ datastore [ 'MODE' ] ]
55
+
56
56
route_data = ''
57
57
ni_packet = [
58
58
'NI_ROUTE' ,
@@ -115,7 +115,6 @@ def parse_response_packet(response, ip, port)
115
115
116
116
def run_host ( ip )
117
117
118
- timeout = datastore [ 'TIMEOUT' ] . to_i
119
118
ports = Rex ::Socket . portspec_crack ( datastore [ 'PORTS' ] )
120
119
121
120
sap_host = datastore [ 'SAPROUTER_HOST' ]
@@ -147,8 +146,7 @@ def run_host(ip)
147
146
s = connect ( false ,
148
147
{
149
148
'RPORT' => sap_port ,
150
- 'RHOST' => sap_host ,
151
- 'ConnectTimeout' => ( timeout / 1000.0 )
149
+ 'RHOST' => sap_host
152
150
}
153
151
)
154
152
0 commit comments