Skip to content

Commit 90eccef

Browse files
author
HD Moore
committed
Fix sock.get use and some minor bugs
1 parent baa877e commit 90eccef

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

modules/auxiliary/admin/oracle/sid_brute.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ def run
4141

4242
print_status("Starting brute force on #{rhost}, using sids from #{list}...")
4343

44-
fd = File.open(list, 'rb').each do |sid|
44+
fd = ::File.open(list, 'rb').each do |sid|
4545
login = "(DESCRIPTION=(CONNECT_DATA=(SID=#{sid})(CID=(PROGRAM=)(HOST=MSF)(USER=)))(ADDRESS=(PROTOCOL=tcp)(HOST=#{rhost})(PORT=#{rport})))"
4646
pkt = tns_packet(login)
4747

4848
begin
4949
connect
50+
rescue ::Interrupt
51+
raise $!
5052
rescue => e
5153
print_error(e.to_s)
5254
disconnect
@@ -55,12 +57,10 @@ def run
5557

5658
sock.put(pkt)
5759
select(nil,nil,nil,s.to_i)
58-
res = sock.get_once(-1,3)
60+
res = sock.get_once
5961
disconnect
6062

61-
if ( res and res =~ /ERROR_STACK/ )
62-
''
63-
else
63+
if res and res.to_s !~ /ERROR_STACK/
6464
report_note(
6565
:host => rhost,
6666
:port => rport,
@@ -70,6 +70,7 @@ def run
7070
)
7171
print_good("#{rhost}:#{rport} Found SID '#{sid.strip}'")
7272
end
73+
7374
end
7475

7576
print_status("Done with brute force...")

0 commit comments

Comments
 (0)