File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
modules/auxiliary/scanner/smb Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def run_host(ip)
41
41
if session
42
42
print_status ( "Using existing session #{ session . sid } " )
43
43
client = session . client
44
- datastore [ 'RPORT' ] = session . port
44
+ @rport = datastore [ 'RPORT' ] = session . port
45
45
self . simple = ::Rex ::Proto ::SMB ::SimpleClient . new ( client . dispatcher . tcp_socket , client : client )
46
46
self . simple . connect ( "\\ \\ #{ session . address } \\ IPC$" )
47
47
pipes += check_pipes
@@ -66,14 +66,25 @@ def run_host(ip)
66
66
smb_login
67
67
pipes += check_pipes
68
68
disconnect
69
- break
69
+ report_pipes ( pipes )
70
70
rescue Rex ::Proto ::SMB ::Exceptions ::SimpleClientError , Rex ::ConnectionError => e
71
71
vprint_error ( "SMB client Error with RPORT=#{ @rport } SMBDirect=#{ @smb_direct } : #{ e . to_s } " )
72
72
end
73
73
74
74
end
75
75
end
76
76
77
+ end
78
+
79
+ def check_pipes
80
+ pipes = [ ]
81
+ check_named_pipes . each do |pipe_name , _ |
82
+ pipes . push ( pipe_name )
83
+ end
84
+ pipes
85
+ end
86
+
87
+ def report_pipes ( pipes )
77
88
if ( pipes . length > 0 )
78
89
print_good ( "Pipes: #{ pipes . join ( ", " ) } " )
79
90
# Add Report
@@ -88,11 +99,4 @@ def run_host(ip)
88
99
end
89
100
end
90
101
91
- def check_pipes
92
- pipes = [ ]
93
- check_named_pipes . each do |pipe_name , _ |
94
- pipes . push ( pipe_name )
95
- end
96
- pipes
97
- end
98
102
end
You can’t perform that action at this time.
0 commit comments