Skip to content

Commit

Permalink
change some print_status to print_error, rename a few msft modules us…
Browse files Browse the repository at this point in the history
…ing msb convention

git-svn-id: file:///home/svn/framework3/trunk@9929 4d416f70-5f16-0410-b530-b9f4589650da
  • Loading branch information
jduck committed Jul 25, 2010
1 parent 09b73b5 commit f6033b9
Show file tree
Hide file tree
Showing 61 changed files with 219 additions and 225 deletions.
4 changes: 2 additions & 2 deletions modules/auxiliary/admin/backupexec/registry.rb
Expand Up @@ -91,7 +91,7 @@ def cmd_regread(*args)
if (data)
print_status("DATA: #{deunicode(data)}")
else
print_status("Failed to read #{hive}\\#{subkey}\\#{subval}...")
print_error("Failed to read #{hive}\\#{subkey}\\#{subval}...")
end

end
Expand All @@ -111,7 +111,7 @@ def cmd_regenum(*args)
if (data)
print_status("DATA: #{deunicode(data)}")
else
print_status("Failed to enumerate #{hive}\\#{subkey}...")
print_error("Failed to enumerate #{hive}\\#{subkey}...")
end

end
Expand Down
4 changes: 2 additions & 2 deletions modules/auxiliary/admin/postgres/postgres_readfile.rb
Expand Up @@ -60,10 +60,10 @@ def run
case ret[:sql_error]
when /^C58P01/
print_error "#{rhost}:#{rport} Postgres - No such file or directory."
print_status "#{rhost}:#{rport} Posgres - #{ret[:sql_error]}" if verbose
print_status "#{rhost}:#{rport} Postgres - #{ret[:sql_error]}" if verbose
when /^C42501/
print_error "#{rhost}:#{rport} Postgres - Insufficent file permissions."
print_status "#{rhost}:#{rport} Posgres - #{ret[:sql_error]}" if verbose
print_status "#{rhost}:#{rport} Postgres - #{ret[:sql_error]}" if verbose
else
print_error "#{rhost}:#{rport} Postgres - #{ret[:sql_error]}"
end
Expand Down
24 changes: 12 additions & 12 deletions modules/auxiliary/admin/serverprotect/file.rb
Expand Up @@ -126,14 +126,14 @@ def cmd_list(*args)
return if not resp

if resp.length != 0x108
print_status("An unknown error occured while calling FindFirstFile.")
print_error("An unknown error occured while calling FindFirstFile.")
return
end


ret, = resp[0x104,4].unpack('V')
if ret != 0
print_status("An error occurred while calling FindFirstFile #{args[0]}: #{ret}.")
print_error("An error occurred while calling FindFirstFile #{args[0]}: #{ret}.")
return
end

Expand All @@ -151,7 +151,7 @@ def cmd_list(*args)
return if not resp

if resp.length != 0x108
print_status("An unknown error occured while calling FindFirstFile.")
print_error("An unknown error occured while calling FindFirstFile.")
break
end

Expand Down Expand Up @@ -188,7 +188,7 @@ def cmd_delete(*args)
if ret == 0
print_status("File #{args[0]} successfuly deleted.")
else
print_status("An error occurred while deleting #{args[0]}: #{ret}.")
print_error("An error occurred while deleting #{args[0]}: #{ret}.")
end
end

