diff --git a/data/exploits/capture/http/forms/extractforms.rb b/data/exploits/capture/http/forms/extractforms.rb
index 5602413b13..68d64581cc 100755
--- a/data/exploits/capture/http/forms/extractforms.rb
+++ b/data/exploits/capture/http/forms/extractforms.rb
@@ -15,8 +15,8 @@ require 'open-uri'
require 'timeout'
def usage
- $stderr.puts "#{$0} [site list] [output-dir]"
- exit(0)
+ $stderr.puts "#{$0} [site list] [output-dir]"
+ exit(0)
end
input = ARGV.shift() || usage()
@@ -25,32 +25,32 @@ res = ""
doc = Hpricot(File.open(input))
doc.search("//form").each do |form|
- # Extract the form
- res = "
"
+ res << inp.to_html
+ end
+ res << ""
end
$stdout.puts res
diff --git a/data/exploits/capture/http/forms/grabforms.rb b/data/exploits/capture/http/forms/grabforms.rb
index 48438163d7..98a6e3400a 100755
--- a/data/exploits/capture/http/forms/grabforms.rb
+++ b/data/exploits/capture/http/forms/grabforms.rb
@@ -15,72 +15,72 @@ require 'open-uri'
require 'timeout'
def usage
- $stderr.puts "#{$0} [site list] [output-dir]"
- exit(0)
+ $stderr.puts "#{$0} [site list] [output-dir]"
+ exit(0)
end
sitelist = ARGV.shift() || usage()
output = ARGV.shift() || usage()
File.readlines(sitelist).each do |site|
- site.strip!
- next if site.length == 0
- next if site =~ /^#/
-
- out = File.join(output, site + ".txt")
- File.unlink(out) if File.exists?(out)
-
- fd = File.open(out, "a")
-
+ site.strip!
+ next if site.length == 0
+ next if site =~ /^#/
+
+ out = File.join(output, site + ".txt")
+ File.unlink(out) if File.exists?(out)
+
+ fd = File.open(out, "a")
+
- ["", "www."].each do |prefix|
- begin
- Timeout.timeout(10) do
- doc = Hpricot(open("http://#{prefix}#{site}/"))
- doc.search("//form").each do |form|
+ ["", "www."].each do |prefix|
+ begin
+ Timeout.timeout(10) do
+ doc = Hpricot(open("http://#{prefix}#{site}/"))
+ doc.search("//form").each do |form|
- # Extract the form
- res = ""
+ res << inp.to_html
+ end
+ res << ""
- fd.write(res)
- end
- end
- break
- rescue ::Timeout::Error
- $stderr.puts "#{prefix}#{site} timed out"
- rescue ::Interrupt
- raise $!
- rescue ::Exception => e
- $stderr.puts "#{prefix}#{site} #{e.class} #{e}"
- end
- end
-
- fd.close
-
- File.unlink(out) if (File.size(out) == 0)
+ fd.write(res)
+ end
+ end
+ break
+ rescue ::Timeout::Error
+ $stderr.puts "#{prefix}#{site} timed out"
+ rescue ::Interrupt
+ raise $!
+ rescue ::Exception => e
+ $stderr.puts "#{prefix}#{site} #{e.class} #{e}"
+ end
+ end
+
+ fd.close
+
+ File.unlink(out) if (File.size(out) == 0)
end
diff --git a/data/exploits/psnuffle/ftp.rb b/data/exploits/psnuffle/ftp.rb
index 5016f14811..d875d316b3 100755
--- a/data/exploits/psnuffle/ftp.rb
+++ b/data/exploits/psnuffle/ftp.rb
@@ -8,71 +8,71 @@
class SnifferFTP < BaseProtocolParser
- def register_sigs
- self.sigs = {
- :banner => /^(220\s*[^\r\n]+)/i,
- :user => /^USER\s+([^\s]+)/i,
- :pass => /^PASS\s+([^\s]+)/i,
- :login_pass => /^(230\s*[^\n]+)/i,
- :login_fail => /^(5\d\d\s*[^\n]+)/i,
- :bye => /^221/
- }
- end
+ def register_sigs
+ self.sigs = {
+ :banner => /^(220\s*[^\r\n]+)/i,
+ :user => /^USER\s+([^\s]+)/i,
+ :pass => /^PASS\s+([^\s]+)/i,
+ :login_pass => /^(230\s*[^\n]+)/i,
+ :login_fail => /^(5\d\d\s*[^\n]+)/i,
+ :bye => /^221/
+ }
+ end
- def parse(pkt)
- # We want to return immediatly if we do not have a packet which is handled by us
- return unless pkt.is_tcp?
- return if (pkt.tcp_sport != 21 and pkt.tcp_dport != 21)
- s = find_session((pkt.tcp_sport == 21) ? get_session_src(pkt) : get_session_dst(pkt))
- s[:sname] ||= "ftp"
+ def parse(pkt)
+ # We want to return immediatly if we do not have a packet which is handled by us
+ return unless pkt.is_tcp?
+ return if (pkt.tcp_sport != 21 and pkt.tcp_dport != 21)
+ s = find_session((pkt.tcp_sport == 21) ? get_session_src(pkt) : get_session_dst(pkt))
+ s[:sname] ||= "ftp"
- self.sigs.each_key do |k|
- # There is only one pattern per run to test
- matched = nil
- matches = nil
+ self.sigs.each_key do |k|
+ # There is only one pattern per run to test
+ matched = nil
+ matches = nil
- if(pkt.payload =~ self.sigs[k])
- matched = k
- matches = $1
- end
+ if(pkt.payload =~ self.sigs[k])
+ matched = k
+ matches = $1
+ end
- case matched
+ case matched
- when :login_fail
- if(s[:user] and s[:pass])
- report_auth_info(s.merge({:active => false}))
- print_status("Failed FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
+ when :login_fail
+ if(s[:user] and s[:pass])
+ report_auth_info(s.merge({:active => false}))
+ print_status("Failed FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
- s[:pass] = ""
- return
- end
+ s[:pass] = ""
+ return
+ end
- when :login_pass
- if(s[:user] and s[:pass])
- report_auth_info(s)
- print_status("Successful FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
- # Remove it form the session objects so freeup memory
- sessions.delete(s[:session])
- return
- end
+ when :login_pass
+ if(s[:user] and s[:pass])
+ report_auth_info(s)
+ print_status("Successful FTP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]}")
+ # Remove it form the session objects so freeup memory
+ sessions.delete(s[:session])
+ return
+ end
- when :banner
- # Because some ftp server send multiple banner we take only the first one and ignore the rest
- if not (s[:info])
- s[:info] = matches
- report_service(s)
- end
+ when :banner
+ # Because some ftp server send multiple banner we take only the first one and ignore the rest
+ if not (s[:info])
+ s[:info] = matches
+ report_service(s)
+ end
- when :bye
- sessions.delete(s[:session])
+ when :bye
+ sessions.delete(s[:session])
- when nil
- # No matches, no saved state
- else
- sessions[s[:session]].merge!({k => matches})
- end # end case matched
+ when nil
+ # No matches, no saved state
+ else
+ sessions[s[:session]].merge!({k => matches})
+ end # end case matched
- end # end of each_key
- end # end of parse
+ end # end of each_key
+ end # end of parse
end
diff --git a/data/exploits/psnuffle/imap.rb b/data/exploits/psnuffle/imap.rb
index 6888fb4246..4023be12b0 100755
--- a/data/exploits/psnuffle/imap.rb
+++ b/data/exploits/psnuffle/imap.rb
@@ -9,72 +9,72 @@
class SnifferIMAP < BaseProtocolParser
- def register_sigs
- self.sigs = {
- :banner => /^(\*\s+OK[^\n\r]*)/i,
- :login => /^CAPABILITY\s+LOGIN\s+([^\s]+)\s+([^\n\r]+)/i,
- :login_pass => /^CAPABILITY\s+OK\s+(Login[^\n\r]*)/i,
- :login_bad => /^CAPABILITY\s+BAD\s+(Login[^\n\r]*)/i,
- :login_fail => /^CAPABILITY\s+NO\s+(Login[^\n\r]*)/i
- }
- end
+ def register_sigs
+ self.sigs = {
+ :banner => /^(\*\s+OK[^\n\r]*)/i,
+ :login => /^CAPABILITY\s+LOGIN\s+([^\s]+)\s+([^\n\r]+)/i,
+ :login_pass => /^CAPABILITY\s+OK\s+(Login[^\n\r]*)/i,
+ :login_bad => /^CAPABILITY\s+BAD\s+(Login[^\n\r]*)/i,
+ :login_fail => /^CAPABILITY\s+NO\s+(Login[^\n\r]*)/i
+ }
+ end
- def parse(pkt)
+ def parse(pkt)
- # We want to return immediatly if we do not have a packet which is handled by us
- return unless pkt.is_tcp?
- return if (pkt.tcp_sport != 143 and pkt.tcp_dport != 143)
- s = find_session((pkt.tcp_sport == 143) ? get_session_src(pkt) : get_session_dst(pkt))
- s[:sname] ||= "imap4"
+ # We want to return immediatly if we do not have a packet which is handled by us
+ return unless pkt.is_tcp?
+ return if (pkt.tcp_sport != 143 and pkt.tcp_dport != 143)
+ s = find_session((pkt.tcp_sport == 143) ? get_session_src(pkt) : get_session_dst(pkt))
+ s[:sname] ||= "imap4"
- self.sigs.each_key do |k|
- # There is only one pattern per run to test
- matched = nil
- matches = nil
+ self.sigs.each_key do |k|
+ # There is only one pattern per run to test
+ matched = nil
+ matches = nil
- if (pkt.payload =~ self.sigs[k])
- matched = k
- matches = [$1,$2]
- end
+ if (pkt.payload =~ self.sigs[k])
+ matched = k
+ matches = [$1,$2]
+ end
- case matched
- when :banner
- s[:info] = matches
- report_service(s)
+ case matched
+ when :banner
+ s[:info] = matches
+ report_service(s)
- when :login_pass
+ when :login_pass
- report_auth_info(s)
- print_status("Successful IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
+ report_auth_info(s)
+ print_status("Successful IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
- # Remove it form the session objects so freeup
- sessions.delete(s[:session])
+ # Remove it form the session objects so freeup
+ sessions.delete(s[:session])
- when :login_fail
+ when :login_fail
- report_auth_info(s.merge({:active => false}))
- print_status("Failed IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
+ report_auth_info(s.merge({:active => false}))
+ print_status("Failed IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
- # Remove it form the session objects so freeup
- sessions.delete(s[:session])
+ # Remove it form the session objects so freeup
+ sessions.delete(s[:session])
- when :login_bad
- report_auth_info(s.merge({:active => false}))
- print_status("Bad IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
+ when :login_bad
+ report_auth_info(s.merge({:active => false}))
+ print_status("Bad IMAP Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
- # Remove it form the session objects so freeup
- sessions.delete(s[:session])
+ # Remove it form the session objects so freeup
+ sessions.delete(s[:session])
- when :login
- s[:user]=$1
- s[:pass]=$2
+ when :login
+ s[:user]=$1
+ s[:pass]=$2
- when nil
- # No matches, no saved state
- else
- sessions[s[:session]].merge!({k => matches})
- end # end case matched
- end # end of each_key
- end # end of parse
+ when nil
+ # No matches, no saved state
+ else
+ sessions[s[:session]].merge!({k => matches})
+ end # end case matched
+ end # end of each_key
+ end # end of parse
end
diff --git a/data/exploits/psnuffle/pop3.rb b/data/exploits/psnuffle/pop3.rb
index 117b8c03cb..10d851b3fc 100755
--- a/data/exploits/psnuffle/pop3.rb
+++ b/data/exploits/psnuffle/pop3.rb
@@ -6,83 +6,83 @@
# as unsuccessful logins... (Typos are common :-) )
#
class SnifferPOP3 < BaseProtocolParser
- def register_sigs
- self.sigs = {
- :ok => /^(\+OK[^\n]*)\n/i,
- :err => /^(\-ERR[^\n]*)\n/i,
- :user => /^USER\s+([^\n]+)\n/i,
- :pass => /^PASS\s+([^\n]+)\n/i,
- :quit => /^(QUIT\s*[^\n]*)\n/i
- }
- end
+ def register_sigs
+ self.sigs = {
+ :ok => /^(\+OK[^\n]*)\n/i,
+ :err => /^(\-ERR[^\n]*)\n/i,
+ :user => /^USER\s+([^\n]+)\n/i,
+ :pass => /^PASS\s+([^\n]+)\n/i,
+ :quit => /^(QUIT\s*[^\n]*)\n/i
+ }
+ end
- def parse(pkt)
- # We want to return immediatly if we do not have a packet which is handled by us
- return unless pkt.is_tcp?
- return if (pkt.tcp_sport != 110 and pkt.tcp_dport != 110)
- s = find_session((pkt.tcp_sport == 110) ? get_session_src(pkt) : get_session_dst(pkt))
+ def parse(pkt)
+ # We want to return immediatly if we do not have a packet which is handled by us
+ return unless pkt.is_tcp?
+ return if (pkt.tcp_sport != 110 and pkt.tcp_dport != 110)
+ s = find_session((pkt.tcp_sport == 110) ? get_session_src(pkt) : get_session_dst(pkt))
- self.sigs.each_key do |k|
- # There is only one pattern per run to test
- matched = nil
- matches = nil
+ self.sigs.each_key do |k|
+ # There is only one pattern per run to test
+ matched = nil
+ matches = nil
- if(pkt.payload =~ self.sigs[k])
- matched = k
- matches = $1
- end
+ if(pkt.payload =~ self.sigs[k])
+ matched = k
+ matches = $1
+ end
- case matched
- when :ok
- # Last command was successful, in addition most servers transmit a banner with the first +OK
- case s[:last]
- when nil
- # Its the first +OK must include the banner, worst case its just +OK
- s[:info] = matches
- s[:proto] = "tcp"
- s[:name] = "pop3"
- report_service(s)
+ case matched
+ when :ok
+ # Last command was successful, in addition most servers transmit a banner with the first +OK
+ case s[:last]
+ when nil
+ # Its the first +OK must include the banner, worst case its just +OK
+ s[:info] = matches
+ s[:proto] = "tcp"
+ s[:name] = "pop3"
+ report_service(s)
- when :user
- # When the last command was a username login
- # We might keep track on this one in future
- when :pass
- # Perfect we get an +OK after a PASS command this means right password given :-)
+ when :user
+ # When the last command was a username login
+ # We might keep track on this one in future
+ when :pass
+ # Perfect we get an +OK after a PASS command this means right password given :-)
- s[:proto] = "tcp"
- s[:name] = "pop3"
- s[:extra] = "Successful Login. Banner: #{s[:banner]}"
- report_auth_info(s)
- print_status("Successful POP3 Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
+ s[:proto] = "tcp"
+ s[:name] = "pop3"
+ s[:extra] = "Successful Login. Banner: #{s[:banner]}"
+ report_auth_info(s)
+ print_status("Successful POP3 Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
- # Remove it form the session objects so freeup
- sessions.delete(s[:session])
+ # Remove it form the session objects so freeup
+ sessions.delete(s[:session])
- when :quit
- # The session is terminated by the user just delete is as well
- sessions.delete(s[:session])
- end
- s[:last]=:ok
+ when :quit
+ # The session is terminated by the user just delete is as well
+ sessions.delete(s[:session])
+ end
+ s[:last]=:ok
- when :err
- case s[:last]
- when :pass
- # Oops got a -ERR after a pass so its crap ignore the pass
- # But report it, might be helpfull for guessing :-)
+ when :err
+ case s[:last]
+ when :pass
+ # Oops got a -ERR after a pass so its crap ignore the pass
+ # But report it, might be helpfull for guessing :-)
- s[:proto]="pop3"
- s[:extra]="Failed Login. Banner: #{s[:banner]}"
- report_auth_info(s)
- print_status("Invalid POP3 Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
- s[:pass]=""
- end
- when nil
- # No matches, no saved state
- else
- s[:last]=matched
- sessions[s[:session]].merge!({k => matches})
- end # end case matched
- end # end of each_key
- end # end of parse
+ s[:proto]="pop3"
+ s[:extra]="Failed Login. Banner: #{s[:banner]}"
+ report_auth_info(s)
+ print_status("Invalid POP3 Login: #{s[:session]} >> #{s[:user]} / #{s[:pass]} (#{s[:banner].strip})")
+ s[:pass]=""
+ end
+ when nil
+ # No matches, no saved state
+ else
+ s[:last]=matched
+ sessions[s[:session]].merge!({k => matches})
+ end # end case matched
+ end # end of each_key
+ end # end of parse
end
diff --git a/data/exploits/psnuffle/smb.rb b/data/exploits/psnuffle/smb.rb
index 3bcd2e083f..c1702d51fd 100755
--- a/data/exploits/psnuffle/smb.rb
+++ b/data/exploits/psnuffle/smb.rb
@@ -6,206 +6,206 @@
#Memo :
#FOR SMBV1
- # Authentification without extended security set
- #1) client -> server : smb_negotiate (0x72) : smb.flags2.extended_sec = 0
- #2) server -> client : smb_negotiate (0x72) : smb.flags2.extended_sec = 0 and contains server challenge (aka encryption key) and wordcount = 17
- #3) client -> server : smb_setup_andx (0x73) : contains lm/ntlm hashes and wordcount = 13 (not 0)
- #4) server -> client : smb_setup_andx (0x73) : if status = success then authentification ok
+ # Authentification without extended security set
+ #1) client -> server : smb_negotiate (0x72) : smb.flags2.extended_sec = 0
+ #2) server -> client : smb_negotiate (0x72) : smb.flags2.extended_sec = 0 and contains server challenge (aka encryption key) and wordcount = 17
+ #3) client -> server : smb_setup_andx (0x73) : contains lm/ntlm hashes and wordcount = 13 (not 0)
+ #4) server -> client : smb_setup_andx (0x73) : if status = success then authentification ok
- # Authentification with extended security set
- #1) client -> server : smb_negotiate (0x72) : smb.flags2.extended_sec = 1
- #2) server -> client : smb_negotiate (0x72) : smb.flags2.extended_sec = 1
- #3) client -> server : smb_setup_andx (0x73) : contains an ntlm_type1 message
- #4) server -> client : smb_setup_andx (0x73) : contains an ntlm_type2 message with the server challenge
- #5) client -> server : smb_setup_andx (0x73) : contains an ntlm_type3 message with the lm/ntlm hashes
- #6) server -> client : smb_setup_andx (0x73) : if status = success then authentification = ok
+ # Authentification with extended security set
+ #1) client -> server : smb_negotiate (0x72) : smb.flags2.extended_sec = 1
+ #2) server -> client : smb_negotiate (0x72) : smb.flags2.extended_sec = 1
+ #3) client -> server : smb_setup_andx (0x73) : contains an ntlm_type1 message
+ #4) server -> client : smb_setup_andx (0x73) : contains an ntlm_type2 message with the server challenge
+ #5) client -> server : smb_setup_andx (0x73) : contains an ntlm_type3 message with the lm/ntlm hashes
+ #6) server -> client : smb_setup_andx (0x73) : if status = success then authentification = ok
#FOR SMBV2
- #SMBv2 is pretty similar. However, extended security is always set and it is using a newer set of smb negociate and session_setup command for requets/response
+ #SMBv2 is pretty similar. However, extended security is always set and it is using a newer set of smb negociate and session_setup command for requets/response
class SnifferSMB < BaseProtocolParser
- def register_sigs
- self.sigs = {
- :smb1_negotiate => /\xffSMB\x72/n,
- :smb1_setupandx => /\xffSMB\x73/n,
- #:smb2_negotiate => /\xFESMB\x40\x00(.){6}\x00\x00/n,
- :smb2_setupandx => /\xFESMB\x40\x00(.){6}\x01\x00/n
- }
- end
+ def register_sigs
+ self.sigs = {
+ :smb1_negotiate => /\xffSMB\x72/n,
+ :smb1_setupandx => /\xffSMB\x73/n,
+ #:smb2_negotiate => /\xFESMB\x40\x00(.){6}\x00\x00/n,
+ :smb2_setupandx => /\xFESMB\x40\x00(.){6}\x01\x00/n
+ }
+ end
- def parse(pkt)
- # We want to return immediatly if we do not have a packet which is handled by us
- return unless pkt.is_tcp?
- return if (pkt.tcp_sport != 445 and pkt.tcp_dport != 445)
- s = find_session((pkt.tcp_sport == 445) ? get_session_src(pkt) : get_session_dst(pkt))
+ def parse(pkt)
+ # We want to return immediatly if we do not have a packet which is handled by us
+ return unless pkt.is_tcp?
+ return if (pkt.tcp_sport != 445 and pkt.tcp_dport != 445)
+ s = find_session((pkt.tcp_sport == 445) ? get_session_src(pkt) : get_session_dst(pkt))
- self.sigs.each_key do |k|
- # There is only one pattern per run to test
- matched = nil
- matches = nil
+ self.sigs.each_key do |k|
+ # There is only one pattern per run to test
+ matched = nil
+ matches = nil
- if(pkt.payload =~ self.sigs[k])
- matched = k
- matches = $1
- end
+ if(pkt.payload =~ self.sigs[k])
+ matched = k
+ matches = $1
+ end
- case matched
- when :smb1_negotiate
- payload = pkt.payload.dup
- wordcount = payload[36,1].unpack("C")[0]
- #negotiate response
- if wordcount == 17
- flags2 = payload[14,2].unpack("v")[0]
- #the server challenge is here
- if flags2 & 0x800 == 0
- s[:challenge] = payload[73,8].unpack("H*")[0]
- s[:last] = :smb1_negotiate
- end
- end
+ case matched
+ when :smb1_negotiate
+ payload = pkt.payload.dup
+ wordcount = payload[36,1].unpack("C")[0]
+ #negotiate response
+ if wordcount == 17
+ flags2 = payload[14,2].unpack("v")[0]
+ #the server challenge is here
+ if flags2 & 0x800 == 0
+ s[:challenge] = payload[73,8].unpack("H*")[0]
+ s[:last] = :smb1_negotiate
+ end
+ end
- when :smb1_setupandx
- s[:smb_version] = "SMBv1"
- parse_sessionsetup(pkt, s)
- when :smb2_setupandx
- s[:smb_version] = "SMBv2"
- parse_sessionsetup(pkt, s)
- when nil
- # No matches, no saved state
- else
- sessions[s[:session]].merge!({k => matches})
- end # end case matched
+ when :smb1_setupandx
+ s[:smb_version] = "SMBv1"
+ parse_sessionsetup(pkt, s)
+ when :smb2_setupandx
+ s[:smb_version] = "SMBv2"
+ parse_sessionsetup(pkt, s)
+ when nil
+ # No matches, no saved state
+ else
+ sessions[s[:session]].merge!({k => matches})
+ end # end case matched
- end # end of each_key
- end # end of parse
+ end # end of each_key
+ end # end of parse
- #ntlmv1, ntlmv2 or ntlm2_session
- def detect_ntlm_ver(lmhash, ntlmhash)
- return "NTLMv2" if ntlmhash.length > 48
- if lmhash.length == 48 and ntlmhash.length == 48
- if lmhash != "00" * 24 and lmhash[16,32] == "00" * 16
- return "NTLM2_SESSION"
- else
- return "NTLMv1"
- end
- else
- raise RuntimeError, "Unknow hash type"
- end
- end
+ #ntlmv1, ntlmv2 or ntlm2_session
+ def detect_ntlm_ver(lmhash, ntlmhash)
+ return "NTLMv2" if ntlmhash.length > 48
+ if lmhash.length == 48 and ntlmhash.length == 48
+ if lmhash != "00" * 24 and lmhash[16,32] == "00" * 16
+ return "NTLM2_SESSION"
+ else
+ return "NTLMv1"
+ end
+ else
+ raise RuntimeError, "Unknow hash type"
+ end
+ end
- def parse_sessionsetup(pkt, s)
- payload = pkt.payload.dup
- ntlmpayload = payload[/NTLMSSP\x00.*/m]
- if ntlmpayload
- ntlmmessagetype = ntlmpayload[8,4].unpack("V")[0]
- case ntlmmessagetype
- when 2 # challenge
- s[:challenge] = ntlmpayload[24,8].unpack("H*")[0]
- s[:last] = :ntlm_type2
- when 3 # auth
- if s[:last] == :ntlm_type2
- lmlength = ntlmpayload[12, 2].unpack("v")[0]
- lmoffset = ntlmpayload[16, 2].unpack("v")[0]
- ntlmlength = ntlmpayload[20, 2].unpack("v")[0]
- ntlmoffset = ntlmpayload[24, 2].unpack("v")[0]
- domainlength = ntlmpayload[28, 2].unpack("v")[0]
- domainoffset = ntlmpayload[32, 2].unpack("v")[0]
- usrlength = ntlmpayload[36, 2].unpack("v")[0]
- usroffset = ntlmpayload[40, 2].unpack("v")[0]
+ def parse_sessionsetup(pkt, s)
+ payload = pkt.payload.dup
+ ntlmpayload = payload[/NTLMSSP\x00.*/m]
+ if ntlmpayload
+ ntlmmessagetype = ntlmpayload[8,4].unpack("V")[0]
+ case ntlmmessagetype
+ when 2 # challenge
+ s[:challenge] = ntlmpayload[24,8].unpack("H*")[0]
+ s[:last] = :ntlm_type2
+ when 3 # auth
+ if s[:last] == :ntlm_type2
+ lmlength = ntlmpayload[12, 2].unpack("v")[0]
+ lmoffset = ntlmpayload[16, 2].unpack("v")[0]
+ ntlmlength = ntlmpayload[20, 2].unpack("v")[0]
+ ntlmoffset = ntlmpayload[24, 2].unpack("v")[0]
+ domainlength = ntlmpayload[28, 2].unpack("v")[0]
+ domainoffset = ntlmpayload[32, 2].unpack("v")[0]
+ usrlength = ntlmpayload[36, 2].unpack("v")[0]
+ usroffset = ntlmpayload[40, 2].unpack("v")[0]
- s[:lmhash] = ntlmpayload[lmoffset, lmlength].unpack("H*")[0] || ''
- s[:ntlmhash] = ntlmpayload[ntlmoffset, ntlmlength].unpack("H*")[0] || ''
- s[:domain] = ntlmpayload[domainoffset, domainlength].gsub("\x00","") || ''
- s[:user] = ntlmpayload[usroffset, usrlength].gsub("\x00","") || ''
+ s[:lmhash] = ntlmpayload[lmoffset, lmlength].unpack("H*")[0] || ''
+ s[:ntlmhash] = ntlmpayload[ntlmoffset, ntlmlength].unpack("H*")[0] || ''
+ s[:domain] = ntlmpayload[domainoffset, domainlength].gsub("\x00","") || ''
+ s[:user] = ntlmpayload[usroffset, usrlength].gsub("\x00","") || ''
- secbloblength = payload[51,2].unpack("v")[0]
- names = (payload[63..-1][secbloblength..-1] || '').split("\x00\x00").map { |x| x.gsub(/\x00/, '') }
- s[:peer_os] = names[0] || ''
- s[:peer_lm] = names[1] || ''
- s[:last] = :ntlm_type3
- end
- end
- else
- wordcount = payload[36,1].unpack("C")[0]
- #authentification without smb extended security (smbmount, msf server capture)
- if wordcount == 13 and s[:last] == :smb1_negotiate and s[:smb_version] == "SMBv1"
- lmlength = payload[51,2].unpack("v")[0]
- ntlmlength = payload[53,2].unpack("v")[0]
- s[:lmhash] = payload[65,lmlength].unpack("H*")[0]
- s[:ntlmhash] = payload[65 + lmlength, ntlmlength].unpack("H*")[0]
-
- names = payload[Range.new(65 + lmlength + ntlmlength,-1)].split("\x00\x00").map { |x| x.gsub(/\x00/, '') }
+ secbloblength = payload[51,2].unpack("v")[0]
+ names = (payload[63..-1][secbloblength..-1] || '').split("\x00\x00").map { |x| x.gsub(/\x00/, '') }
+ s[:peer_os] = names[0] || ''
+ s[:peer_lm] = names[1] || ''
+ s[:last] = :ntlm_type3
+ end
+ end
+ else
+ wordcount = payload[36,1].unpack("C")[0]
+ #authentification without smb extended security (smbmount, msf server capture)
+ if wordcount == 13 and s[:last] == :smb1_negotiate and s[:smb_version] == "SMBv1"
+ lmlength = payload[51,2].unpack("v")[0]
+ ntlmlength = payload[53,2].unpack("v")[0]
+ s[:lmhash] = payload[65,lmlength].unpack("H*")[0]
+ s[:ntlmhash] = payload[65 + lmlength, ntlmlength].unpack("H*")[0]
+
+ names = payload[Range.new(65 + lmlength + ntlmlength,-1)].split("\x00\x00").map { |x| x.gsub(/\x00/, '') }
- s[:user] = names[0]
- s[:domain] = names[1]
- s[:peer_os] = names[2]
- s[:peer_lm] = names[3]
- s[:last] = :smb_no_ntlm
- else
- #answer from server
- if s[:last] == :ntlm_type3 or s[:last] == :smb_no_ntlm
- #do not output anonymous/guest logging
- unless s[:user] == '' or s[:ntlmhash] == '' or s[:ntlmhash] =~ /^(00)*$/m
- #set lmhash to a default value if not provided
- s[:lmhash] = "00" * 24 if s[:lmhash] == '' or s[:lmhash] =~ /^(00)*$/m
- s[:lmhash] = "00" * 24 if s[:lmhash] == s[:ntlmhash]
+ s[:user] = names[0]
+ s[:domain] = names[1]
+ s[:peer_os] = names[2]
+ s[:peer_lm] = names[3]
+ s[:last] = :smb_no_ntlm
+ else
+ #answer from server
+ if s[:last] == :ntlm_type3 or s[:last] == :smb_no_ntlm
+ #do not output anonymous/guest logging
+ unless s[:user] == '' or s[:ntlmhash] == '' or s[:ntlmhash] =~ /^(00)*$/m
+ #set lmhash to a default value if not provided
+ s[:lmhash] = "00" * 24 if s[:lmhash] == '' or s[:lmhash] =~ /^(00)*$/m
+ s[:lmhash] = "00" * 24 if s[:lmhash] == s[:ntlmhash]
- smb_status = payload[9,4].unpack("V")[0]
- if smb_status == 0 # success
+ smb_status = payload[9,4].unpack("V")[0]
+ if smb_status == 0 # success
- ntlm_ver = detect_ntlm_ver(s[:lmhash],s[:ntlmhash])
+ ntlm_ver = detect_ntlm_ver(s[:lmhash],s[:ntlmhash])
- logmessage =
- "#{ntlm_ver} Response Captured in #{s[:smb_version]} session : #{s[:session]} \n" +
- "USER:#{s[:user]} DOMAIN:#{s[:domain]} OS:#{s[:peer_os]} LM:#{s[:peer_lm]}\n" +
- "SERVER CHALLENGE:#{s[:challenge]} " +
- "\nLMHASH:#{s[:lmhash]} " +
- "\nNTHASH:#{s[:ntlmhash]}\n"
- print_status(logmessage)
+ logmessage =
+ "#{ntlm_ver} Response Captured in #{s[:smb_version]} session : #{s[:session]} \n" +
+ "USER:#{s[:user]} DOMAIN:#{s[:domain]} OS:#{s[:peer_os]} LM:#{s[:peer_lm]}\n" +
+ "SERVER CHALLENGE:#{s[:challenge]} " +
+ "\nLMHASH:#{s[:lmhash]} " +
+ "\nNTHASH:#{s[:ntlmhash]}\n"
+ print_status(logmessage)
- src_ip = s[:client_host]
- dst_ip = s[:host]
- # know this is ugly , last code added :-/
- smb_db_type_hash = case ntlm_ver
- when "NTLMv1" then "smb_netv1_hash"
- when "NTLM2_SESSION" then "smb_netv1_hash"
- when "NTLMv2" then "smb_netv2_hash"
- end
- # DB reporting
- report_auth_info(
- :host => dst_ip,
- :port => 445,
- :sname => 'smb',
- :user => s[:user],
- :pass => s[:domain] + ":" + s[:lmhash] + ":" + s[:ntlmhash] + ":" + s[:challenge],
- :type => smb_db_type_hash,
- :proof => "DOMAIN=#{s[:domain]} OS=#{s[:peer_os]}",
- :active => true
- )
+ src_ip = s[:client_host]
+ dst_ip = s[:host]
+ # know this is ugly , last code added :-/
+ smb_db_type_hash = case ntlm_ver
+ when "NTLMv1" then "smb_netv1_hash"
+ when "NTLM2_SESSION" then "smb_netv1_hash"
+ when "NTLMv2" then "smb_netv2_hash"
+ end
+ # DB reporting
+ report_auth_info(
+ :host => dst_ip,
+ :port => 445,
+ :sname => 'smb',
+ :user => s[:user],
+ :pass => s[:domain] + ":" + s[:lmhash] + ":" + s[:ntlmhash] + ":" + s[:challenge],
+ :type => smb_db_type_hash,
+ :proof => "DOMAIN=#{s[:domain]} OS=#{s[:peer_os]}",
+ :active => true
+ )
- report_note(
- :host => src_ip,
- :type => "smb_peer_os",
- :data => s[:peer_os]
- ) if (s[:peer_os] and s[:peer_os].strip.length > 0)
+ report_note(
+ :host => src_ip,
+ :type => "smb_peer_os",
+ :data => s[:peer_os]
+ ) if (s[:peer_os] and s[:peer_os].strip.length > 0)
- report_note(
- :host => src_ip,
- :type => "smb_peer_lm",
- :data => s[:peer_lm]
- ) if (s[:peer_lm] and s[:peer_lm].strip.length > 0)
+ report_note(
+ :host => src_ip,
+ :type => "smb_peer_lm",
+ :data => s[:peer_lm]
+ ) if (s[:peer_lm] and s[:peer_lm].strip.length > 0)
- report_note(
- :host => src_ip,
- :type => "smb_domain",
- :data => s[:domain]
- ) if (s[:domain] and s[:domain].strip.length > 0)
+ report_note(
+ :host => src_ip,
+ :type => "smb_domain",
+ :data => s[:domain]
+ ) if (s[:domain] and s[:domain].strip.length > 0)
- end
- end
- end
- s[:last] = nil
- sessions.delete(s[:session])
- end
- end
- end
+ end
+ end
+ end
+ s[:last] = nil
+ sessions.delete(s[:session])
+ end
+ end
+ end
end
diff --git a/data/exploits/psnuffle/url.rb b/data/exploits/psnuffle/url.rb
index 467bab5203..d90f254caa 100755
--- a/data/exploits/psnuffle/url.rb
+++ b/data/exploits/psnuffle/url.rb
@@ -6,43 +6,43 @@
# Sniffer class for GET URL's
class SnifferURL < BaseProtocolParser
- def register_sigs
- self.sigs = {
- :get => /^GET\s+([^\n]+)\s+HTTP\/\d\.\d/i,
- :webhost => /^HOST\:\s+([^\n\r]+)/i,
- }
- end
+ def register_sigs
+ self.sigs = {
+ :get => /^GET\s+([^\n]+)\s+HTTP\/\d\.\d/i,
+ :webhost => /^HOST\:\s+([^\n\r]+)/i,
+ }
+ end
- def parse(pkt)
- # We want to return immediantly if we do not have a packet which is handled by us
- return unless pkt.is_tcp?
- return if (pkt.tcp_sport != 80 and pkt.tcp_dport != 80)
- s = find_session((pkt.tcp_sport == 80) ? get_session_src(pkt) : get_session_dst(pkt))
+ def parse(pkt)
+ # We want to return immediantly if we do not have a packet which is handled by us
+ return unless pkt.is_tcp?
+ return if (pkt.tcp_sport != 80 and pkt.tcp_dport != 80)
+ s = find_session((pkt.tcp_sport == 80) ? get_session_src(pkt) : get_session_dst(pkt))
- self.sigs.each_key do |k|
+ self.sigs.each_key do |k|
- # There is only one pattern per run to test
- matched = nil
- matches = nil
+ # There is only one pattern per run to test
+ matched = nil
+ matches = nil
- if(pkt.payload =~ self.sigs[k])
- matched = k
- matches = $1
- sessions[s[:session]].merge!({k => matches})
- end
+ if(pkt.payload =~ self.sigs[k])
+ matched = k
+ matches = $1
+ sessions[s[:session]].merge!({k => matches})
+ end
- case matched
- when :webhost
- sessions[s[:session]].merge!({k => matches})
- if(s[:get])
- print_status("HTTP GET: #{s[:session]} http://#{s[:webhost]}#{s[:get]}")
- sessions.delete(s[:session])
- return
- end
- when nil
- # No matches, no saved state
- end # end case matched
- end # end of each_key
- end # end of parse
+ case matched
+ when :webhost
+ sessions[s[:session]].merge!({k => matches})
+ if(s[:get])
+ print_status("HTTP GET: #{s[:session]} http://#{s[:webhost]}#{s[:get]}")
+ sessions.delete(s[:session])
+ return
+ end
+ when nil
+ # No matches, no saved state
+ end # end case matched
+ end # end of each_key
+ end # end of parse
end # end of URL sniffer
diff --git a/data/john/run.linux.x64.mmx/genincstats.rb b/data/john/run.linux.x64.mmx/genincstats.rb
index 42d9b6ef6d..d415a55f97 100644
--- a/data/john/run.linux.x64.mmx/genincstats.rb
+++ b/data/john/run.linux.x64.mmx/genincstats.rb
@@ -3,20 +3,20 @@
require 'getoptlong'
def help
- puts "Usage: #{$0} [options]"
- puts "\t-h --help\t\tthis help."
- puts "\t-f --file\t\toutput file."
- puts "\t-n --num\t\tcharset: 0123456789"
- puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
- puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- puts "\t-l --alphanum\t\tcharset: alpha + num"
- puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
- puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
- puts "\t-c --custom"
- puts "\nExample:\n"
- puts "#{$0} -f stats -s"
- puts "#{$0} -f stats -c \"0123abc+=\""
- exit
+ puts "Usage: #{$0} [options]"
+ puts "\t-h --help\t\tthis help."
+ puts "\t-f --file\t\toutput file."
+ puts "\t-n --num\t\tcharset: 0123456789"
+ puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
+ puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ puts "\t-l --alphanum\t\tcharset: alpha + num"
+ puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
+ puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
+ puts "\t-c --custom"
+ puts "\nExample:\n"
+ puts "#{$0} -f stats -s"
+ puts "#{$0} -f stats -c \"0123abc+=\""
+ exit
end
ch_alpha = 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num = '0123456789'
ch_sp = '!@#$+=.*'
opts = GetoptLong.new(
- [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
- [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
- [ '--all', '-s', GetoptLong::NO_ARGUMENT],
- [ '--num', '-n', GetoptLong::NO_ARGUMENT],
- [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
- [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
- [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
- [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
- [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
+ [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
+ [ '--all', '-s', GetoptLong::NO_ARGUMENT],
+ [ '--num', '-n', GetoptLong::NO_ARGUMENT],
+ [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
+ [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
+ [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
)
charset = nil
filename = "stats_out"
opts.each do |opt, arg|
- case opt
- when '--help'
- help
- when '--file'
- filename = arg
- when '--num'
- charset = ch_num
- when '--alpha'
- charset = ch_alpha
- when '--alphamaj'
- charset = ch_alpha.capitalize
- when '--alphanum'
- charset = ch_alpha + ch_num
- when '--alphanummaj'
- charset = ch_alpha.capitalize + ch_num
- when '--all'
- charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
- when '--custom'
- charset = arg
- end
+ case opt
+ when '--help'
+ help
+ when '--file'
+ filename = arg
+ when '--num'
+ charset = ch_num
+ when '--alpha'
+ charset = ch_alpha
+ when '--alphamaj'
+ charset = ch_alpha.capitalize
+ when '--alphanum'
+ charset = ch_alpha + ch_num
+ when '--alphanummaj'
+ charset = ch_alpha.capitalize + ch_num
+ when '--all'
+ charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
+ when '--custom'
+ charset = arg
+ end
end
if charset == nil
- help
+ help
end
fstat = File.open(filename, "w")
charset.each_byte do |c|
- fstat.write("1=proba1[#{c.to_s}]\n")
- charset.each_byte do |tmp|
- fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
- end
+ fstat.write("1=proba1[#{c.to_s}]\n")
+ charset.each_byte do |tmp|
+ fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
+ end
end
fstat.close
diff --git a/data/john/run.linux.x86.any/genincstats.rb b/data/john/run.linux.x86.any/genincstats.rb
index 42d9b6ef6d..d415a55f97 100644
--- a/data/john/run.linux.x86.any/genincstats.rb
+++ b/data/john/run.linux.x86.any/genincstats.rb
@@ -3,20 +3,20 @@
require 'getoptlong'
def help
- puts "Usage: #{$0} [options]"
- puts "\t-h --help\t\tthis help."
- puts "\t-f --file\t\toutput file."
- puts "\t-n --num\t\tcharset: 0123456789"
- puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
- puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- puts "\t-l --alphanum\t\tcharset: alpha + num"
- puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
- puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
- puts "\t-c --custom"
- puts "\nExample:\n"
- puts "#{$0} -f stats -s"
- puts "#{$0} -f stats -c \"0123abc+=\""
- exit
+ puts "Usage: #{$0} [options]"
+ puts "\t-h --help\t\tthis help."
+ puts "\t-f --file\t\toutput file."
+ puts "\t-n --num\t\tcharset: 0123456789"
+ puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
+ puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ puts "\t-l --alphanum\t\tcharset: alpha + num"
+ puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
+ puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
+ puts "\t-c --custom"
+ puts "\nExample:\n"
+ puts "#{$0} -f stats -s"
+ puts "#{$0} -f stats -c \"0123abc+=\""
+ exit
end
ch_alpha = 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num = '0123456789'
ch_sp = '!@#$+=.*'
opts = GetoptLong.new(
- [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
- [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
- [ '--all', '-s', GetoptLong::NO_ARGUMENT],
- [ '--num', '-n', GetoptLong::NO_ARGUMENT],
- [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
- [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
- [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
- [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
- [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
+ [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
+ [ '--all', '-s', GetoptLong::NO_ARGUMENT],
+ [ '--num', '-n', GetoptLong::NO_ARGUMENT],
+ [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
+ [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
+ [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
)
charset = nil
filename = "stats_out"
opts.each do |opt, arg|
- case opt
- when '--help'
- help
- when '--file'
- filename = arg
- when '--num'
- charset = ch_num
- when '--alpha'
- charset = ch_alpha
- when '--alphamaj'
- charset = ch_alpha.capitalize
- when '--alphanum'
- charset = ch_alpha + ch_num
- when '--alphanummaj'
- charset = ch_alpha.capitalize + ch_num
- when '--all'
- charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
- when '--custom'
- charset = arg
- end
+ case opt
+ when '--help'
+ help
+ when '--file'
+ filename = arg
+ when '--num'
+ charset = ch_num
+ when '--alpha'
+ charset = ch_alpha
+ when '--alphamaj'
+ charset = ch_alpha.capitalize
+ when '--alphanum'
+ charset = ch_alpha + ch_num
+ when '--alphanummaj'
+ charset = ch_alpha.capitalize + ch_num
+ when '--all'
+ charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
+ when '--custom'
+ charset = arg
+ end
end
if charset == nil
- help
+ help
end
fstat = File.open(filename, "w")
charset.each_byte do |c|
- fstat.write("1=proba1[#{c.to_s}]\n")
- charset.each_byte do |tmp|
- fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
- end
+ fstat.write("1=proba1[#{c.to_s}]\n")
+ charset.each_byte do |tmp|
+ fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
+ end
end
fstat.close
diff --git a/data/john/run.linux.x86.mmx/genincstats.rb b/data/john/run.linux.x86.mmx/genincstats.rb
index 42d9b6ef6d..d415a55f97 100644
--- a/data/john/run.linux.x86.mmx/genincstats.rb
+++ b/data/john/run.linux.x86.mmx/genincstats.rb
@@ -3,20 +3,20 @@
require 'getoptlong'
def help
- puts "Usage: #{$0} [options]"
- puts "\t-h --help\t\tthis help."
- puts "\t-f --file\t\toutput file."
- puts "\t-n --num\t\tcharset: 0123456789"
- puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
- puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- puts "\t-l --alphanum\t\tcharset: alpha + num"
- puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
- puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
- puts "\t-c --custom"
- puts "\nExample:\n"
- puts "#{$0} -f stats -s"
- puts "#{$0} -f stats -c \"0123abc+=\""
- exit
+ puts "Usage: #{$0} [options]"
+ puts "\t-h --help\t\tthis help."
+ puts "\t-f --file\t\toutput file."
+ puts "\t-n --num\t\tcharset: 0123456789"
+ puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
+ puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ puts "\t-l --alphanum\t\tcharset: alpha + num"
+ puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
+ puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
+ puts "\t-c --custom"
+ puts "\nExample:\n"
+ puts "#{$0} -f stats -s"
+ puts "#{$0} -f stats -c \"0123abc+=\""
+ exit
end
ch_alpha = 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num = '0123456789'
ch_sp = '!@#$+=.*'
opts = GetoptLong.new(
- [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
- [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
- [ '--all', '-s', GetoptLong::NO_ARGUMENT],
- [ '--num', '-n', GetoptLong::NO_ARGUMENT],
- [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
- [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
- [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
- [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
- [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
+ [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
+ [ '--all', '-s', GetoptLong::NO_ARGUMENT],
+ [ '--num', '-n', GetoptLong::NO_ARGUMENT],
+ [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
+ [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
+ [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
)
charset = nil
filename = "stats_out"
opts.each do |opt, arg|
- case opt
- when '--help'
- help
- when '--file'
- filename = arg
- when '--num'
- charset = ch_num
- when '--alpha'
- charset = ch_alpha
- when '--alphamaj'
- charset = ch_alpha.capitalize
- when '--alphanum'
- charset = ch_alpha + ch_num
- when '--alphanummaj'
- charset = ch_alpha.capitalize + ch_num
- when '--all'
- charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
- when '--custom'
- charset = arg
- end
+ case opt
+ when '--help'
+ help
+ when '--file'
+ filename = arg
+ when '--num'
+ charset = ch_num
+ when '--alpha'
+ charset = ch_alpha
+ when '--alphamaj'
+ charset = ch_alpha.capitalize
+ when '--alphanum'
+ charset = ch_alpha + ch_num
+ when '--alphanummaj'
+ charset = ch_alpha.capitalize + ch_num
+ when '--all'
+ charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
+ when '--custom'
+ charset = arg
+ end
end
if charset == nil
- help
+ help
end
fstat = File.open(filename, "w")
charset.each_byte do |c|
- fstat.write("1=proba1[#{c.to_s}]\n")
- charset.each_byte do |tmp|
- fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
- end
+ fstat.write("1=proba1[#{c.to_s}]\n")
+ charset.each_byte do |tmp|
+ fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
+ end
end
fstat.close
diff --git a/data/john/run.linux.x86.sse2/genincstats.rb b/data/john/run.linux.x86.sse2/genincstats.rb
index 42d9b6ef6d..d415a55f97 100644
--- a/data/john/run.linux.x86.sse2/genincstats.rb
+++ b/data/john/run.linux.x86.sse2/genincstats.rb
@@ -3,20 +3,20 @@
require 'getoptlong'
def help
- puts "Usage: #{$0} [options]"
- puts "\t-h --help\t\tthis help."
- puts "\t-f --file\t\toutput file."
- puts "\t-n --num\t\tcharset: 0123456789"
- puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
- puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- puts "\t-l --alphanum\t\tcharset: alpha + num"
- puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
- puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
- puts "\t-c --custom"
- puts "\nExample:\n"
- puts "#{$0} -f stats -s"
- puts "#{$0} -f stats -c \"0123abc+=\""
- exit
+ puts "Usage: #{$0} [options]"
+ puts "\t-h --help\t\tthis help."
+ puts "\t-f --file\t\toutput file."
+ puts "\t-n --num\t\tcharset: 0123456789"
+ puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
+ puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ puts "\t-l --alphanum\t\tcharset: alpha + num"
+ puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
+ puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
+ puts "\t-c --custom"
+ puts "\nExample:\n"
+ puts "#{$0} -f stats -s"
+ puts "#{$0} -f stats -c \"0123abc+=\""
+ exit
end
ch_alpha = 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num = '0123456789'
ch_sp = '!@#$+=.*'
opts = GetoptLong.new(
- [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
- [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
- [ '--all', '-s', GetoptLong::NO_ARGUMENT],
- [ '--num', '-n', GetoptLong::NO_ARGUMENT],
- [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
- [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
- [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
- [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
- [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
+ [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
+ [ '--all', '-s', GetoptLong::NO_ARGUMENT],
+ [ '--num', '-n', GetoptLong::NO_ARGUMENT],
+ [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
+ [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
+ [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
)
charset = nil
filename = "stats_out"
opts.each do |opt, arg|
- case opt
- when '--help'
- help
- when '--file'
- filename = arg
- when '--num'
- charset = ch_num
- when '--alpha'
- charset = ch_alpha
- when '--alphamaj'
- charset = ch_alpha.capitalize
- when '--alphanum'
- charset = ch_alpha + ch_num
- when '--alphanummaj'
- charset = ch_alpha.capitalize + ch_num
- when '--all'
- charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
- when '--custom'
- charset = arg
- end
+ case opt
+ when '--help'
+ help
+ when '--file'
+ filename = arg
+ when '--num'
+ charset = ch_num
+ when '--alpha'
+ charset = ch_alpha
+ when '--alphamaj'
+ charset = ch_alpha.capitalize
+ when '--alphanum'
+ charset = ch_alpha + ch_num
+ when '--alphanummaj'
+ charset = ch_alpha.capitalize + ch_num
+ when '--all'
+ charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
+ when '--custom'
+ charset = arg
+ end
end
if charset == nil
- help
+ help
end
fstat = File.open(filename, "w")
charset.each_byte do |c|
- fstat.write("1=proba1[#{c.to_s}]\n")
- charset.each_byte do |tmp|
- fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
- end
+ fstat.write("1=proba1[#{c.to_s}]\n")
+ charset.each_byte do |tmp|
+ fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
+ end
end
fstat.close
diff --git a/data/john/run.win32.any/genincstats.rb b/data/john/run.win32.any/genincstats.rb
index 42d9b6ef6d..d415a55f97 100755
--- a/data/john/run.win32.any/genincstats.rb
+++ b/data/john/run.win32.any/genincstats.rb
@@ -3,20 +3,20 @@
require 'getoptlong'
def help
- puts "Usage: #{$0} [options]"
- puts "\t-h --help\t\tthis help."
- puts "\t-f --file\t\toutput file."
- puts "\t-n --num\t\tcharset: 0123456789"
- puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
- puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- puts "\t-l --alphanum\t\tcharset: alpha + num"
- puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
- puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
- puts "\t-c --custom"
- puts "\nExample:\n"
- puts "#{$0} -f stats -s"
- puts "#{$0} -f stats -c \"0123abc+=\""
- exit
+ puts "Usage: #{$0} [options]"
+ puts "\t-h --help\t\tthis help."
+ puts "\t-f --file\t\toutput file."
+ puts "\t-n --num\t\tcharset: 0123456789"
+ puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
+ puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ puts "\t-l --alphanum\t\tcharset: alpha + num"
+ puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
+ puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
+ puts "\t-c --custom"
+ puts "\nExample:\n"
+ puts "#{$0} -f stats -s"
+ puts "#{$0} -f stats -c \"0123abc+=\""
+ exit
end
ch_alpha = 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num = '0123456789'
ch_sp = '!@#$+=.*'
opts = GetoptLong.new(
- [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
- [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
- [ '--all', '-s', GetoptLong::NO_ARGUMENT],
- [ '--num', '-n', GetoptLong::NO_ARGUMENT],
- [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
- [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
- [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
- [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
- [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
+ [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
+ [ '--all', '-s', GetoptLong::NO_ARGUMENT],
+ [ '--num', '-n', GetoptLong::NO_ARGUMENT],
+ [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
+ [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
+ [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
)
charset = nil
filename = "stats_out"
opts.each do |opt, arg|
- case opt
- when '--help'
- help
- when '--file'
- filename = arg
- when '--num'
- charset = ch_num
- when '--alpha'
- charset = ch_alpha
- when '--alphamaj'
- charset = ch_alpha.capitalize
- when '--alphanum'
- charset = ch_alpha + ch_num
- when '--alphanummaj'
- charset = ch_alpha.capitalize + ch_num
- when '--all'
- charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
- when '--custom'
- charset = arg
- end
+ case opt
+ when '--help'
+ help
+ when '--file'
+ filename = arg
+ when '--num'
+ charset = ch_num
+ when '--alpha'
+ charset = ch_alpha
+ when '--alphamaj'
+ charset = ch_alpha.capitalize
+ when '--alphanum'
+ charset = ch_alpha + ch_num
+ when '--alphanummaj'
+ charset = ch_alpha.capitalize + ch_num
+ when '--all'
+ charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
+ when '--custom'
+ charset = arg
+ end
end
if charset == nil
- help
+ help
end
fstat = File.open(filename, "w")
charset.each_byte do |c|
- fstat.write("1=proba1[#{c.to_s}]\n")
- charset.each_byte do |tmp|
- fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
- end
+ fstat.write("1=proba1[#{c.to_s}]\n")
+ charset.each_byte do |tmp|
+ fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
+ end
end
fstat.close
diff --git a/data/john/run.win32.mmx/genincstats.rb b/data/john/run.win32.mmx/genincstats.rb
index 42d9b6ef6d..d415a55f97 100755
--- a/data/john/run.win32.mmx/genincstats.rb
+++ b/data/john/run.win32.mmx/genincstats.rb
@@ -3,20 +3,20 @@
require 'getoptlong'
def help
- puts "Usage: #{$0} [options]"
- puts "\t-h --help\t\tthis help."
- puts "\t-f --file\t\toutput file."
- puts "\t-n --num\t\tcharset: 0123456789"
- puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
- puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- puts "\t-l --alphanum\t\tcharset: alpha + num"
- puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
- puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
- puts "\t-c --custom"
- puts "\nExample:\n"
- puts "#{$0} -f stats -s"
- puts "#{$0} -f stats -c \"0123abc+=\""
- exit
+ puts "Usage: #{$0} [options]"
+ puts "\t-h --help\t\tthis help."
+ puts "\t-f --file\t\toutput file."
+ puts "\t-n --num\t\tcharset: 0123456789"
+ puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
+ puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ puts "\t-l --alphanum\t\tcharset: alpha + num"
+ puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
+ puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
+ puts "\t-c --custom"
+ puts "\nExample:\n"
+ puts "#{$0} -f stats -s"
+ puts "#{$0} -f stats -c \"0123abc+=\""
+ exit
end
ch_alpha = 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num = '0123456789'
ch_sp = '!@#$+=.*'
opts = GetoptLong.new(
- [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
- [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
- [ '--all', '-s', GetoptLong::NO_ARGUMENT],
- [ '--num', '-n', GetoptLong::NO_ARGUMENT],
- [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
- [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
- [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
- [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
- [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
+ [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
+ [ '--all', '-s', GetoptLong::NO_ARGUMENT],
+ [ '--num', '-n', GetoptLong::NO_ARGUMENT],
+ [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
+ [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
+ [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
)
charset = nil
filename = "stats_out"
opts.each do |opt, arg|
- case opt
- when '--help'
- help
- when '--file'
- filename = arg
- when '--num'
- charset = ch_num
- when '--alpha'
- charset = ch_alpha
- when '--alphamaj'
- charset = ch_alpha.capitalize
- when '--alphanum'
- charset = ch_alpha + ch_num
- when '--alphanummaj'
- charset = ch_alpha.capitalize + ch_num
- when '--all'
- charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
- when '--custom'
- charset = arg
- end
+ case opt
+ when '--help'
+ help
+ when '--file'
+ filename = arg
+ when '--num'
+ charset = ch_num
+ when '--alpha'
+ charset = ch_alpha
+ when '--alphamaj'
+ charset = ch_alpha.capitalize
+ when '--alphanum'
+ charset = ch_alpha + ch_num
+ when '--alphanummaj'
+ charset = ch_alpha.capitalize + ch_num
+ when '--all'
+ charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
+ when '--custom'
+ charset = arg
+ end
end
if charset == nil
- help
+ help
end
fstat = File.open(filename, "w")
charset.each_byte do |c|
- fstat.write("1=proba1[#{c.to_s}]\n")
- charset.each_byte do |tmp|
- fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
- end
+ fstat.write("1=proba1[#{c.to_s}]\n")
+ charset.each_byte do |tmp|
+ fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
+ end
end
fstat.close
diff --git a/data/john/run.win32.sse2/genincstats.rb b/data/john/run.win32.sse2/genincstats.rb
index 42d9b6ef6d..d415a55f97 100755
--- a/data/john/run.win32.sse2/genincstats.rb
+++ b/data/john/run.win32.sse2/genincstats.rb
@@ -3,20 +3,20 @@
require 'getoptlong'
def help
- puts "Usage: #{$0} [options]"
- puts "\t-h --help\t\tthis help."
- puts "\t-f --file\t\toutput file."
- puts "\t-n --num\t\tcharset: 0123456789"
- puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
- puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- puts "\t-l --alphanum\t\tcharset: alpha + num"
- puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
- puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
- puts "\t-c --custom"
- puts "\nExample:\n"
- puts "#{$0} -f stats -s"
- puts "#{$0} -f stats -c \"0123abc+=\""
- exit
+ puts "Usage: #{$0} [options]"
+ puts "\t-h --help\t\tthis help."
+ puts "\t-f --file\t\toutput file."
+ puts "\t-n --num\t\tcharset: 0123456789"
+ puts "\t-a --alpha\t\tcharset: abcdefghijklmnopqrstuvwxyz"
+ puts "\t-A --alphamaj\t\tcharset: ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ puts "\t-l --alphanum\t\tcharset: alpha + num"
+ puts "\t-l --alphanummaj\tcharset: alpha + alphamaj + num"
+ puts "\t-s --all\t\tcharset: alpha + alphamaj + num + !@#$+=.*"
+ puts "\t-c --custom"
+ puts "\nExample:\n"
+ puts "#{$0} -f stats -s"
+ puts "#{$0} -f stats -c \"0123abc+=\""
+ exit
end
ch_alpha = 'abcdefghijklmnopqrstuvwxyz'
@@ -24,55 +24,55 @@ ch_num = '0123456789'
ch_sp = '!@#$+=.*'
opts = GetoptLong.new(
- [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
- [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
- [ '--all', '-s', GetoptLong::NO_ARGUMENT],
- [ '--num', '-n', GetoptLong::NO_ARGUMENT],
- [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
- [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
- [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
- [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
- [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
+ [ '--file', '-f', GetoptLong::OPTIONAL_ARGUMENT],
+ [ '--all', '-s', GetoptLong::NO_ARGUMENT],
+ [ '--num', '-n', GetoptLong::NO_ARGUMENT],
+ [ '--alpha', '-a', GetoptLong::NO_ARGUMENT ],
+ [ '--alphamaj', '-A', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanum', '-l', GetoptLong::NO_ARGUMENT ],
+ [ '--alphanummaj', '-L', GetoptLong::NO_ARGUMENT ],
+ [ '--custom', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
)
charset = nil
filename = "stats_out"
opts.each do |opt, arg|
- case opt
- when '--help'
- help
- when '--file'
- filename = arg
- when '--num'
- charset = ch_num
- when '--alpha'
- charset = ch_alpha
- when '--alphamaj'
- charset = ch_alpha.capitalize
- when '--alphanum'
- charset = ch_alpha + ch_num
- when '--alphanummaj'
- charset = ch_alpha.capitalize + ch_num
- when '--all'
- charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
- when '--custom'
- charset = arg
- end
+ case opt
+ when '--help'
+ help
+ when '--file'
+ filename = arg
+ when '--num'
+ charset = ch_num
+ when '--alpha'
+ charset = ch_alpha
+ when '--alphamaj'
+ charset = ch_alpha.capitalize
+ when '--alphanum'
+ charset = ch_alpha + ch_num
+ when '--alphanummaj'
+ charset = ch_alpha.capitalize + ch_num
+ when '--all'
+ charset = ch_alpha + ch_alpha.capitalize + ch_num + ch_sp
+ when '--custom'
+ charset = arg
+ end
end
if charset == nil
- help
+ help
end
fstat = File.open(filename, "w")
charset.each_byte do |c|
- fstat.write("1=proba1[#{c.to_s}]\n")
- charset.each_byte do |tmp|
- fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
- end
+ fstat.write("1=proba1[#{c.to_s}]\n")
+ charset.each_byte do |tmp|
+ fstat.write("1=proba2[#{c.to_s}*256+#{tmp.to_s}]\n")
+ end
end
fstat.close
diff --git a/data/msfcrawler/basic.rb b/data/msfcrawler/basic.rb
index cf32fdf09f..467cf6807b 100755
--- a/data/msfcrawler/basic.rb
+++ b/data/msfcrawler/basic.rb
@@ -18,29 +18,29 @@ require 'uri'
class CrawlerSimple < BaseParser
- def parse(request,result)
+ def parse(request,result)
- if !result['Content-Type'].include? "text/html"
- return
- end
+ if !result['Content-Type'].include? "text/html"
+ return
+ end
- doc = Hpricot(result.body.to_s)
- doc.search('a').each do |link|
+ doc = Hpricot(result.body.to_s)
+ doc.search('a').each do |link|
- hr = link.attributes['href']
+ hr = link.attributes['href']
- if hr and !hr.match(/^(\#|javascript\:)/)
- begin
- hreq = urltohash('GET',hr,request['uri'],nil)
+ if hr and !hr.match(/^(\#|javascript\:)/)
+ begin
+ hreq = urltohash('GET',hr,request['uri'],nil)
- insertnewpath(hreq)
+ insertnewpath(hreq)
- rescue URI::InvalidURIError
- #puts "Parse error"
- #puts "Error: #{link[0]}"
- end
- end
- end
- end
+ rescue URI::InvalidURIError
+ #puts "Parse error"
+ #puts "Error: #{link[0]}"
+ end
+ end
+ end
+ end
end
diff --git a/data/msfcrawler/forms.rb b/data/msfcrawler/forms.rb
index 9be3852daf..e5cd23b556 100755
--- a/data/msfcrawler/forms.rb
+++ b/data/msfcrawler/forms.rb
@@ -18,60 +18,60 @@ require 'uri'
class CrawlerForms < BaseParser
- def parse(request,result)
+ def parse(request,result)
- if !result['Content-Type'].include? "text/html"
- return
- end
+ if !result['Content-Type'].include? "text/html"
+ return
+ end
- hr = ''
- m = ''
+ hr = ''
+ m = ''
- doc = Hpricot(result.body.to_s)
- doc.search('form').each do |f|
- hr = f.attributes['action']
+ doc = Hpricot(result.body.to_s)
+ doc.search('form').each do |f|
+ hr = f.attributes['action']
- fname = f.attributes['name']
- if fname.empty?
- fname = "NONE"
- end
+ fname = f.attributes['name']
+ if fname.empty?
+ fname = "NONE"
+ end
- m = "GET"
- if !f.attributes['method'].empty?
- m = f.attributes['method'].upcase
- end
+ m = "GET"
+ if !f.attributes['method'].empty?
+ m = f.attributes['method'].upcase
+ end
- #puts "Parsing form name: #{fname} (#{m})"
+ #puts "Parsing form name: #{fname} (#{m})"
- htmlform = Hpricot(f.inner_html)
+ htmlform = Hpricot(f.inner_html)
- arrdata = []
+ arrdata = []
- htmlform.search('input').each do |p|
- #puts p.attributes['name']
- #puts p.attributes['type']
- #puts p.attributes['value']
+ htmlform.search('input').each do |p|
+ #puts p.attributes['name']
+ #puts p.attributes['type']
+ #puts p.attributes['value']
- #raw_request has uri_encoding disabled as it encodes '='.
- arrdata << (p.attributes['name'] + "=" + Rex::Text.uri_encode(p.attributes['value']))
- end
+ #raw_request has uri_encoding disabled as it encodes '='.
+ arrdata << (p.attributes['name'] + "=" + Rex::Text.uri_encode(p.attributes['value']))
+ end
- data = arrdata.join("&").to_s
+ data = arrdata.join("&").to_s
- begin
- hreq = urltohash(m,hr,request['uri'],data)
+ begin
+ hreq = urltohash(m,hr,request['uri'],data)
- hreq['ctype'] = 'application/x-www-form-urlencoded'
+ hreq['ctype'] = 'application/x-www-form-urlencoded'
- insertnewpath(hreq)
+ insertnewpath(hreq)
- rescue URI::InvalidURIError
- #puts "Parse error"
- #puts "Error: #{link[0]}"
- end
- end
- end
+ rescue URI::InvalidURIError
+ #puts "Parse error"
+ #puts "Error: #{link[0]}"
+ end
+ end
+ end
end
diff --git a/data/msfcrawler/frames.rb b/data/msfcrawler/frames.rb
index 3284c9b9c2..c6d2cbe03a 100755
--- a/data/msfcrawler/frames.rb
+++ b/data/msfcrawler/frames.rb
@@ -14,28 +14,28 @@ require 'uri'
class CrawlerFrames < BaseParser
- def parse(request,result)
+ def parse(request,result)
- if !result['Content-Type'].include? "text/html"
- return
- end
+ if !result['Content-Type'].include? "text/html"
+ return
+ end
- doc = Hpricot(result.body.to_s)
- doc.search('iframe').each do |ifra|
+ doc = Hpricot(result.body.to_s)
+ doc.search('iframe').each do |ifra|
- ir = ifra.attributes['src']
+ ir = ifra.attributes['src']
- if ir and !ir.match(/^(\#|javascript\:)/)
- begin
- hreq = urltohash('GET',ir,request['uri'],nil)
+ if ir and !ir.match(/^(\#|javascript\:)/)
+ begin
+ hreq = urltohash('GET',ir,request['uri'],nil)
- insertnewpath(hreq)
+ insertnewpath(hreq)
- rescue URI::InvalidURIError
- #puts "Error"
- end
- end
- end
- end
+ rescue URI::InvalidURIError
+ #puts "Error"
+ end
+ end
+ end
+ end
end
diff --git a/data/msfcrawler/image.rb b/data/msfcrawler/image.rb
index a02b7593be..0cc2aefb39 100755
--- a/data/msfcrawler/image.rb
+++ b/data/msfcrawler/image.rb
@@ -15,29 +15,29 @@ require 'uri'
class CrawlerImage < BaseParser
- def parse(request,result)
+ def parse(request,result)
- if !result['Content-Type'].include? "text/html"
- return
- end
+ if !result['Content-Type'].include? "text/html"
+ return
+ end
- doc = Hpricot(result.body.to_s)
- doc.search('img').each do |i|
+ doc = Hpricot(result.body.to_s)
+ doc.search('img').each do |i|
- im = i.attributes['src']
+ im = i.attributes['src']
- if im and !im.match(/^(\#|javascript\:)/)
- begin
- hreq = urltohash('GET',im,request['uri'],nil)
+ if im and !im.match(/^(\#|javascript\:)/)
+ begin
+ hreq = urltohash('GET',im,request['uri'],nil)
- insertnewpath(hreq)
+ insertnewpath(hreq)
- rescue URI::InvalidURIError
- #puts "Parse error"
- #puts "Error: #{i[0]}"
- end
- end
- end
- end
+ rescue URI::InvalidURIError
+ #puts "Parse error"
+ #puts "Error: #{i[0]}"
+ end
+ end
+ end
+ end
end
diff --git a/data/msfcrawler/link.rb b/data/msfcrawler/link.rb
index e99fcfba8d..543fdad2c3 100755
--- a/data/msfcrawler/link.rb
+++ b/data/msfcrawler/link.rb
@@ -15,29 +15,29 @@ require 'uri'
class CrawlerLink < BaseParser
- def parse(request,result)
+ def parse(request,result)
- if !result['Content-Type'].include? "text/html"
- return
- end
+ if !result['Content-Type'].include? "text/html"
+ return
+ end
- doc = Hpricot(result.body.to_s)
- doc.search('link').each do |link|
+ doc = Hpricot(result.body.to_s)
+ doc.search('link').each do |link|
- hr = link.attributes['href']
+ hr = link.attributes['href']
- if hr and !hr.match(/^(\#|javascript\:)/)
- begin
- hreq = urltohash('GET',hr,request['uri'],nil)
+ if hr and !hr.match(/^(\#|javascript\:)/)
+ begin
+ hreq = urltohash('GET',hr,request['uri'],nil)
- insertnewpath(hreq)
+ insertnewpath(hreq)
- rescue URI::InvalidURIError
- #puts "Parse error"
- #puts "Error: #{link[0]}"
- end
- end
- end
- end
+ rescue URI::InvalidURIError
+ #puts "Parse error"
+ #puts "Error: #{link[0]}"
+ end
+ end
+ end
+ end
end
diff --git a/data/msfcrawler/objects.rb b/data/msfcrawler/objects.rb
index 86b66d05be..68a53e2382 100755
--- a/data/msfcrawler/objects.rb
+++ b/data/msfcrawler/objects.rb
@@ -18,31 +18,31 @@ require 'uri'
class CrawlerObjects < BaseParser
- def parse(request,result)
+ def parse(request,result)
- if !result['Content-Type'].include? "text/html"
- return
- end
+ if !result['Content-Type'].include? "text/html"
+ return
+ end
- hr = ''
- m = ''
+ hr = ''
+ m = ''
- doc = Hpricot(result.body.to_s)
- doc.search("//object/embed").each do |obj|
+ doc = Hpricot(result.body.to_s)
+ doc.search("//object/embed").each do |obj|
- s = obj['src']
+ s = obj['src']
- begin
- hreq = urltohash('GET',s,request['uri'],nil)
+ begin
+ hreq = urltohash('GET',s,request['uri'],nil)
- insertnewpath(hreq)
+ insertnewpath(hreq)
- rescue URI::InvalidURIError
- #puts "Parse error"
- #puts "Error: #{link[0]}"
- end
- end
- end
+ rescue URI::InvalidURIError
+ #puts "Parse error"
+ #puts "Error: #{link[0]}"
+ end
+ end
+ end
end
diff --git a/data/msfcrawler/scripts.rb b/data/msfcrawler/scripts.rb
index e5a043f400..3789842344 100755
--- a/data/msfcrawler/scripts.rb
+++ b/data/msfcrawler/scripts.rb
@@ -18,31 +18,31 @@ require 'uri'
class CrawlerScripts < BaseParser
- def parse(request,result)
+ def parse(request,result)
- if !result['Content-Type'].include? "text/html"
- return
- end
+ if !result['Content-Type'].include? "text/html"
+ return
+ end
- hr = ''
- m = ''
+ hr = ''
+ m = ''
- doc = Hpricot(result.body.to_s)
- doc.search("//script").each do |obj|
+ doc = Hpricot(result.body.to_s)
+ doc.search("//script").each do |obj|
- s = obj['src']
+ s = obj['src']
- begin
- hreq = urltohash('GET',s,request['uri'],nil)
+ begin
+ hreq = urltohash('GET',s,request['uri'],nil)
- insertnewpath(hreq)
+ insertnewpath(hreq)
- rescue URI::InvalidURIError
- #puts "Parse error"
- #puts "Error: #{link[0]}"
- end
- end
- end
+ rescue URI::InvalidURIError
+ #puts "Parse error"
+ #puts "Error: #{link[0]}"
+ end
+ end
+ end
end
diff --git a/data/sounds/aiff2wav.rb b/data/sounds/aiff2wav.rb
index 76c323dd43..b2020875cd 100755
--- a/data/sounds/aiff2wav.rb
+++ b/data/sounds/aiff2wav.rb
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
Dir.open(".").entries.grep(/.aiff$/).each do |inp|
- out = inp.gsub(".aiff", ".wav")
- system("sox #{inp} #{out}")
+ out = inp.gsub(".aiff", ".wav")
+ system("sox #{inp} #{out}")
end
diff --git a/data/sounds/gensounds_mac.rb b/data/sounds/gensounds_mac.rb
index ae8516fd57..dc63ac1ba5 100755
--- a/data/sounds/gensounds_mac.rb
+++ b/data/sounds/gensounds_mac.rb
@@ -1,34 +1,34 @@
sounds = {
- 'num0' => '0',
- 'num1' => '1',
- 'num2' => '2',
- 'num3' => '3',
- 'num4' => '4',
- 'num5' => '5',
- 'num6' => '6',
- 'num7' => '7',
- 'num8' => '8',
- 'num9' => '9',
- 'closed' => 'closed',
- 'opened' => 'opened',
- 'plugin_load' => 'meta sploit sound plugin has been loaded',
- 'plugin_unload' => 'sound plugin has been unloaded',
- 'session' => 'session',
- 'address' => 'address',
- 'port' => 'port',
- 'dot' => 'dot',
- 'session_open_meterpreter' => 'a new meterp reter session has been opened',
- 'session_open_shell' => 'a new command shell session has been opened',
- 'session_open_vnc' => 'a new VNC session has been opened'
+ 'num0' => '0',
+ 'num1' => '1',
+ 'num2' => '2',
+ 'num3' => '3',
+ 'num4' => '4',
+ 'num5' => '5',
+ 'num6' => '6',
+ 'num7' => '7',
+ 'num8' => '8',
+ 'num9' => '9',
+ 'closed' => 'closed',
+ 'opened' => 'opened',
+ 'plugin_load' => 'meta sploit sound plugin has been loaded',
+ 'plugin_unload' => 'sound plugin has been unloaded',
+ 'session' => 'session',
+ 'address' => 'address',
+ 'port' => 'port',
+ 'dot' => 'dot',
+ 'session_open_meterpreter' => 'a new meterp reter session has been opened',
+ 'session_open_shell' => 'a new command shell session has been opened',
+ 'session_open_vnc' => 'a new VNC session has been opened'
}
voice_name = 'Zarvox'
def create_aiff(voice, file,text)
- system("say -v #{voice} -o #{file}.aiff #{text}")
+ system("say -v #{voice} -o #{file}.aiff #{text}")
end
sounds.keys.each do |k|
- create_aiff(voice_name, k, sounds[k])
+ create_aiff(voice_name, k, sounds[k])
end
diff --git a/documentation/samples/framework/dump_module_info.rb b/documentation/samples/framework/dump_module_info.rb
index 2666c364c7..35877764a1 100755
--- a/documentation/samples/framework/dump_module_info.rb
+++ b/documentation/samples/framework/dump_module_info.rb
@@ -13,22 +13,22 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib'))
require 'msf/base'
if (ARGV.empty?)
- puts "Usage: #{File.basename(__FILE__)} module_name"
- exit
+ puts "Usage: #{File.basename(__FILE__)} module_name"
+ exit
end
modname = ARGV.shift
framework = Msf::Simple::Framework.create
begin
- # Create the module instance.
- mod = framework.modules.create(modname)
- if not mod
- puts "Error: The specified Msf::Module, \"#{modname}\", was not found."
- else
- # Dump the module's information in readable text format.
- puts Msf::Serializer::ReadableText.dump_module(mod)
- end
+ # Create the module instance.
+ mod = framework.modules.create(modname)
+ if not mod
+ puts "Error: The specified Msf::Module, \"#{modname}\", was not found."
+ else
+ # Dump the module's information in readable text format.
+ puts Msf::Serializer::ReadableText.dump_module(mod)
+ end
rescue
- puts "Error: #{$!}\n\n#{$@.join("\n")}"
+ puts "Error: #{$!}\n\n#{$@.join("\n")}"
end
diff --git a/documentation/samples/framework/encode_file.rb b/documentation/samples/framework/encode_file.rb
index 70bf79e7d8..b004ed4f63 100755
--- a/documentation/samples/framework/encode_file.rb
+++ b/documentation/samples/framework/encode_file.rb
@@ -13,18 +13,18 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib'))
require 'msf/base'
if (ARGV.empty?)
- puts "Usage: #{File.basename(__FILE__)} encoder_name file_name format"
- exit
+ puts "Usage: #{File.basename(__FILE__)} encoder_name file_name format"
+ exit
end
framework = Msf::Simple::Framework.create
begin
- # Create the encoder instance.
- mod = framework.encoders.create(ARGV.shift)
+ # Create the encoder instance.
+ mod = framework.encoders.create(ARGV.shift)
- puts(Msf::Simple::Buffer.transform(
- mod.encode(IO.read(ARGV.shift)), ARGV.shift || 'ruby'))
+ puts(Msf::Simple::Buffer.transform(
+ mod.encode(IO.read(ARGV.shift)), ARGV.shift || 'ruby'))
rescue
- puts "Error: #{$!}\n\n#{$@.join("\n")}"
+ puts "Error: #{$!}\n\n#{$@.join("\n")}"
end
diff --git a/documentation/samples/framework/enumerate_modules.rb b/documentation/samples/framework/enumerate_modules.rb
index 903a918040..ad4ea6fd64 100755
--- a/documentation/samples/framework/enumerate_modules.rb
+++ b/documentation/samples/framework/enumerate_modules.rb
@@ -16,5 +16,5 @@ framework = Msf::Simple::Framework.create
# Enumerate each module in the framework.
framework.modules.each_module { |name, mod|
- puts "#{mod.type}: #{name}"
+ puts "#{mod.type}: #{name}"
}
diff --git a/documentation/samples/framework/run_exploit_using_base.rb b/documentation/samples/framework/run_exploit_using_base.rb
index 0a6f2a6b8b..29f61c1ead 100755
--- a/documentation/samples/framework/run_exploit_using_base.rb
+++ b/documentation/samples/framework/run_exploit_using_base.rb
@@ -14,8 +14,8 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib'))
require 'msf/base'
if (ARGV.length == 0)
- puts "Usage: #{File.basename(__FILE__)} exploit_name payload_name OPTIONS"
- exit
+ puts "Usage: #{File.basename(__FILE__)} exploit_name payload_name OPTIONS"
+ exit
end
framework = Msf::Simple::Framework.create
@@ -25,28 +25,28 @@ input = Rex::Ui::Text::Input::Stdio.new
output = Rex::Ui::Text::Output::Stdio.new
begin
- # Initialize the exploit instance
- exploit = framework.exploits.create(exploit_name)
+ # Initialize the exploit instance
+ exploit = framework.exploits.create(exploit_name)
- # Fire it off.
- session = exploit.exploit_simple(
- 'Payload' => payload_name,
- 'OptionStr' => ARGV.join(' '),
- 'LocalInput' => input,
- 'LocalOutput' => output)
+ # Fire it off.
+ session = exploit.exploit_simple(
+ 'Payload' => payload_name,
+ 'OptionStr' => ARGV.join(' '),
+ 'LocalInput' => input,
+ 'LocalOutput' => output)
- # If a session came back, try to interact with it.
- if (session)
- output.print_status("Session #{session.sid} created, interacting...")
- output.print_line
+ # If a session came back, try to interact with it.
+ if (session)
+ output.print_status("Session #{session.sid} created, interacting...")
+ output.print_line
- session.init_ui(input, output)
+ session.init_ui(input, output)
- session.interact
- else
- output.print_line("Exploit completed, no session was created.")
- end
+ session.interact
+ else
+ output.print_line("Exploit completed, no session was created.")
+ end
rescue
- output.print_error("Error: #{$!}\n\n#{$@.join("\n")}")
+ output.print_error("Error: #{$!}\n\n#{$@.join("\n")}")
end
diff --git a/documentation/samples/framework/run_exploit_using_core.rb b/documentation/samples/framework/run_exploit_using_core.rb
index 731aaac3c9..d2fd0b5a5d 100755
--- a/documentation/samples/framework/run_exploit_using_core.rb
+++ b/documentation/samples/framework/run_exploit_using_core.rb
@@ -15,8 +15,8 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib'))
require 'msf/base'
if (ARGV.length == 0)
- puts "Usage: #{File.basename(__FILE__)} exploit_name payload_name OPTIONS"
- exit
+ puts "Usage: #{File.basename(__FILE__)} exploit_name payload_name OPTIONS"
+ exit
end
framework = Msf::Simple::Framework.create
@@ -26,43 +26,43 @@ input = Rex::Ui::Text::Input::Stdio.new
output = Rex::Ui::Text::Output::Stdio.new
begin
- # Create the exploit driver instance.
- driver = Msf::ExploitDriver.new(framework)
+ # Create the exploit driver instance.
+ driver = Msf::ExploitDriver.new(framework)
- # Initialize the exploit driver's exploit and payload instance
- driver.exploit = framework.exploits.create(exploit_name)
- driver.payload = framework.payloads.create(payload_name)
+ # Initialize the exploit driver's exploit and payload instance
+ driver.exploit = framework.exploits.create(exploit_name)
+ driver.payload = framework.payloads.create(payload_name)
- # Import options specified in VAR=VAL format from the supplied command
- # line.
- driver.exploit.datastore.import_options_from_s(ARGV.join(' '))
+ # Import options specified in VAR=VAL format from the supplied command
+ # line.
+ driver.exploit.datastore.import_options_from_s(ARGV.join(' '))
- # Share the exploit's datastore with the payload.
- driver.payload.share_datastore(driver.exploit.datastore)
+ # Share the exploit's datastore with the payload.
+ driver.payload.share_datastore(driver.exploit.datastore)
- # Initialize the target index to what's in the exploit's data store or
- # zero by default.
- driver.target_idx = (driver.exploit.datastore['TARGET'] || 0).to_i
+ # Initialize the target index to what's in the exploit's data store or
+ # zero by default.
+ driver.target_idx = (driver.exploit.datastore['TARGET'] || 0).to_i
- # Initialize the exploit and payload user interfaces.
- driver.exploit.init_ui(input, output)
- driver.payload.init_ui(input, output)
+ # Initialize the exploit and payload user interfaces.
+ driver.exploit.init_ui(input, output)
+ driver.payload.init_ui(input, output)
- # Fire it off.
- session = driver.run
+ # Fire it off.
+ session = driver.run
- # If a session came back, try to interact with it.
- if (session)
- output.print_status("Session #{session.sid} created, interacting...")
- output.print_line
+ # If a session came back, try to interact with it.
+ if (session)
+ output.print_status("Session #{session.sid} created, interacting...")
+ output.print_line
- session.init_ui(input, output)
+ session.init_ui(input, output)
- session.interact
- else
- output.print_line("Exploit completed, no session was created.")
- end
+ session.interact
+ else
+ output.print_line("Exploit completed, no session was created.")
+ end
rescue
- output.print_error("Error: #{$!}\n\n#{$@.join("\n")}")
+ output.print_error("Error: #{$!}\n\n#{$@.join("\n")}")
end
diff --git a/documentation/samples/modules/auxiliary/sample.rb b/documentation/samples/modules/auxiliary/sample.rb
index 976f5d0f95..e8b2a39980 100644
--- a/documentation/samples/modules/auxiliary/sample.rb
+++ b/documentation/samples/modules/auxiliary/sample.rb
@@ -15,31 +15,31 @@ require 'msf/core'
###
class Metasploit4 < Msf::Auxiliary
- def initialize(info={})
- super(update_info(info,
- 'Name' => 'Sample Auxiliary Module',
- 'Description' => 'Sample Auxiliary Module',
- 'Author' => ['hdm'],
- 'License' => MSF_LICENSE,
- 'Actions' =>
- [
- ['Default Action'],
- ['Another Action']
- ]
- ))
+ def initialize(info={})
+ super(update_info(info,
+ 'Name' => 'Sample Auxiliary Module',
+ 'Description' => 'Sample Auxiliary Module',
+ 'Author' => ['hdm'],
+ 'License' => MSF_LICENSE,
+ 'Actions' =>
+ [
+ ['Default Action'],
+ ['Another Action']
+ ]
+ ))
- end
+ end
- def run
- print_status("Running the simple auxiliary module with action #{action.name}")
- end
+ def run
+ print_status("Running the simple auxiliary module with action #{action.name}")
+ end
- def auxiliary_commands
- return { "aux_extra_command" => "Run this auxiliary test commmand" }
- end
+ def auxiliary_commands
+ return { "aux_extra_command" => "Run this auxiliary test commmand" }
+ end
- def cmd_aux_extra_command(*args)
- print_status("Running inside aux_extra_command()")
- end
+ def cmd_aux_extra_command(*args)
+ print_status("Running inside aux_extra_command()")
+ end
end
diff --git a/documentation/samples/modules/encoders/sample.rb b/documentation/samples/modules/encoders/sample.rb
index 9ca09565e0..f60dde2e36 100644
--- a/documentation/samples/modules/encoders/sample.rb
+++ b/documentation/samples/modules/encoders/sample.rb
@@ -13,23 +13,23 @@
###
class Metasploit4 < Msf::Encoder
- def initialize
- super(
- 'Name' => 'Sample Encoder',
- 'Description' => %q{
- Sample encoder that just returns the block it's passed
- when encoding occurs.
- },
- 'License' => MSF_LICENSE,
- 'Author' => 'skape',
- 'Arch' => ARCH_ALL)
- end
+ def initialize
+ super(
+ 'Name' => 'Sample Encoder',
+ 'Description' => %q{
+ Sample encoder that just returns the block it's passed
+ when encoding occurs.
+ },
+ 'License' => MSF_LICENSE,
+ 'Author' => 'skape',
+ 'Arch' => ARCH_ALL)
+ end
- #
- # Returns the unmodified buffer to the caller.
- #
- def encode_block(state, buf)
- buf
- end
+ #
+ # Returns the unmodified buffer to the caller.
+ #
+ def encode_block(state, buf)
+ buf
+ end
end
diff --git a/documentation/samples/modules/exploits/ie_browser.rb b/documentation/samples/modules/exploits/ie_browser.rb
index bc3131d756..3580436400 100644
--- a/documentation/samples/modules/exploits/ie_browser.rb
+++ b/documentation/samples/modules/exploits/ie_browser.rb
@@ -15,133 +15,133 @@ require 'msf/core'
#
###
class Metasploit4 < Msf::Exploit::Remote
- Rank = NormalRanking
+ Rank = NormalRanking
- include Msf::Exploit::Remote::HttpServer::HTML
- include Msf::Exploit::RopDb
- include Msf::Exploit::Remote::BrowserAutopwn
+ include Msf::Exploit::Remote::HttpServer::HTML
+ include Msf::Exploit::RopDb
+ include Msf::Exploit::Remote::BrowserAutopwn
- # Set :classid and :method for ActiveX exploits. For example:
- # :classid => "{C3B92104-B5A7-11D0-A37F-00A0248F0AF1}",
- # :method => "SetShapeNodeType",
- autopwn_info({
- :ua_name => HttpClients::IE,
- :ua_minver => "8.0",
- :ua_maxver => "10.0",
- :javascript => true,
- :os_name => OperatingSystems::WINDOWS,
- :rank => NormalRanking
- })
+ # Set :classid and :method for ActiveX exploits. For example:
+ # :classid => "{C3B92104-B5A7-11D0-A37F-00A0248F0AF1}",
+ # :method => "SetShapeNodeType",
+ autopwn_info({
+ :ua_name => HttpClients::IE,
+ :ua_minver => "8.0",
+ :ua_maxver => "10.0",
+ :javascript => true,
+ :os_name => OperatingSystems::WINDOWS,
+ :rank => NormalRanking
+ })
- def initialize(info={})
- super(update_info(info,
- 'Name' => "Module Name",
- 'Description' => %q{
- This template covers IE8/9/10, and uses the user-agent HTTP header to detect
- the browser version. Please note IE8 and newer may emulate an older IE version
- in compatibility mode, in that case the module won't be able to detect the
- browser correctly.
- },
- 'License' => MSF_LICENSE,
- 'Author' => [ 'sinn3r' ],
- 'References' =>
- [
- [ 'URL', 'http://metasploit.com' ]
- ],
- 'Platform' => 'win',
- 'Targets' =>
- [
- [ 'Automatic', {} ],
- [ 'IE 8 on Windows XP SP3', { 'Rop' => :jre } ],
- [ 'IE 8 on Windows Vista', { 'Rop' => :jre } ],
- [ 'IE 8 on Windows 7', { 'Rop' => :jre } ],
- [ 'IE 9 on Windows 7', { 'Rop' => :jre } ],
- [ 'IE 10 on Windows 8', { 'Rop' => :jre } ]
- ],
- 'Payload' =>
- {
- 'BadChars' => "\x00", # js_property_spray
- 'StackAdjustment' => -3500
- },
- 'Privileged' => false,
- 'DisclosureDate' => "Apr 1 2013",
- 'DefaultTarget' => 0))
- end
+ def initialize(info={})
+ super(update_info(info,
+ 'Name' => "Module Name",
+ 'Description' => %q{
+ This template covers IE8/9/10, and uses the user-agent HTTP header to detect
+ the browser version. Please note IE8 and newer may emulate an older IE version
+ in compatibility mode, in that case the module won't be able to detect the
+ browser correctly.
+ },
+ 'License' => MSF_LICENSE,
+ 'Author' => [ 'sinn3r' ],
+ 'References' =>
+ [
+ [ 'URL', 'http://metasploit.com' ]
+ ],
+ 'Platform' => 'win',
+ 'Targets' =>
+ [
+ [ 'Automatic', {} ],
+ [ 'IE 8 on Windows XP SP3', { 'Rop' => :jre } ],
+ [ 'IE 8 on Windows Vista', { 'Rop' => :jre } ],
+ [ 'IE 8 on Windows 7', { 'Rop' => :jre } ],
+ [ 'IE 9 on Windows 7', { 'Rop' => :jre } ],
+ [ 'IE 10 on Windows 8', { 'Rop' => :jre } ]
+ ],
+ 'Payload' =>
+ {
+ 'BadChars' => "\x00", # js_property_spray
+ 'StackAdjustment' => -3500
+ },
+ 'Privileged' => false,
+ 'DisclosureDate' => "Apr 1 2013",
+ 'DefaultTarget' => 0))
+ end
- def get_target(agent)
- return target if target.name != 'Automatic'
+ def get_target(agent)
+ return target if target.name != 'Automatic'
- nt = agent.scan(/Windows NT (\d\.\d)/).flatten[0] || ''
- ie = agent.scan(/MSIE (\d)/).flatten[0] || ''
+ nt = agent.scan(/Windows NT (\d\.\d)/).flatten[0] || ''
+ ie = agent.scan(/MSIE (\d)/).flatten[0] || ''
- ie_name = "IE #{ie}"
+ ie_name = "IE #{ie}"
- case nt
- when '5.1'
- os_name = 'Windows XP SP3'
- when '6.0'
- os_name = 'Windows Vista'
- when '6.1'
- os_name = 'Windows 7'
- when '6.2'
- os_name = 'Windows 8'
- end
+ case nt
+ when '5.1'
+ os_name = 'Windows XP SP3'
+ when '6.0'
+ os_name = 'Windows Vista'
+ when '6.1'
+ os_name = 'Windows 7'
+ when '6.2'
+ os_name = 'Windows 8'
+ end
- targets.each do |t|
- if (!ie.empty? and t.name.include?(ie_name)) and (!nt.empty? and t.name.include?(os_name))
- return t
- end
- end
+ targets.each do |t|
+ if (!ie.empty? and t.name.include?(ie_name)) and (!nt.empty? and t.name.include?(os_name))
+ return t
+ end
+ end
- nil
- end
+ nil
+ end
- def get_payload(t)
- stack_pivot = "\x41\x42\x43\x44"
- code = payload.encoded
+ def get_payload(t)
+ stack_pivot = "\x41\x42\x43\x44"
+ code = payload.encoded
- case t['Rop']
- when :msvcrt
- print_status("Using msvcrt ROP")
- rop_payload = generate_rop_payload('msvcrt', code, {'pivot'=>stack_pivot, 'target'=>'xp'})
+ case t['Rop']
+ when :msvcrt
+ print_status("Using msvcrt ROP")
+ rop_payload = generate_rop_payload('msvcrt', code, {'pivot'=>stack_pivot, 'target'=>'xp'})
- else
- print_status("Using JRE ROP")
- rop_payload = generate_rop_payload('java', code, {'pivot'=>stack_pivot})
- end
+ else
+ print_status("Using JRE ROP")
+ rop_payload = generate_rop_payload('java', code, {'pivot'=>stack_pivot})
+ end
- rop_payload
- end
+ rop_payload
+ end
- def get_html(t)
- js_p = ::Rex::Text.to_unescape(get_payload(t), ::Rex::Arch.endian(t.arch))
- html = %Q|
-
- |
+ var s = unescape("#{js_p}");
+ sprayHeap({shellcode:s});
+
+ |
- html.gsub(/^\t\t/, '')
- end
+ html.gsub(/^\t\t/, '')
+ end
- def on_request_uri(cli, request)
- agent = request.headers['User-Agent']
- print_status("Requesting: #{request.uri}")
+ def on_request_uri(cli, request)
+ agent = request.headers['User-Agent']
+ print_status("Requesting: #{request.uri}")
- target = get_target(agent)
- if target.nil?
- print_error("Browser not supported, sending 404: #{agent}")
- send_not_found(cli)
- return
- end
+ target = get_target(agent)
+ if target.nil?
+ print_error("Browser not supported, sending 404: #{agent}")
+ send_not_found(cli)
+ return
+ end
- print_status("Target selected as: #{target.name}")
- html = get_html(target)
- send_response(cli, html, { 'Content-Type'=>'text/html', 'Cache-Control'=>'no-cache' })
- end
+ print_status("Target selected as: #{target.name}")
+ html = get_html(target)
+ send_response(cli, html, { 'Content-Type'=>'text/html', 'Cache-Control'=>'no-cache' })
+ end
end
diff --git a/documentation/samples/modules/exploits/sample.rb b/documentation/samples/modules/exploits/sample.rb
index e3cd52de57..081020fcd3 100644
--- a/documentation/samples/modules/exploits/sample.rb
+++ b/documentation/samples/modules/exploits/sample.rb
@@ -15,71 +15,71 @@ require 'msf/core'
###
class Metasploit4 < Msf::Exploit::Remote
- #
- # This exploit affects TCP servers, so we use the TCP client mixin.
- #
- include Exploit::Remote::Tcp
+ #
+ # This exploit affects TCP servers, so we use the TCP client mixin.
+ #
+ include Exploit::Remote::Tcp
- def initialize(info = {})
- super(update_info(info,
- 'Name' => 'Sample Exploit',
- 'Description' => %q{
- This exploit module illustrates how a vulnerability could be exploited
- in an TCP server that has a parsing bug.
- },
- 'License' => MSF_LICENSE,
- 'Author' => ['skape'],
- 'References' =>
- [
- ],
- 'Payload' =>
- {
- 'Space' => 1000,
- 'BadChars' => "\x00",
- },
- 'Targets' =>
- [
- # Target 0: Windows All
- [
- 'Windows XP/Vista/7/8',
- {
- 'Platform' => 'win',
- 'Ret' => 0x41424344
- }
- ],
- ],
- 'DisclosureDate' => "Apr 1 2013",
- 'DefaultTarget' => 0))
- end
+ def initialize(info = {})
+ super(update_info(info,
+ 'Name' => 'Sample Exploit',
+ 'Description' => %q{
+ This exploit module illustrates how a vulnerability could be exploited
+ in an TCP server that has a parsing bug.
+ },
+ 'License' => MSF_LICENSE,
+ 'Author' => ['skape'],
+ 'References' =>
+ [
+ ],
+ 'Payload' =>
+ {
+ 'Space' => 1000,
+ 'BadChars' => "\x00",
+ },
+ 'Targets' =>
+ [
+ # Target 0: Windows All
+ [
+ 'Windows XP/Vista/7/8',
+ {
+ 'Platform' => 'win',
+ 'Ret' => 0x41424344
+ }
+ ],
+ ],
+ 'DisclosureDate' => "Apr 1 2013",
+ 'DefaultTarget' => 0))
+ end
- #
- # The sample exploit just indicates that the remote host is always
- # vulnerable.
- #
- def check
- Exploit::CheckCode::Vulnerable
- end
+ #
+ # The sample exploit just indicates that the remote host is always
+ # vulnerable.
+ #
+ def check
+ Exploit::CheckCode::Vulnerable
+ end
- #
- # The exploit method connects to the remote service and sends 1024 random bytes
- # followed by the fake return address and then the payload.
- #
- def exploit
- connect
+ #
+ # The exploit method connects to the remote service and sends 1024 random bytes
+ # followed by the fake return address and then the payload.
+ #
+ def exploit
+ connect
- print_status("Sending #{payload.encoded.length} byte payload...")
+ print_status("Sending #{payload.encoded.length} byte payload...")
- # Build the buffer for transmission
- buf = rand_text_alpha(1024)
- buf << [ target.ret ].pack('V')
- buf << payload.encoded
+ # Build the buffer for transmission
+ buf = rand_text_alpha(1024)
+ buf << [ target.ret ].pack('V')
+ buf << payload.encoded
- # Send it off
- sock.put(buf)
- sock.get_once
+ # Send it off
+ sock.put(buf)
+ sock.get_once
- handler
- end
+ handler
+ end
end
diff --git a/documentation/samples/modules/nops/sample.rb b/documentation/samples/modules/nops/sample.rb
index ec171857c3..d24a87808b 100644
--- a/documentation/samples/modules/nops/sample.rb
+++ b/documentation/samples/modules/nops/sample.rb
@@ -15,20 +15,20 @@ require 'msf/core'
###
class Metasploit4 < Msf::Nop
- def initialize
- super(
- 'Name' => 'Sample NOP Generator',
- 'Description' => 'Sample single-byte NOP generator',
- 'License' => MSF_LICENSE,
- 'Author' => 'skape',
- 'Arch' => ARCH_X86)
- end
+ def initialize
+ super(
+ 'Name' => 'Sample NOP Generator',
+ 'Description' => 'Sample single-byte NOP generator',
+ 'License' => MSF_LICENSE,
+ 'Author' => 'skape',
+ 'Arch' => ARCH_X86)
+ end
- #
- # Returns a string of 0x90's for the supplied length.
- #
- def generate_sled(length, opts)
- "\x90" * length
- end
+ #
+ # Returns a string of 0x90's for the supplied length.
+ #
+ def generate_sled(length, opts)
+ "\x90" * length
+ end
end
diff --git a/documentation/samples/modules/payloads/singles/sample.rb b/documentation/samples/modules/payloads/singles/sample.rb
index ee23fd28fc..c79123c90e 100644
--- a/documentation/samples/modules/payloads/singles/sample.rb
+++ b/documentation/samples/modules/payloads/singles/sample.rb
@@ -14,21 +14,21 @@ require 'msf/core'
###
module Metasploit4
- include Msf::Payload::Single
+ include Msf::Payload::Single
- def initialize(info = {})
- super(update_info(info,
- 'Name' => 'Debugger Trap',
- 'Description' => 'Causes a debugger trap exception through int3',
- 'License' => MSF_LICENSE,
- 'Author' => 'skape',
- 'Platform' => 'win',
- 'Arch' => ARCH_X86,
- 'Payload' =>
- {
- 'Payload' => "\xcc"
- }
- ))
- end
+ def initialize(info = {})
+ super(update_info(info,
+ 'Name' => 'Debugger Trap',
+ 'Description' => 'Causes a debugger trap exception through int3',
+ 'License' => MSF_LICENSE,
+ 'Author' => 'skape',
+ 'Platform' => 'win',
+ 'Arch' => ARCH_X86,
+ 'Payload' =>
+ {
+ 'Payload' => "\xcc"
+ }
+ ))
+ end
end
diff --git a/documentation/samples/modules/post/sample.rb b/documentation/samples/modules/post/sample.rb
index fde58e237a..2729ced0bd 100644
--- a/documentation/samples/modules/post/sample.rb
+++ b/documentation/samples/modules/post/sample.rb
@@ -15,26 +15,26 @@ require 'msf/core/post/common'
###
class Metasploit4 < Msf::Post
- include Msf::Post::Common
+ include Msf::Post::Common
- def initialize(info={})
- super(update_info(info,
- 'Name' => 'Sample Post Module',
- 'Description' => %q{Sample Post Module},
- 'License' => MSF_LICENSE,
- 'Author' => [ 'sinn3r'],
- 'Platform' => [ 'win'],
- 'SessionTypes' => [ "shell", "meterpreter" ]
- ))
- end
+ def initialize(info={})
+ super(update_info(info,
+ 'Name' => 'Sample Post Module',
+ 'Description' => %q{Sample Post Module},
+ 'License' => MSF_LICENSE,
+ 'Author' => [ 'sinn3r'],
+ 'Platform' => [ 'win'],
+ 'SessionTypes' => [ "shell", "meterpreter" ]
+ ))
+ end
- #
- # This post module runs a ipconfig command and returns the output
- #
- def run
- print_status("Executing ipconfig on remote machine")
- o = cmd_exec("ipconfig")
- print_line(o)
- end
+ #
+ # This post module runs a ipconfig command and returns the output
+ #
+ def run
+ print_status("Executing ipconfig on remote machine")
+ o = cmd_exec("ipconfig")
+ print_line(o)
+ end
end
\ No newline at end of file
diff --git a/documentation/samples/pro/msfrpc_pro_discover.rb b/documentation/samples/pro/msfrpc_pro_discover.rb
index 2a4aa48a38..0613440855 100644
--- a/documentation/samples/pro/msfrpc_pro_discover.rb
+++ b/documentation/samples/pro/msfrpc_pro_discover.rb
@@ -5,19 +5,19 @@ require 'msfrpc-client'
require 'rex/ui'
def usage(ropts)
- $stderr.puts ropts
+ $stderr.puts ropts
- if @rpc and @rpc.token
- wspaces = @rpc.call("pro.workspaces") rescue {}
- if wspaces.keys.length > 0
- $stderr.puts "Active Projects:"
- wspaces.each_pair do |k,v|
- $stderr.puts "\t#{k}"
- end
- end
- end
- $stderr.puts ""
- exit(1)
+ if @rpc and @rpc.token
+ wspaces = @rpc.call("pro.workspaces") rescue {}
+ if wspaces.keys.length > 0
+ $stderr.puts "Active Projects:"
+ wspaces.each_pair do |k,v|
+ $stderr.puts "\t#{k}"
+ end
+ end
+ end
+ $stderr.puts ""
+ exit(1)
end
opts = {}
@@ -27,88 +27,88 @@ parser = Msf::RPC::Client.option_parser(opts)
parser.separator('Discover Mandatory Options:')
parser.on("--project PROJECT") do |x|
- opts[:project] = x
+ opts[:project] = x
end
parser.on("--targets TARGETS") do |x|
- opts[:targets] = [x]
+ opts[:targets] = [x]
end
parser.on("--blacklist BLACKLIST (optional)") do |x|
- opts[:blacklist] = x
+ opts[:blacklist] = x
end
parser.on("--speed SPEED (optional)") do |x|
- opts[:speed] = x
+ opts[:speed] = x
end
parser.on("--extra-ports PORTS (optional)") do |x|
- opts[:extra_ports] = x
+ opts[:extra_ports] = x
end
parser.on("--blacklist-ports PORTS (optional)") do |x|
- opts[:blacklist_ports] = x
+ opts[:blacklist_ports] = x
end
parser.on("--custom-ports PORTS (optional)") do |x|
- opts[:custom_ports] = x
+ opts[:custom_ports] = x
end
parser.on("--portscan-timeout TIMEOUT (optional)") do |x|
- opts[:portscan_timeout] = x
+ opts[:portscan_timeout] = x
end
parser.on("--source-port PORT (optional)") do |x|
- opts[:source_port] = x
+ opts[:source_port] = x
end
parser.on("--custom-nmap-options OPTIONS (optional)") do |x|
- opts[:custom_nmap_options] = x
+ opts[:custom_nmap_options] = x
end
parser.on("--disable-udp-probes (optional)") do
- opts[:disable_udp_probes] = true
+ opts[:disable_udp_probes] = true
end
parser.on("--disable-finger-users (optional)") do
- opts[:disable_finger_users] = true
+ opts[:disable_finger_users] = true
end
parser.on("--disable-snmp-scan (optional)") do
- opts[:disable_snmp_scan] = true
+ opts[:disable_snmp_scan] = true
end
parser.on("--disable-service-identification (optional)") do
- opts[:disable_service_identification] = true
+ opts[:disable_service_identification] = true
end
parser.on("--smb-user USER (optional)") do |x|
- opts[:smb_user] = x
+ opts[:smb_user] = x
end
parser.on("--smb-pass PASS (optional)") do |x|
- opts[:smb_pass] = x
+ opts[:smb_pass] = x
end
parser.on("--smb-domain DOMAIN (optional)") do |x|
- opts[:smb_domain] = x
+ opts[:smb_domain] = x
end
parser.on("--dry-run (optional)") do
- opts[:dry_run] = true
+ opts[:dry_run] = true
end
parser.on("--single-scan (optional)") do
- opts[:single_scan] = true
+ opts[:single_scan] = true
end
parser.on("--fast-detect (optional)") do
- opts[:fast_detect] = true
+ opts[:fast_detect] = true
end
parser.on("--help") do
- $stderr.puts parser
- exit(1)
+ $stderr.puts parser
+ exit(1)
end
parser.separator('')
@@ -117,9 +117,9 @@ parser.parse!(ARGV)
@rpc = Msf::RPC::Client.new(opts)
if not @rpc.token
- $stderr.puts "Error: Invalid RPC server options specified"
- $stderr.puts parser
- exit(1)
+ $stderr.puts "Error: Invalid RPC server options specified"
+ $stderr.puts parser
+ exit(1)
end
# Provide default values for certain options - If there's no alternative set
@@ -149,59 +149,59 @@ user = @rpc.call("pro.default_admin_user")['username']
# Create the task object with all options
task = @rpc.call("pro.start_discover", {
- 'workspace' => project,
- 'username' => user,
- 'ips' => targets,
- 'DS_BLACKLIST_HOSTS' => blacklist,
- 'DS_PORTSCAN_SPEED' => speed,
- 'DS_PORTS_EXTRA' => extra_ports,
- 'DS_PORTS_BLACKLIST' => blacklist_ports,
- 'DS_PORTS_CUSTOM' => custom_ports,
- 'DS_PORTSCAN_TIMEOUT' => portscan_timeout,
- 'DS_PORTSCAN_SOURCE_PORT' => source_port,
- 'DS_CustomNmap' => custom_nmap_options,
- 'DS_UDP_PROBES' => disable_udp_probes,
- 'DS_FINGER_USERS' => disable_finger_users,
- 'DS_SNMP_SCAN' => disable_snmp_scan,
- 'DS_IDENTIFY_SERVICES' => disable_service_identification,
- 'DS_SMBUser' => smb_user,
- 'DS_SMBPass' => smb_pass,
- 'DS_SMBDomain' => smb_domain,
- 'DS_SINGLE_SCAN' => single_scan,
- 'DS_FAST_DETECT' => fast_detect
+ 'workspace' => project,
+ 'username' => user,
+ 'ips' => targets,
+ 'DS_BLACKLIST_HOSTS' => blacklist,
+ 'DS_PORTSCAN_SPEED' => speed,
+ 'DS_PORTS_EXTRA' => extra_ports,
+ 'DS_PORTS_BLACKLIST' => blacklist_ports,
+ 'DS_PORTS_CUSTOM' => custom_ports,
+ 'DS_PORTSCAN_TIMEOUT' => portscan_timeout,
+ 'DS_PORTSCAN_SOURCE_PORT' => source_port,
+ 'DS_CustomNmap' => custom_nmap_options,
+ 'DS_UDP_PROBES' => disable_udp_probes,
+ 'DS_FINGER_USERS' => disable_finger_users,
+ 'DS_SNMP_SCAN' => disable_snmp_scan,
+ 'DS_IDENTIFY_SERVICES' => disable_service_identification,
+ 'DS_SMBUser' => smb_user,
+ 'DS_SMBPass' => smb_pass,
+ 'DS_SMBDomain' => smb_domain,
+ 'DS_SINGLE_SCAN' => single_scan,
+ 'DS_FAST_DETECT' => fast_detect
})
puts "DEBUG: Running task with #{task.inspect}"
if not task['task_id']
- $stderr.puts "[-] Error starting the task: #{task.inspect}"
- exit(0)
+ $stderr.puts "[-] Error starting the task: #{task.inspect}"
+ exit(0)
end
puts "[*] Creating Task ID #{task['task_id']}..."
while true
- select(nil, nil, nil, 0.50)
+ select(nil, nil, nil, 0.50)
- stat = @rpc.call("pro.task_status", task['task_id'])
+ stat = @rpc.call("pro.task_status", task['task_id'])
- if stat['status'] == 'invalid'
- $stderr.puts "[-] Error checking task status"
- exit(0)
- end
+ if stat['status'] == 'invalid'
+ $stderr.puts "[-] Error checking task status"
+ exit(0)
+ end
- info = stat[ task['task_id'] ]
+ info = stat[ task['task_id'] ]
- if not info
- $stderr.puts "[-] Error finding the task"
- exit(0)
- end
+ if not info
+ $stderr.puts "[-] Error finding the task"
+ exit(0)
+ end
- if info['status'] == "error"
- $stderr.puts "[-] Error generating report: #{info['error']}"
- exit(0)
- end
+ if info['status'] == "error"
+ $stderr.puts "[-] Error generating report: #{info['error']}"
+ exit(0)
+ end
- break if info['progress'] == 100
+ break if info['progress'] == 100
end
$stdout.puts "[+] Task Complete!"
diff --git a/documentation/samples/pro/msfrpc_pro_exploit.rb b/documentation/samples/pro/msfrpc_pro_exploit.rb
index bc3b3fc573..c24dc1b8c6 100644
--- a/documentation/samples/pro/msfrpc_pro_exploit.rb
+++ b/documentation/samples/pro/msfrpc_pro_exploit.rb
@@ -5,19 +5,19 @@ require 'msfrpc-client'
require 'rex/ui'
def usage(ropts)
- $stderr.puts ropts
+ $stderr.puts ropts
- if @rpc and @rpc.token
- wspaces = @rpc.call("pro.workspaces") rescue {}
- if wspaces.keys.length > 0
- $stderr.puts "Active Projects:"
- wspaces.each_pair do |k,v|
- $stderr.puts "\t#{k}"
- end
- end
- end
- $stderr.puts ""
- exit(1)
+ if @rpc and @rpc.token
+ wspaces = @rpc.call("pro.workspaces") rescue {}
+ if wspaces.keys.length > 0
+ $stderr.puts "Active Projects:"
+ wspaces.each_pair do |k,v|
+ $stderr.puts "\t#{k}"
+ end
+ end
+ end
+ $stderr.puts ""
+ exit(1)
end
opts = {}
@@ -43,88 +43,88 @@ parser = Msf::RPC::Client.option_parser(opts)
parser.separator('Exploit Specific Options:')
parser.on("--project PROJECT") do |x|
- opts[:project] = x
+ opts[:project] = x
end
parser.on("--targets TARGETS") do |x|
- opts[:targets] = x
+ opts[:targets] = x
end
parser.on("--speed SPEED") do |x|
- opts[:speed] = x
+ opts[:speed] = x
end
parser.on("--minimum-rank RANK") do |x|
- opts[:rank] = x
+ opts[:rank] = x
end
parser.on("--blacklist BLACKLIST (optional)") do |x|
- opts[:blacklist] = x
+ opts[:blacklist] = x
end
parser.on("--whitelist-ports PORTS (optional)") do |x|
- opts[:whitelist_ports] = x
+ opts[:whitelist_ports] = x
end
parser.on("--blacklist-ports PORTS (optional)") do |x|
- opts[:blacklist_ports] = x
+ opts[:blacklist_ports] = x
end
parser.on("--exploit-timeout TIMEOUT (optional)") do |x|
- opts[:exploit_timeout] = x
+ opts[:exploit_timeout] = x
end
parser.on("--limit-sessions (optional)") do |x|
- opts[:limit_sessions] = (x =~ /^(y|t|1)/i ? true : false )
+ opts[:limit_sessions] = (x =~ /^(y|t|1)/i ? true : false )
end
parser.on("--ignore-fragile-devices (optional)") do |x|
- opts[:ignore_fragile_devices] = (x =~ /^(y|t|1)/i ? true : false )
+ opts[:ignore_fragile_devices] = (x =~ /^(y|t|1)/i ? true : false )
end
parser.on("--filter-by-os (optional)") do |x|
- opts[:filter_by_os] = (x =~ /^(y|t|1)/i ? true : false )
+ opts[:filter_by_os] = (x =~ /^(y|t|1)/i ? true : false )
end
parser.on("--dry-run (optional)") do |x|
- opts[:only_match] = (x =~ /^(y|t|1)/i ? true : false )
+ opts[:only_match] = (x =~ /^(y|t|1)/i ? true : false )
end
parser.on("--match-vulns (optional)") do |x|
- opts[:match_vulns] = (x =~ /^(y|t|1)/i ? true : false )
+ opts[:match_vulns] = (x =~ /^(y|t|1)/i ? true : false )
end
parser.on("--match-ports (optional)") do |x|
- opts[:match_ports] = (x =~ /^(y|t|1)/i ? true : false )
+ opts[:match_ports] = (x =~ /^(y|t|1)/i ? true : false )
end
parser.on("--payload-method AUTO|REVERSE|BIND (optional)") do |x|
- opts[:payload_method] = x
+ opts[:payload_method] = x
end
parser.on("--payload-type METERPRETER|SHELL (optional)") do |x|
- opts[:payload_type] = x
+ opts[:payload_type] = x
end
parser.on("--payload-ports PORTS (optional)") do |x|
- opts[:payload_ports] = x
+ opts[:payload_ports] = x
end
parser.on("--evasion-level-tcp LEVEL (optional)") do |x|
- opts[:evasion_level_tcp] = x
+ opts[:evasion_level_tcp] = x
end
parser.on("--evasion-level-app LEVEL (optional)") do |x|
- opts[:evasion_level_app] = x
+ opts[:evasion_level_app] = x
end
parser.on("--module-filter FILTER (optional)") do |x|
- opts[:module_filter] = x
+ opts[:module_filter] = x
end
parser.on("--help") do
- $stderr.puts parser
- exit(1)
+ $stderr.puts parser
+ exit(1)
end
parser.separator('')
@@ -133,9 +133,9 @@ parser.parse!(ARGV)
@rpc = Msf::RPC::Client.new(opts)
if not @rpc.token
- $stderr.puts "Error: Invalid RPC server options specified"
- $stderr.puts parser
- exit(1)
+ $stderr.puts "Error: Invalid RPC server options specified"
+ $stderr.puts parser
+ exit(1)
end
# Store the user's settings
@@ -166,60 +166,60 @@ user = @rpc.call("pro.default_admin_user")['username']
# Create the task object with all options
task = @rpc.call("pro.start_exploit", {
- 'workspace' => project,
- 'username' => user,
- 'DS_WHITELIST_HOSTS' => targets,
- 'DS_BLACKLIST_HOSTS' => blacklist,
- 'DS_WHITELIST_PORTS' => whitelist_ports,
- 'DS_BLACKLIST_PORTS' => blacklist_ports,
- 'DS_MinimumRank' => rank,
- 'DS_EXPLOIT_SPEED' => speed,
- 'DS_EXPLOIT_TIMEOUT' => exploit_timeout,
- 'DS_LimitSessions' => limit_sessions,
- 'DS_IgnoreFragileDevices' => ignore_fragile_devices,
- 'DS_FilterByOS' => filter_by_os,
- 'DS_OnlyMatch' => only_match,
- 'DS_MATCH_VULNS' => match_vulns,
- 'DS_MATCH_PORTS' => match_ports,
- 'DS_PAYLOAD_METHOD' => payload_method,
- 'DS_PAYLOAD_TYPE' => payload_type,
- 'DS_PAYLOAD_PORTS' => payload_ports,
- 'DS_EVASION_LEVEL_TCP' => evasion_level_tcp,
- 'DS_EVASION_LEVEL_APP' => evasion_level_app,
- 'DS_ModuleFilter' => module_filter
+ 'workspace' => project,
+ 'username' => user,
+ 'DS_WHITELIST_HOSTS' => targets,
+ 'DS_BLACKLIST_HOSTS' => blacklist,
+ 'DS_WHITELIST_PORTS' => whitelist_ports,
+ 'DS_BLACKLIST_PORTS' => blacklist_ports,
+ 'DS_MinimumRank' => rank,
+ 'DS_EXPLOIT_SPEED' => speed,
+ 'DS_EXPLOIT_TIMEOUT' => exploit_timeout,
+ 'DS_LimitSessions' => limit_sessions,
+ 'DS_IgnoreFragileDevices' => ignore_fragile_devices,
+ 'DS_FilterByOS' => filter_by_os,
+ 'DS_OnlyMatch' => only_match,
+ 'DS_MATCH_VULNS' => match_vulns,
+ 'DS_MATCH_PORTS' => match_ports,
+ 'DS_PAYLOAD_METHOD' => payload_method,
+ 'DS_PAYLOAD_TYPE' => payload_type,
+ 'DS_PAYLOAD_PORTS' => payload_ports,
+ 'DS_EVASION_LEVEL_TCP' => evasion_level_tcp,
+ 'DS_EVASION_LEVEL_APP' => evasion_level_app,
+ 'DS_ModuleFilter' => module_filter
})
puts "DEBUG: Running task with #{task.inspect}"
if not task['task_id']
- $stderr.puts "[-] Error starting the task: #{task.inspect}"
- exit(0)
+ $stderr.puts "[-] Error starting the task: #{task.inspect}"
+ exit(0)
end
puts "[*] Creating Task ID #{task['task_id']}..."
while true
- select(nil, nil, nil, 0.50)
+ select(nil, nil, nil, 0.50)
- stat = @rpc.call("pro.task_status", task['task_id'])
+ stat = @rpc.call("pro.task_status", task['task_id'])
- if stat['status'] == 'invalid'
- $stderr.puts "[-] Error checking task status"
- exit(0)
- end
+ if stat['status'] == 'invalid'
+ $stderr.puts "[-] Error checking task status"
+ exit(0)
+ end
- info = stat[ task['task_id'] ]
+ info = stat[ task['task_id'] ]
- if not info
- $stderr.puts "[-] Error finding the task"
- exit(0)
- end
+ if not info
+ $stderr.puts "[-] Error finding the task"
+ exit(0)
+ end
- if info['status'] == "error"
- $stderr.puts "[-] Error generating report: #{info['error']}"
- exit(0)
- end
+ if info['status'] == "error"
+ $stderr.puts "[-] Error generating report: #{info['error']}"
+ exit(0)
+ end
- break if info['progress'] == 100
+ break if info['progress'] == 100
end
$stdout.puts "[+] Task Complete!"
diff --git a/documentation/samples/pro/msfrpc_pro_import.rb b/documentation/samples/pro/msfrpc_pro_import.rb
index d451fb76c6..b7c2c07604 100644
--- a/documentation/samples/pro/msfrpc_pro_import.rb
+++ b/documentation/samples/pro/msfrpc_pro_import.rb
@@ -5,18 +5,18 @@ require 'msfrpc-client'
require 'rex/ui'
def usage(ropts)
- $stderr.puts ropts
+ $stderr.puts ropts
- if @rpc and @rpc.token
- wspaces = @rpc.call("pro.workspaces") rescue {}
- if wspaces.keys.length > 0
- $stderr.puts "Active Projects:"
- wspaces.each_pair do |k,v|
- $stderr.puts "\t#{k}"
- end
- end
- end
- exit(1)
+ if @rpc and @rpc.token
+ wspaces = @rpc.call("pro.workspaces") rescue {}
+ if wspaces.keys.length > 0
+ $stderr.puts "Active Projects:"
+ wspaces.each_pair do |k,v|
+ $stderr.puts "\t#{k}"
+ end
+ end
+ end
+ exit(1)
end
opts = {}
@@ -26,16 +26,16 @@ parser = Msf::RPC::Client.option_parser(opts)
parser.separator('Task Options:')
parser.on("--path PATH") do |path|
- opts[:path] = path
+ opts[:path] = path
end
parser.on("--project PROJECT") do |project|
- opts[:project] = project
+ opts[:project] = project
end
parser.on("--help") do
- $stderr.puts parser
- exit(1)
+ $stderr.puts parser
+ exit(1)
end
parser.separator('')
@@ -43,49 +43,49 @@ parser.parse!(ARGV)
@rpc = Msf::RPC::Client.new(opts)
if not @rpc.token
- $stderr.puts "Error: Invalid RPC server options specified"
- $stderr.puts parser
- exit(1)
+ $stderr.puts "Error: Invalid RPC server options specified"
+ $stderr.puts parser
+ exit(1)
end
project = opts[:project] || usage(parser)
path = opts[:path] || usage(parser)
user = @rpc.call("pro.default_admin_user")['username']
task = @rpc.call("pro.start_import", {
- 'workspace' => project,
- 'username' => user,
- 'DS_PATH' => path
+ 'workspace' => project,
+ 'username' => user,
+ 'DS_PATH' => path
})
if not task['task_id']
- $stderr.puts "[-] Error starting the task: #{task.inspect}"
- exit(0)
+ $stderr.puts "[-] Error starting the task: #{task.inspect}"
+ exit(0)
end
puts "[*] Creating Task ID #{task['task_id']}..."
while true
- select(nil, nil, nil, 0.50)
+ select(nil, nil, nil, 0.50)
- stat = @rpc.call("pro.task_status", task['task_id'])
+ stat = @rpc.call("pro.task_status", task['task_id'])
- if stat['status'] == 'invalid'
- $stderr.puts "[-] Error checking task status"
- exit(0)
- end
+ if stat['status'] == 'invalid'
+ $stderr.puts "[-] Error checking task status"
+ exit(0)
+ end
- info = stat[ task['task_id'] ]
+ info = stat[ task['task_id'] ]
- if not info
- $stderr.puts "[-] Error finding the task"
- exit(0)
- end
+ if not info
+ $stderr.puts "[-] Error finding the task"
+ exit(0)
+ end
- if info['status'] == "error"
- $stderr.puts "[-] Error generating report: #{info['error']}"
- exit(0)
- end
+ if info['status'] == "error"
+ $stderr.puts "[-] Error generating report: #{info['error']}"
+ exit(0)
+ end
- break if info['progress'] == 100
+ break if info['progress'] == 100
end
$stdout.puts "[+] Task Complete!"
diff --git a/documentation/samples/pro/msfrpc_pro_nexpose.rb b/documentation/samples/pro/msfrpc_pro_nexpose.rb
index aa9d626723..4f6e1cb963 100644
--- a/documentation/samples/pro/msfrpc_pro_nexpose.rb
+++ b/documentation/samples/pro/msfrpc_pro_nexpose.rb
@@ -5,19 +5,19 @@ require 'msfrpc-client'
require 'rex/ui'
def usage(ropts)
- $stderr.puts ropts
+ $stderr.puts ropts
- if @rpc and @rpc.token
- wspaces = @rpc.call("pro.workspaces") rescue {}
- if wspaces.keys.length > 0
- $stderr.puts "Active Projects:"
- wspaces.each_pair do |k,v|
- $stderr.puts "\t#{k}"
- end
- end
- end
- $stderr.puts ""
- exit(1)
+ if @rpc and @rpc.token
+ wspaces = @rpc.call("pro.workspaces") rescue {}
+ if wspaces.keys.length > 0
+ $stderr.puts "Active Projects:"
+ wspaces.each_pair do |k,v|
+ $stderr.puts "\t#{k}"
+ end
+ end
+ end
+ $stderr.puts ""
+ exit(1)
end
opts = {}
@@ -27,44 +27,44 @@ parser = Msf::RPC::Client.option_parser(opts)
parser.separator('NeXpose Specific Options:')
parser.on("--project PROJECT") do |x|
- opts[:project] = x
+ opts[:project] = x
end
parser.on("--targets TARGETS") do |x|
- opts[:targets] = [x]
+ opts[:targets] = [x]
end
parser.on("--nexpose-host HOST") do |x|
- opts[:nexpose_host] = x
+ opts[:nexpose_host] = x
end
parser.on("--nexpose-user USER") do |x|
- opts[:nexpose_user] = x
+ opts[:nexpose_user] = x
end
parser.on("--nexpose-pass PASSWORD") do |x|
- opts[:nexpose_pass] = x
+ opts[:nexpose_pass] = x
end
parser.on("--nexpose-pass-file PATH") do |x|
- opts[:nexpose_pass_file] = x
+ opts[:nexpose_pass_file] = x
end
parser.on("--scan-template TEMPLATE (optional)") do |x|
- opts[:scan_template] = x
+ opts[:scan_template] = x
end
parser.on("--nexpose-port PORT (optional)") do |x|
- opts[:nexpose_port] = x
+ opts[:nexpose_port] = x
end
parser.on("--blacklist BLACKLIST (optional)") do |x|
- opts[:blacklist] = x
+ opts[:blacklist] = x
end
parser.on("--help") do
- $stderr.puts parser
- exit(1)
+ $stderr.puts parser
+ exit(1)
end
parser.separator('')
@@ -73,16 +73,16 @@ parser.parse!(ARGV)
@rpc = Msf::RPC::Client.new(opts)
if not @rpc.token
- $stderr.puts "Error: Invalid RPC server options specified"
- $stderr.puts parser
- exit(1)
+ $stderr.puts "Error: Invalid RPC server options specified"
+ $stderr.puts parser
+ exit(1)
end
# Get the password from the file
if opts[:nexpose_pass_file]
- nexpose_pass = File.open(opts[:nexpose_pass_file],"r").read.chomp!
+ nexpose_pass = File.open(opts[:nexpose_pass_file],"r").read.chomp!
else
- nexpose_pass = opts[:nexpose_pass] || usage(parser)
+ nexpose_pass = opts[:nexpose_pass] || usage(parser)
end
# Store the user's settings
@@ -98,14 +98,14 @@ scan_template = opts[:scan_template] || "pentest-audit"
user = @rpc.call("pro.default_admin_user")['username']
options = {
- 'workspace' => project,
- 'username' => user,
- 'DS_WHITELIST_HOSTS' => targets,
- 'DS_NEXPOSE_HOST' => nexpose_host,
- 'DS_NEXPOSE_PORT' => nexpose_port,
- 'DS_NEXPOSE_USER' => nexpose_user,
- 'nexpose_pass' => nexpose_pass,
- 'DS_SCAN_TEMPLATE' => scan_template
+ 'workspace' => project,
+ 'username' => user,
+ 'DS_WHITELIST_HOSTS' => targets,
+ 'DS_NEXPOSE_HOST' => nexpose_host,
+ 'DS_NEXPOSE_PORT' => nexpose_port,
+ 'DS_NEXPOSE_USER' => nexpose_user,
+ 'nexpose_pass' => nexpose_pass,
+ 'DS_SCAN_TEMPLATE' => scan_template
}
puts "DEBUG: Running task with #{options}"
@@ -115,34 +115,34 @@ task = @rpc.call("pro.start_exploit", options)
if not task['task_id']
- $stderr.puts "[-] Error starting the task: #{task.inspect}"
- exit(0)
+ $stderr.puts "[-] Error starting the task: #{task.inspect}"
+ exit(0)
end
puts "[*] Creating Task ID #{task['task_id']}..."
while true
- select(nil, nil, nil, 0.50)
+ select(nil, nil, nil, 0.50)
- stat = @rpc.call("pro.task_status", task['task_id'])
+ stat = @rpc.call("pro.task_status", task['task_id'])
- if stat['status'] == 'invalid'
- $stderr.puts "[-] Error checking task status"
- exit(0)
- end
+ if stat['status'] == 'invalid'
+ $stderr.puts "[-] Error checking task status"
+ exit(0)
+ end
- info = stat[ task['task_id'] ]
+ info = stat[ task['task_id'] ]
- if not info
- $stderr.puts "[-] Error finding the task"
- exit(0)
- end
+ if not info
+ $stderr.puts "[-] Error finding the task"
+ exit(0)
+ end
- if info['status'] == "error"
- $stderr.puts "[-] Error generating report: #{info['error']}"
- exit(0)
- end
+ if info['status'] == "error"
+ $stderr.puts "[-] Error generating report: #{info['error']}"
+ exit(0)
+ end
- break if info['progress'] == 100
+ break if info['progress'] == 100
end
$stdout.puts "[+] Task Complete!"
diff --git a/documentation/samples/pro/msfrpc_pro_report.rb b/documentation/samples/pro/msfrpc_pro_report.rb
index 824449519c..6095a8d7bb 100644
--- a/documentation/samples/pro/msfrpc_pro_report.rb
+++ b/documentation/samples/pro/msfrpc_pro_report.rb
@@ -6,43 +6,43 @@ require 'msfrpc-client'
require 'rex/ui'
def usage(ropts)
- $stderr.puts ropts
+ $stderr.puts ropts
- if @rpc and @rpc.token
- wspaces = @rpc.call("pro.workspaces") rescue {}
- if wspaces.keys.length > 0
- $stderr.puts "Active Projects:"
- wspaces.each_pair do |k,v|
- $stderr.puts "\t#{k}"
- end
- end
- end
- $stderr.puts ""
- exit(1)
+ if @rpc and @rpc.token
+ wspaces = @rpc.call("pro.workspaces") rescue {}
+ if wspaces.keys.length > 0
+ $stderr.puts "Active Projects:"
+ wspaces.each_pair do |k,v|
+ $stderr.puts "\t#{k}"
+ end
+ end
+ end
+ $stderr.puts ""
+ exit(1)
end
opts = {
- :format => 'PDF'
+ :format => 'PDF'
}
parser = Msf::RPC::Client.option_parser(opts)
parser.separator('Report Options:')
parser.on("--format FORMAT") do |v|
- opts[:format] = v.upcase
+ opts[:format] = v.upcase
end
parser.on("--project PROJECT") do |v|
- opts[:project] = v
+ opts[:project] = v
end
parser.on("--output OUTFILE") do |v|
- opts[:output] = v
+ opts[:output] = v
end
parser.on("--help") do
- $stderr.puts parser
- exit(1)
+ $stderr.puts parser
+ exit(1)
end
parser.separator('')
@@ -50,9 +50,9 @@ parser.parse!(ARGV)
@rpc = Msf::RPC::Client.new(opts)
if not @rpc.token
- $stderr.puts "Error: Invalid RPC server options specified"
- $stderr.puts parser
- exit(1)
+ $stderr.puts "Error: Invalid RPC server options specified"
+ $stderr.puts parser
+ exit(1)
end
project = opts[:project] || usage(parser)
@@ -61,66 +61,66 @@ rtype = opts[:format]
user = @rpc.call("pro.default_admin_user")['username']
task = @rpc.call("pro.start_report", {
- 'DS_WHITELIST_HOSTS' => "",
- 'DS_BLACKLIST_HOSTS' => "",
- 'workspace' => project,
- 'username' => user,
- 'DS_MaskPasswords' => false,
- 'DS_IncludeTaskLog' => false,
- 'DS_JasperDisplaySession' => true,
- 'DS_JasperDisplayCharts' => true,
- 'DS_LootExcludeScreenshots' => false,
- 'DS_LootExcludePasswords' => false,
- 'DS_JasperTemplate' => "msfxv3.jrxml",
- 'DS_REPORT_TYPE' => rtype.upcase,
- 'DS_UseJasper' => true,
- 'DS_UseCustomReporting' => true,
- 'DS_JasperProductName' => "Metasploit Pro",
- 'DS_JasperDbEnv' => "production",
- 'DS_JasperLogo' => '',
- 'DS_JasperDisplaySections' => "1,2,3,4,5,6,7,8",
- 'DS_EnablePCIReport' => true,
- 'DS_EnableFISMAReport' => true,
- 'DS_JasperDisplayWeb' => true,
+ 'DS_WHITELIST_HOSTS' => "",
+ 'DS_BLACKLIST_HOSTS' => "",
+ 'workspace' => project,
+ 'username' => user,
+ 'DS_MaskPasswords' => false,
+ 'DS_IncludeTaskLog' => false,
+ 'DS_JasperDisplaySession' => true,
+ 'DS_JasperDisplayCharts' => true,
+ 'DS_LootExcludeScreenshots' => false,
+ 'DS_LootExcludePasswords' => false,
+ 'DS_JasperTemplate' => "msfxv3.jrxml",
+ 'DS_REPORT_TYPE' => rtype.upcase,
+ 'DS_UseJasper' => true,
+ 'DS_UseCustomReporting' => true,
+ 'DS_JasperProductName' => "Metasploit Pro",
+ 'DS_JasperDbEnv' => "production",
+ 'DS_JasperLogo' => '',
+ 'DS_JasperDisplaySections' => "1,2,3,4,5,6,7,8",
+ 'DS_EnablePCIReport' => true,
+ 'DS_EnableFISMAReport' => true,
+ 'DS_JasperDisplayWeb' => true,
})
if not task['task_id']
- $stderr.puts "[-] Error generating the report: #{task.inspect}"
- exit(0)
+ $stderr.puts "[-] Error generating the report: #{task.inspect}"
+ exit(0)
end
puts "[*] Report is generating with Task ID #{task['task_id']}..."
while true
- select(nil, nil, nil, 0.50)
- stat = @rpc.call("pro.task_status", task['task_id'])
- if stat['status'] == 'invalid'
- $stderr.puts "[-] Error checking task status"
- exit(0)
- end
+ select(nil, nil, nil, 0.50)
+ stat = @rpc.call("pro.task_status", task['task_id'])
+ if stat['status'] == 'invalid'
+ $stderr.puts "[-] Error checking task status"
+ exit(0)
+ end
- info = stat[ task['task_id'] ]
+ info = stat[ task['task_id'] ]
- if not info
- $stderr.puts "[-] Error finding the task"
- exit(0)
- end
+ if not info
+ $stderr.puts "[-] Error finding the task"
+ exit(0)
+ end
- if info['status'] == "error"
- $stderr.puts "[-] Error generating report: #{info['error']}"
- exit(0)
- end
+ if info['status'] == "error"
+ $stderr.puts "[-] Error generating report: #{info['error']}"
+ exit(0)
+ end
- break if info['progress'] == 100
+ break if info['progress'] == 100
end
report = @rpc.call('pro.report_download_by_task', task['task_id'])
if report and report['data']
- ::File.open(fname, "wb") do |fd|
- fd.write(report['data'])
- end
- $stderr.puts "[-] Report saved to #{::File.expand_path(fname)}"
+ ::File.open(fname, "wb") do |fd|
+ fd.write(report['data'])
+ end
+ $stderr.puts "[-] Report saved to #{::File.expand_path(fname)}"
else
- $stderr.puts "[-] Error downloading report: #{report.inspect}"
+ $stderr.puts "[-] Error downloading report: #{report.inspect}"
end
diff --git a/documentation/samples/scripts/meterpreter_script_template.rb b/documentation/samples/scripts/meterpreter_script_template.rb
index e18cea5779..ee2affd11d 100644
--- a/documentation/samples/scripts/meterpreter_script_template.rb
+++ b/documentation/samples/scripts/meterpreter_script_template.rb
@@ -7,9 +7,9 @@
@client = client
sample_option_var = nil
@exec_opts = Rex::Parser::Arguments.new(
- "-h" => [ false, "Help menu." ],
- "-o" => [ true , "Option that requieres a value"]
- )
+ "-h" => [ false, "Help menu." ],
+ "-o" => [ true , "Option that requieres a value"]
+ )
meter_type = client.platform
################## Function Declarations ##################
@@ -17,26 +17,26 @@ meter_type = client.platform
# Usage Message Function
#-------------------------------------------------------------------------------
def usage
- print_line "Meterpreter Script for INSERT PURPOSE."
- print_line(@exec_opts.usage)
- raise Rex::Script::Completed
+ print_line "Meterpreter Script for INSERT PURPOSE."
+ print_line(@exec_opts.usage)
+ raise Rex::Script::Completed
end
# Wrong Meterpreter Version Message Function
#-------------------------------------------------------------------------------
def wrong_meter_version(meter = meter_type)
- print_error("#{meter} version of Meterpreter is not supported with this Script!")
- raise Rex::Script::Completed
+ print_error("#{meter} version of Meterpreter is not supported with this Script!")
+ raise Rex::Script::Completed
end
################## Main ##################
@exec_opts.parse(args) { |opt, idx, val|
- case opt
- when "-h"
- usage
- when "-o"
- sample_option_var = val
- end
+ case opt
+ when "-h"
+ usage
+ when "-o"
+ sample_option_var = val
+ end
}
# Check for Version of Meterpreter
diff --git a/documentation/samples/scripts/resource_script.rb b/documentation/samples/scripts/resource_script.rb
index a9d7fb6a56..8eedf949e5 100644
--- a/documentation/samples/scripts/resource_script.rb
+++ b/documentation/samples/scripts/resource_script.rb
@@ -15,27 +15,27 @@
# will have to do the trick for now.
#
def help
- msg = %Q|
- Description:
- Let's describe what this RC script is all about, plus anything the user should know before
- actually using it.
+ msg = %Q|
+ Description:
+ Let's describe what this RC script is all about, plus anything the user should know before
+ actually using it.
- Usage:
- msfconsole -r
+ Usage:
+ msfconsole -r
- Options:
- - I'm sure you already know
- - Username for the database (datastore: 'DB_USER')
- - Password for the database (datastore: 'DB_PASS')
- - Workspace for the database (datastore: 'DB_WORKSPACE')
- - Argument 1 (datastore: 'ARG1')
+ Options:
+ - I'm sure you already know
+ - Username for the database (datastore: 'DB_USER')
+ - Password for the database (datastore: 'DB_PASS')
+ - Workspace for the database (datastore: 'DB_WORKSPACE')
+ - Argument 1 (datastore: 'ARG1')
- Authors:
- sinn3r
- |
+ Authors:
+ sinn3r
+ |
- msg = msg.gsub(/^\t/, '')
- print_line(msg)
+ msg = msg.gsub(/^\t/, '')
+ print_line(msg)
end
@@ -43,12 +43,12 @@ end
# See if we're already connected
#
def is_db_active?
- begin
- framework.db.hosts
- return true
- rescue ::ActiveRecord::ConnectionNotEstablished
- return false
- end
+ begin
+ framework.db.hosts
+ return true
+ rescue ::ActiveRecord::ConnectionNotEstablished
+ return false
+ end
end
@@ -57,9 +57,9 @@ end
# Default to localhost:5432, as this is the default configuration suggested by the manual.
#
def init_db(username, password, workspace)
- db = "localhost:5432"
- print_status("Opening #{workspace} at #{db}")
- run_single("db_connect #{username}:#{password}@#{db}/#{workspace}")
+ db = "localhost:5432"
+ print_status("Opening #{workspace} at #{db}")
+ run_single("db_connect #{username}:#{password}@#{db}/#{workspace}")
end
@@ -67,30 +67,30 @@ end
# Initialize the argumets here
#
def init_args
- args = {}
+ args = {}
- joint = ARGV.join('')
- if joint =~ /^help$/i
- args[:help] = true
- return args
- end
+ joint = ARGV.join('')
+ if joint =~ /^help$/i
+ args[:help] = true
+ return args
+ end
- # Add more arguments according to your help() function
- datastore = framework.datastore
- args[:db_user] = ARGV.shift || datastore['DB_USER'] || ''
- args[:db_pass] = ARGV.shift || datastore['DB_PASS'] || ''
- args[:db_workspace] = ARGV.shift || datastore['DB_WORKSPACE'] || ''
- args[:arg1] = ARGV.shift || datastore['ARG1'] || ''
+ # Add more arguments according to your help() function
+ datastore = framework.datastore
+ args[:db_user] = ARGV.shift || datastore['DB_USER'] || ''
+ args[:db_pass] = ARGV.shift || datastore['DB_PASS'] || ''
+ args[:db_workspace] = ARGV.shift || datastore['DB_WORKSPACE'] || ''
+ args[:arg1] = ARGV.shift || datastore['ARG1'] || ''
- if not is_db_active?
- if args[:db_user].empty? or args[:db_pass].empty? or args[:db_workspace].empty?
- raise ArgumentError, "Need DB_USER, DB_PASS, and DB_WORKSPACE"
- end
- end
+ if not is_db_active?
+ if args[:db_user].empty? or args[:db_pass].empty? or args[:db_workspace].empty?
+ raise ArgumentError, "Need DB_USER, DB_PASS, and DB_WORKSPACE"
+ end
+ end
- raise ArgumentError, "Need ARG1" if args[:arg1].empty?
+ raise ArgumentError, "Need ARG1" if args[:arg1].empty?
- return args
+ return args
end
@@ -98,7 +98,7 @@ end
# This is your main function
#
def main(args)
- print_status("Initialzation is done, and here's your input: #{args[:arg1]}")
+ print_status("Initialzation is done, and here's your input: #{args[:arg1]}")
end
@@ -106,27 +106,27 @@ end
# Below initializes the arguments and database
#
begin
- args = init_args
- if args[:help]
- help
- return
- end
+ args = init_args
+ if args[:help]
+ help
+ return
+ end
- init_db(args[:db_user], args[:db_pass], args[:db_workspace]) if not is_db_active?
- main(args)
+ init_db(args[:db_user], args[:db_pass], args[:db_workspace]) if not is_db_active?
+ main(args)
rescue ArgumentError => e
- print_error("Bad argument(s): #{e.message}")
- return
+ print_error("Bad argument(s): #{e.message}")
+ return
rescue RuntimeError => e
- # Any runtime error should be raised as "RuntimeError"
- print_error(e.message)
- return
+ # Any runtime error should be raised as "RuntimeError"
+ print_error(e.message)
+ return
rescue ::Exception => e
- # Whatever unknown exception occurs, we raise it
- raise e
+ # Whatever unknown exception occurs, we raise it
+ raise e
end
\ No newline at end of file
diff --git a/modules/exploits/unix/webapp/arkeia_upload_exec.rb b/modules/exploits/unix/webapp/arkeia_upload_exec.rb
index 1a3e0771a0..dbff449b07 100644
--- a/modules/exploits/unix/webapp/arkeia_upload_exec.rb
+++ b/modules/exploits/unix/webapp/arkeia_upload_exec.rb
@@ -134,6 +134,6 @@ class Metasploit3 < Msf::Exploit::Remote
print_error("#{peer} - Unexpected response, probably the exploit failed")
end
- end
+ end
end
diff --git a/msfbinscan b/msfbinscan
index 442bf3e7f4..e9fe1dff76 100755
--- a/msfbinscan
+++ b/msfbinscan
@@ -7,7 +7,7 @@
msfbase = __FILE__
while File.symlink?(msfbase)
- msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
@@ -29,7 +29,7 @@ require 'rex/arch/x86'
require 'optparse'
def opt2i(o)
- o.index("0x")==0 ? o.hex : o.to_i
+ o.index("0x")==0 ? o.hex : o.to_i
end
opt = OptionParser.new
@@ -44,258 +44,258 @@ files = []
mode = ""
opt.on('-j', '--jump [regA,regB,regC]', 'Search for jump equivalent instructions [PE|ELF|MACHO]') do |t|
- # take csv of register names (like eax,ebx) and convert
- # them to an array of register numbers
- mode = "jump"
- regnums = t.split(',').collect { |o|
- begin
- Rex::Arch::X86.reg_number(o)
- rescue
- puts "Invalid register \"#{o}\""
- exit(1)
- end
- }
- param['args'] = regnums
+ # take csv of register names (like eax,ebx) and convert
+ # them to an array of register numbers
+ mode = "jump"
+ regnums = t.split(',').collect { |o|
+ begin
+ Rex::Arch::X86.reg_number(o)
+ rescue
+ puts "Invalid register \"#{o}\""
+ exit(1)
+ end
+ }
+ param['args'] = regnums
end
opt.on('-p', '--poppopret', 'Search for pop+pop+ret combinations [PE|ELF|MACHO]') do |t|
- mode = "pop"
- param['args'] = t
+ mode = "pop"
+ param['args'] = t
end
opt.on('-r', '--regex [regex]', 'Search for regex match [PE|ELF|MACHO]') do |t|
- mode = "regex"
- param['args'] = t
+ mode = "regex"
+ param['args'] = t
end
opt.on('-a', '--analyze-address [address]', 'Display the code at the specified address [PE|ELF]') do |t|
- mode = "analyze-address"
- param['args'] = opt2i(t)
+ mode = "analyze-address"
+ param['args'] = opt2i(t)
end
opt.on('-b', '--analyze-offset [offset]', 'Display the code at the specified offset [PE|ELF]') do |t|
- mode = "analyze-offset"
- param['args'] = opt2i(t)
+ mode = "analyze-offset"
+ param['args'] = opt2i(t)
end
opt.on('-f', '--fingerprint', 'Attempt to identify the packer/compiler [PE]') do |t|
- mode = "fingerprint"
- param['database'] = File.join(File.dirname(msfbase), 'data', 'msfpescan', 'identify.txt')
+ mode = "fingerprint"
+ param['database'] = File.join(File.dirname(msfbase), 'data', 'msfpescan', 'identify.txt')
end
opt.on('-i', '--info', 'Display detailed information about the image [PE]') do |t|
- mode = "info"
+ mode = "info"
end
opt.on('-R', '--ripper [directory]', 'Rip all module resources to disk [PE]') do |t|
- mode = "ripper"
- param['dir'] = t
+ mode = "ripper"
+ param['dir'] = t
end
opt.on('--context-map [directory]', 'Generate context-map files [PE]') do |t|
- mode = "context"
- param['dir'] = t
+ mode = "context"
+ param['dir'] = t
end
opt.separator('')
opt.separator('Options:')
opt.on('-A', '--after [bytes]', 'Number of bytes to show after match (-a/-b) [PE|ELF|MACHO]') do |t|
- param['after'] = opt2i(t)
+ param['after'] = opt2i(t)
end
opt.on('-B', '--before [bytes]', 'Number of bytes to show before match (-a/-b) [PE|ELF|MACHO]') do |t|
- param['before'] = opt2i(t)
+ param['before'] = opt2i(t)
end
opt.on('-I', '--image-base [address]', 'Specify an alternate ImageBase [PE|ELF|MACHO]') do |t|
- param['imagebase'] = opt2i(t)
+ param['imagebase'] = opt2i(t)
end
opt.on('-D', '--disasm', 'Disassemble the bytes at this address [PE]') do |t|
- param['disasm'] = true
+ param['disasm'] = true
end
opt.on('-F', '--filter-addresses [regex]', 'Filter addresses based on a regular expression [PE]') do |t|
- param['filteraddr'] = t
+ param['filteraddr'] = t
end
opt.on_tail("-h", "--help", "Show this message") do
- $stderr.puts opt
- exit(1)
+ $stderr.puts opt
+ exit(1)
end
begin
- opt.parse!
+ opt.parse!
rescue OptionParser::InvalidOption, OptionParser::MissingArgument
- $stderr.puts "Invalid option, try -h for usage"
- exit(1)
+ $stderr.puts "Invalid option, try -h for usage"
+ exit(1)
end
if mode.empty?
- $stderr.puts "A mode must be selected"
- $stderr.puts opt
- exit(1)
+ $stderr.puts "A mode must be selected"
+ $stderr.puts opt
+ exit(1)
end
# check if the file is a directory if it is collect all the entries
ARGV.each do |file|
- if(File.directory?(file))
- dir = Dir.open(file)
- dir.entries.each do |ent|
- path = File.join(file, ent)
- next if not File.file?(path)
- files << File.join(path)
- end
- else
- files << file
- end
+ if(File.directory?(file))
+ dir = Dir.open(file)
+ dir.entries.each do |ent|
+ path = File.join(file, ent)
+ next if not File.file?(path)
+ files << File.join(path)
+ end
+ else
+ files << file
+ end
end
# we need to do some work to figure out the file format
files.each do |file|
- param['file'] = file
+ param['file'] = file
- bin = Metasm::AutoExe.decode_file(file) if not file.empty?
+ bin = Metasm::AutoExe.decode_file(file) if not file.empty?
- if bin.kind_of?(Metasm::PE)
- case mode
- when "jump"
- worker = Rex::PeScan::Scanner::JmpRegScanner
- when "pop"
- worker = Rex::PeScan::Scanner::PopPopRetScanner
- when "regex"
- worker = Rex::PeScan::Scanner::RegexScanner
- when "analyze-address"
- worker = Rex::PeScan::Search::DumpRVA
- when "analyze-offset"
- worker = Rex::PeScan::Search::DumpOffset
- when "fingerprint"
- worker = Rex::PeScan::Analyze::Fingerprint
- when "info"
- worker = Rex::PeScan::Analyze::Information
- when "ripper"
- worker = Rex::PeScan::Analyze::Ripper
- when "context"
- worker = Rex::PeScan::Analyze::ContextMapDumper
- else
- $stderr.puts("Mode unsupported by file format")
- end
+ if bin.kind_of?(Metasm::PE)
+ case mode
+ when "jump"
+ worker = Rex::PeScan::Scanner::JmpRegScanner
+ when "pop"
+ worker = Rex::PeScan::Scanner::PopPopRetScanner
+ when "regex"
+ worker = Rex::PeScan::Scanner::RegexScanner
+ when "analyze-address"
+ worker = Rex::PeScan::Search::DumpRVA
+ when "analyze-offset"
+ worker = Rex::PeScan::Search::DumpOffset
+ when "fingerprint"
+ worker = Rex::PeScan::Analyze::Fingerprint
+ when "info"
+ worker = Rex::PeScan::Analyze::Information
+ when "ripper"
+ worker = Rex::PeScan::Analyze::Ripper
+ when "context"
+ worker = Rex::PeScan::Analyze::ContextMapDumper
+ else
+ $stderr.puts("Mode unsupported by file format")
+ end
- pe_klass = Rex::PeParsey::Pe
- begin
- pe = pe_klass.new_from_file(file, true)
- rescue ::Interrupt
- raise $!
- rescue Rex::PeParsey::FileHeaderError
- next if $!.message == "Couldn't find the PE magic!"
- raise $!
- rescue Errno::ENOENT
- $stdout.puts("File does not exist: #{file}")
- next
- rescue ::Rex::PeParsey::SkipError
- next
- rescue ::Exception => e
- $stdout.puts "[#{file}] #{e.class}: #{e}"
- next
- end
+ pe_klass = Rex::PeParsey::Pe
+ begin
+ pe = pe_klass.new_from_file(file, true)
+ rescue ::Interrupt
+ raise $!
+ rescue Rex::PeParsey::FileHeaderError
+ next if $!.message == "Couldn't find the PE magic!"
+ raise $!
+ rescue Errno::ENOENT
+ $stdout.puts("File does not exist: #{file}")
+ next
+ rescue ::Rex::PeParsey::SkipError
+ next
+ rescue ::Exception => e
+ $stdout.puts "[#{file}] #{e.class}: #{e}"
+ next
+ end
- if (param['imagebase'])
- pe.image_base = param['imagebase'];
- end
+ if (param['imagebase'])
+ pe.image_base = param['imagebase'];
+ end
- if not worker
- $stderr.puts("A mode could not be set for this file.")
- next
- end
+ if not worker
+ $stderr.puts("A mode could not be set for this file.")
+ next
+ end
- o = worker.new(pe)
- o.scan(param)
+ o = worker.new(pe)
+ o.scan(param)
- pe.close
+ pe.close
- elsif bin.kind_of?(Metasm::ELF)
- case mode
- when "jump"
- worker = Rex::ElfScan::Scanner::JmpRegScanner
- when "pop"
- worker = Rex::Elfscan::Scanner::PopPopRetScanner
- when "regex"
- worker = Rex::ElfScan::Scanner::RegexScanner
- when "analyze-address"
- worker = Rex::ElfScan::Search::DumpRVA
- when "analyze-offset"
- worker = Rex::ElfScan::Search::DumpOffset
- else
- $stderr.puts("Mode unsupported by file format")
- end
-
- begin
- elf = Rex::ElfParsey::Elf.new_from_file(file, true)
- rescue Rex::ElfParsey::ElfHeaderError
- if $!.message == 'Invalid magic number'
- $stderr.puts("Skipping #{file}: #{$!}")
- next
- end
- raise $!
- rescue Errno::ENOENT
- $stderr.puts("File does not exist: #{file}")
- next
- end
+ elsif bin.kind_of?(Metasm::ELF)
+ case mode
+ when "jump"
+ worker = Rex::ElfScan::Scanner::JmpRegScanner
+ when "pop"
+ worker = Rex::Elfscan::Scanner::PopPopRetScanner
+ when "regex"
+ worker = Rex::ElfScan::Scanner::RegexScanner
+ when "analyze-address"
+ worker = Rex::ElfScan::Search::DumpRVA
+ when "analyze-offset"
+ worker = Rex::ElfScan::Search::DumpOffset
+ else
+ $stderr.puts("Mode unsupported by file format")
+ end
+
+ begin
+ elf = Rex::ElfParsey::Elf.new_from_file(file, true)
+ rescue Rex::ElfParsey::ElfHeaderError
+ if $!.message == 'Invalid magic number'
+ $stderr.puts("Skipping #{file}: #{$!}")
+ next
+ end
+ raise $!
+ rescue Errno::ENOENT
+ $stderr.puts("File does not exist: #{file}")
+ next
+ end
- if (param['imagebase'])
- elf.base_addr = param['imagebase'];
- end
+ if (param['imagebase'])
+ elf.base_addr = param['imagebase'];
+ end
- if not worker
- $stderr.puts("A mode could not be set for this file.")
- next
- end
-
- o = worker.new(elf)
- o.scan(param)
+ if not worker
+ $stderr.puts("A mode could not be set for this file.")
+ next
+ end
+
+ o = worker.new(elf)
+ o.scan(param)
- elf.close
+ elf.close
- elsif bin.kind_of?(Metasm::MachO)
- case mode
- when "jump"
- worker = Rex::MachScan::Scanner::JmpRegScanner
- when "pop"
- worker = Rex::MachScan::Scanner::PopPopRetScanner
- when "regex"
- worker = Rex::MachScan::Scanner::RegexScanner
- else
- $stderr.puts("Mode unsupported by file format")
- end
+ elsif bin.kind_of?(Metasm::MachO)
+ case mode
+ when "jump"
+ worker = Rex::MachScan::Scanner::JmpRegScanner
+ when "pop"
+ worker = Rex::MachScan::Scanner::PopPopRetScanner
+ when "regex"
+ worker = Rex::MachScan::Scanner::RegexScanner
+ else
+ $stderr.puts("Mode unsupported by file format")
+ end
- begin
- mach = Rex::MachParsey::Mach.new_from_file(file, true)
- o = worker.new(mach)
- o.scan(param)
- mach.close
- rescue Rex::MachParsey::MachHeaderError
- $stderr.puts("File is not a Mach-O binary, trying Fat..\n")
- begin
- fat = Rex::MachParsey::Fat.new_from_file(file, true)
- o = worker.new(fat)
- o.scan(param)
- fat.close
- rescue
- $stderr.puts("Error: " + $!.to_s)
- $stderr.puts("Skipping #{file}")
- end
- rescue Errno::ENOENT
- $stderr.puts("File does not exist: #{file}")
- next
- end
- end
+ begin
+ mach = Rex::MachParsey::Mach.new_from_file(file, true)
+ o = worker.new(mach)
+ o.scan(param)
+ mach.close
+ rescue Rex::MachParsey::MachHeaderError
+ $stderr.puts("File is not a Mach-O binary, trying Fat..\n")
+ begin
+ fat = Rex::MachParsey::Fat.new_from_file(file, true)
+ o = worker.new(fat)
+ o.scan(param)
+ fat.close
+ rescue
+ $stderr.puts("Error: " + $!.to_s)
+ $stderr.puts("Skipping #{file}")
+ end
+ rescue Errno::ENOENT
+ $stderr.puts("File does not exist: #{file}")
+ next
+ end
+ end
- if not worker
- $stderr.puts("Unsupported file format")
- $stderr.puts("Skipping #{file}")
- next
- end
+ if not worker
+ $stderr.puts("Unsupported file format")
+ $stderr.puts("Skipping #{file}")
+ next
+ end
end
diff --git a/msfcli b/msfcli
index 23674498fa..7ee7088a56 100755
--- a/msfcli
+++ b/msfcli
@@ -8,7 +8,7 @@
msfbase = __FILE__
while File.symlink?(msfbase)
- msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
+ msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
@@ -16,543 +16,543 @@ require 'rex'
class Msfcli
- def initialize(args)
- @args = {}
- @indent = ' '
- @framework = nil
-
- @args[:module_name] = args.shift # First argument should be the module name
- @args[:mode] = args.pop || 'h' # Last argument should be the mode
- @args[:params] = args # Whatever is in the middle should be the params
-
- if @args[:module_name] =~ /^exploit(s)*\//i
- @args[:module_name] = @args[:module_name].split('/')
- @args[:module_name] = @args[:module_name][1, @args[:module_name].length] * "/"
- end
- end
-
- #
- # Returns a usage Rex table
- #
- def usage (str = nil, extra = nil)
- tbl = Rex::Ui::Text::Table.new(
- 'Header' => "Usage: #{$0}