File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,11 @@ def data_connect(mode = nil, nsock = self.sock)
44
44
# convert port to FTP syntax
45
45
datahost = "#{ $1} .#{ $2} .#{ $3} .#{ $4} "
46
46
dataport = ( $5. to_i * 256 ) + $6. to_i
47
- self . datasocket = Rex ::Socket ::Tcp . create ( 'PeerHost' => datahost , 'PeerPort' => dataport )
47
+ self . datasocket = Rex ::Socket ::Tcp . create (
48
+ 'PeerHost' => datahost ,
49
+ 'PeerPort' => dataport ,
50
+ 'Context' => { 'Msf' => framework , 'MsfExploit' => self }
51
+ )
48
52
end
49
53
self . datasocket
50
54
end
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def attempt_login(credential)
38
38
:Timeout => connection_timeout ,
39
39
:Retries => 2 ,
40
40
:Transport => ::SNMP ::RexUDPTransport ,
41
- :Socket => ::Rex ::Socket ::Udp . create
41
+ :Socket => ::Rex ::Socket ::Udp . create ( 'Context' => { 'Msf' => framework , 'MsfExploit' => self } )
42
42
)
43
43
44
44
result_options [ :proof ] = test_read_access ( snmp_client )
Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ def connect(global = true, opts={})
89
89
'SSL' => dossl ,
90
90
'SSLVersion' => opts [ 'SSLVersion' ] || ssl_version ,
91
91
'Proxies' => proxies ,
92
- 'Timeout' => ( opts [ 'ConnectTimeout' ] || connection_timeout || 10 ) . to_i
92
+ 'Timeout' => ( opts [ 'ConnectTimeout' ] || connection_timeout || 10 ) . to_i ,
93
+ 'Context' => { 'Msf' => framework , 'MsfExploit' => self }
93
94
)
94
95
# enable evasions on this socket
95
96
set_tcp_evasions ( nsock )
Original file line number Diff line number Diff line change @@ -83,7 +83,11 @@ def data_connect(mode = nil, nsock = self.sock)
83
83
# convert port to FTP syntax
84
84
datahost = "#{ $1} .#{ $2} .#{ $3} .#{ $4} "
85
85
dataport = ( $5. to_i * 256 ) + $6. to_i
86
- self . datasocket = Rex ::Socket ::Tcp . create ( 'PeerHost' => datahost , 'PeerPort' => dataport )
86
+ self . datasocket = Rex ::Socket ::Tcp . create (
87
+ 'PeerHost' => datahost ,
88
+ 'PeerPort' => dataport ,
89
+ 'Context' => { 'Msf' => framework , 'MsfExploit' => self }
90
+ )
87
91
end
88
92
self . datasocket
89
93
end
You can’t perform that action at this time.
0 commit comments