Expand Down Expand Up @@ -271,14 +271,14 @@ def serverprotect_createfile(file, desiredaccess, sharemode, creationdisposition
return if not resp

if (resp.length < 548)
print_status("An unknown error occurred while calling CreateFile.")
print_error("An unknown error occurred while calling CreateFile.")
return 0
else
handle, = resp[4,4].unpack('V')
ret, = resp[544,4].unpack('V')

if ret != 0
print_status("An error occured while calling CreateFile: #{ret}.")
print_error("An error occured while calling CreateFile: #{ret}.")
return 0
else
return handle
Expand All @@ -295,13 +295,13 @@ def serverprotect_readfile(handle)
return if not resp

if (resp.length != 4112)
print_status("An unknown error occurred while calling ReadFile.")
print_error("An unknown error occurred while calling ReadFile.")
return ''
else
ret, = resp[4108,4].unpack('V')

if ret != 0
print_status("An error occured while calling CreateFile: #{ret}.")
print_error("An error occured while calling CreateFile: #{ret}.")
return ''
else
br, = resp[4104, 4].unpack('V')
Expand All @@ -321,13 +321,13 @@ def serverprotect_writefile(handle, buf)
return if not resp

if (resp.length != 4112)
print_status("An unknown error occurred while calling WriteFile.")
print_error("An unknown error occurred while calling WriteFile.")
return 0
else
ret, = resp[4108,4].unpack('V')

if ret != 0
print_status("An error occured while calling WriteFile: #{ret}.")
print_error("An error occured while calling WriteFile: #{ret}.")
return 0
end
end
Expand All @@ -343,12 +343,12 @@ def serverprotect_closehandle(handle)
return if not resp

if (resp.length != 12)
print_status("An unknown error occurred while calling CloseHandle.")
print_error("An unknown error occurred while calling CloseHandle.")
else
ret, = resp[8,4].unpack('V')

if ret != 0
print_status("An error occured while calling CloseHandle: #{ret}.")
print_error("An error occured while calling CloseHandle: #{ret}.")
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions modules/auxiliary/dos/wifi/cts_rts_flood.rb
Expand Up @@ -41,15 +41,15 @@ def run
case datastore['TYPE'].upcase
when 'RTS'
if (!datastore['ADDR_SRC'])
print_status("FAILED: RTS Flood selected but ADDR_SRC not set!")
print_error("FAILED: RTS Flood selected but ADDR_SRC not set!")
return
end
frame = create_rts()
when 'CTS'

frame =create_cts()
frame = create_cts()
else
print_status("No TYPE selected!!")
print_error("No TYPE selected!!")
return
end

Expand Down
6 changes: 3 additions & 3 deletions modules/auxiliary/dos/windows/smb/ms06_035_mailslot.rb
Expand Up @@ -85,11 +85,11 @@ def run
rescue ::Exception => e

if (i == 1)
print_status("Failed to write any data to the mailslot: #{e}")
print_error("Failed to write any data to the mailslot: #{e}")
break
end
print_status("Exception occurred on interation #{i}")
print_status("Error: #{e.class} > #{e}")
print_error("Exception occurred on interation #{i}")
print_error("Error: #{e.class} > #{e}")
break
end
end
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/dos/windows/smb/ms06_063_trans.rb
Expand Up @@ -64,7 +64,7 @@ def run
return

rescue ::Exception => e
print_status("Error: #{e.class} > #{e}")
print_error("Error: #{e.class} > #{e}")
end


Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/dos/windows/smb/vista_negotiate_stop.rb
Expand Up @@ -67,7 +67,7 @@ def run
raise $!

rescue ::Exception
print_status("Error at iteration #{i}: #{$!.class} #{$!}")
print_error("Error at iteration #{i}: #{$!.class} #{$!}")
return
end

Expand Down
4 changes: 2 additions & 2 deletions modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb
Expand Up @@ -104,7 +104,7 @@ def process_phase(phase_num, phase_name, prepend = '', initial_cmds = [])
print_status("System does not respond - exiting now\n")
return
end
print_status("Error: #{e.class} #{e} #{e.backtrace}\n")
print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
end
end
end
Expand Down Expand Up @@ -176,7 +176,7 @@ def run_host(ip)
print_status("System does not respond - exiting now\n")
return
end
print_status("Error: #{e.class} #{e} #{e.backtrace}\n")
print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
end
count += datastore['STEPSIZE']
end
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/fuzzers/smtp/smtp_fuzzer.rb
Expand Up @@ -59,7 +59,7 @@ def smtp_send(data='', con=true)
@result=sock.get_once
@codresult=@result[0..2]
rescue ::Exception => e
print_status("Error #{e}")
print_error("Error #{e}")
end
end

Expand Down
172 changes: 86 additions & 86 deletions modules/auxiliary/gather/dns_enum.rb
Expand Up @@ -321,7 +321,7 @@ def reverselkp(iprange,nssrv)
raise $!
rescue ::Rex::ConnectionError
rescue ::Exception => e
print_status("Error: #{tip}: #{e.message}")
print_error("Error: #{tip}: #{e.message}")
elog("Error running against host #{tip}: #{e.message}\n#{e.backtrace.join("\n")}")
end
end
Expand Down Expand Up @@ -382,94 +382,94 @@ def axfr(target, nssrv)
print_status("Testing Nameserver: #{nsrcd.nsdname}")
nssrvquery = @res.query(nsrcd.nsdname, "A")
begin
nssrvip = nssrvquery.answer[0].address.to_s
@res.nameserver=(nssrvip)
zone = []
zone = @res.query(target,Net::DNS::AXFR)
if zone.answer.length != 0
namesrvips = @res.query(nsrcd.nsdname,"A")
nsip = namesrvips.answer[0]
print_status("Zone Transfer Successful")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "Zone Transfer Successful")
#Prints each record according to its type
zone.answer.each do |rr|
case rr.type
when "A"
print_status("Name: #{rr.name} IP Address: #{rr.address} Record: A ")
report_note(:host => rr.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.address.to_s},#{rr.name},A")
when "SOA"
print_status("Name: #{rr.mname} Record: SOA")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.name},SOA")
when "MX"
print_status("Name: #{rr.exchange} Preference: #{rr.preference} Record: MX")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.exchange},MX")
when "CNAME"
print_status("Name: #{rr.cname} Record: CNAME")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.cname},CNAME")
when "HINFO"
print_status("CPU: #{rr.cpu} OS: #{rr.os} Record: HINFO")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "CPU:#{rr.cpu},OS:#{rr.os},HINFO")
when "AAAA"
print_status("IPv6 Address: #{rr.address} Record: AAAA")
report_note(:host => rr.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.address.to_s}, AAAA")
when "NS"
print_status("Name: #{rr.nsdname} Record: NS")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.nsdname},NS")
when "TXT"
print_status("Text: #{rr.txt} Record: TXT")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.txt},TXT")
when "SRV"
print_status("Host: #{rr.host} Port: #{rr.port} Priority: #{rr.priority} Record: SRV")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.host},#{rr.port},#{rr.priority},SRV")
nssrvip = nssrvquery.answer[0].address.to_s
@res.nameserver=(nssrvip)
zone = []
zone = @res.query(target,Net::DNS::AXFR)
if zone.answer.length != 0
namesrvips = @res.query(nsrcd.nsdname,"A")
nsip = namesrvips.answer[0]
print_status("Zone Transfer Successful")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "Zone Transfer Successful")
#Prints each record according to its type
zone.answer.each do |rr|
case rr.type
when "A"
print_status("Name: #{rr.name} IP Address: #{rr.address} Record: A ")
report_note(:host => rr.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.address.to_s},#{rr.name},A")
when "SOA"
print_status("Name: #{rr.mname} Record: SOA")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.name},SOA")
when "MX"
print_status("Name: #{rr.exchange} Preference: #{rr.preference} Record: MX")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.exchange},MX")
when "CNAME"
print_status("Name: #{rr.cname} Record: CNAME")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.cname},CNAME")
when "HINFO"
print_status("CPU: #{rr.cpu} OS: #{rr.os} Record: HINFO")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "CPU:#{rr.cpu},OS:#{rr.os},HINFO")
when "AAAA"
print_status("IPv6 Address: #{rr.address} Record: AAAA")
report_note(:host => rr.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.address.to_s}, AAAA")
when "NS"
print_status("Name: #{rr.nsdname} Record: NS")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.nsdname},NS")
when "TXT"
print_status("Text: #{rr.txt} Record: TXT")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.txt},TXT")
when "SRV"
print_status("Host: #{rr.host} Port: #{rr.port} Priority: #{rr.priority} Record: SRV")
report_note(:host => nsip.address.to_s,
:proto => 'DNS',
:port => 53 ,
:type => 'DNS_ENUM',
:data => "#{rr.host},#{rr.port},#{rr.priority},SRV")
end
end
else
print_error("Zone Transfer Failed")
end
else
print_status("Zone Transfer Failed")
end
rescue
print_status("Zone Transfer Failed")
end
rescue
print_error("Zone Transfer Failed")
end
end

else
print_error("Could not resolve domain #{target}")
Expand Down

0 comments on commit f6033b9

Please sign in to comment.