Skip to content

Commit

Permalink
yard doc and comment corrections for auxiliary
Browse files Browse the repository at this point in the history
  • Loading branch information
void-in committed Apr 3, 2015
1 parent 0dd987d commit 4bd40fe
Show file tree
Hide file tree
Showing 129 changed files with 476 additions and 590 deletions.
6 changes: 3 additions & 3 deletions modules/auxiliary/admin/2wire/xslt_password_reset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ def run
return
end

#check to see if we get HTTP OK
# check to see if we get HTTP OK
if (res.code == 200)
print_status("Okay, Got an HTTP 200 (okay) code. Verifying Server header")
else
print_error("Did not get HTTP 200, URL was not found. Exiting!")
return
end

#Check to verify server reported is a 2wire router
# Check to verify server reported is a 2wire router
if (res.headers['Server'].match(/2wire Gateway/i))
print_status("Server is a 2wire Gateway! Grabbing info\n")
else
Expand Down Expand Up @@ -88,7 +88,7 @@ def run
print_status("Hardware Version: #{hardware}")
end

#Check the Software Version
# Check the Software Version
if res.body.match(/<td class="data">(5\.\d{1,3}\.\d{1,3}\.\d{1,3})<\/td>/i)
ver = $1
print_status("Software version: #{ver}")
Expand Down
6 changes: 3 additions & 3 deletions modules/auxiliary/admin/http/linksys_e1500_e2500_exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def run
print_status("#{rhost}:#{rport} - Sending remote command: " + datastore['CMD'])

cmd = datastore['CMD']
#original post request:
#data_cmd = "submit_button=Diagnostics&change_action=gozila_cgi&submit_type=start_ping&
#action=&commit=0&ping_ip=1.1.1.1&ping_size=%26#{cmd}%26&ping_times=5&traceroute_ip="
# original post request:
# data_cmd = "submit_button=Diagnostics&change_action=gozila_cgi&submit_type=start_ping&
# action=&commit=0&ping_ip=1.1.1.1&ping_size=%26#{cmd}%26&ping_times=5&traceroute_ip="

vprint_status("#{rhost}:#{rport} - using the following target URL: #{uri}")
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def initialize(info = {})
},
'Author' =>
[
'Craig Heffner', #vulnerability discovery and original exploit
'Michael Messner <devnull[at]s3cur1ty.de>' #metasploit module
'Craig Heffner', # vulnerability discovery and original exploit
'Michael Messner <devnull[at]s3cur1ty.de>' # metasploit module
],
'License' => MSF_LICENSE,
'References' =>
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/http/rails_devise_pass_reset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def reset_one(password, report=false)
return false
end
when 302
#Success!
# Success!
return true
else
print_error("ERROR: received code #{res.code}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,20 @@ def run
else
print_status("Rotating through known encryption keys")
encryption_keys = [
#TYPO3 4.3.x - 4.4.x
# TYPO3 4.3.x - 4.4.x
'd696ab49a803d7816021cb1768a6917d',
'47d1e990583c9c67424d369f3414728e6793d9dc2ae3429d488a7374bc85d2a0b19b62de67d46a6079a75f10934288d3',
'7b13b2203029ed80337f27127a9f1d28c2597f4c08c9a07b782b674731ecf5328c4d900851957899acdc6d4f911bf8b7',
#TYPO3 4.4.7+
# TYPO3 4.4.7+
'fbbdebd9091d914b3cd523485afe7b03e6006ade4125e4cf4c46195b3cecbb9ae0fe0f7b5a9e72ea2ac5f17b66f5abc7',
#TYPO3 4.5.0
# TYPO3 4.5.0
'def76f1d8139304b7edea83b5f40201088ba70b20feabd8b2a647c4e71774b7b0e4086e4039abaf5d4f6a521f922e8a2',
'bac0112e14971f00431639342415ff22c3c3bf270f94175b8741c0fa95df244afb61e483c2facf63cffc320ed61f2731',
#TYPO3 4.5.2
# TYPO3 4.5.2
'14b1225e2c277d55f54d18665791f114f4244f381113094e2a19dfb680335d842e10460995eb653d105a562a5415d9c7',
#TYPO3 4.5.3
# TYPO3 4.5.3
'5d4eede80d5cec8df159fd869ec6d4041cd2fc0136896458735f8081d4df5c22bbb0665ddac56056023e01fbd4ab5283',
#TYPO3 4.5.4 - 4.5.7
# TYPO3 4.5.4 - 4.5.7
'b2aae63def4c512ce8f4386e57b8a48b40312de30775535cbff60a6eab356809a0b596edaad49c725d9963d93aa2ffae',
]
end
Expand Down
4 changes: 2 additions & 2 deletions modules/auxiliary/admin/maxdb/maxdb_cons_exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def initialize(info = {})
def run
connect

#Grab the MaxDB info.
# Grab the MaxDB info.
pdbmsrv = "\x5A\x00\x00\x00\x03\x5B\x00\x00\x01\x00\x00\x00\xFF\xFF\xFF\xFF"
pdbmsrv << "\x00\x00\x04\x00\x5A\x00\x00\x00\x00\x02\x42\x00\x04\x09\x00\x00"
pdbmsrv << "\x00\x40\x00\x00\xD0\x3F\x00\x00\x00\x40\x00\x00\x70\x00\x00\x00"
Expand All @@ -60,7 +60,7 @@ def run
print_status(info)
end

#Send our command.
# Send our command.
len = 39 + datastore['CMD'].length

data = len.chr + "\x00\x00\x00\x03\x3F\x00\x00\x01\x00\x00\x00\x54\x0D\x00\x00"
Expand Down
6 changes: 3 additions & 3 deletions modules/auxiliary/admin/misc/sercomm_dump_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def initialize(info={})
'License' => MSF_LICENSE,
'Author' =>
[
'Eloi Vanderbeken <eloi.vanderbeken[at]gmail.com>', #Initial discovery, poc
'Matt "hostess" Andreko <mandreko[at]accuvant.com>' #Msf module
'Eloi Vanderbeken <eloi.vanderbeken[at]gmail.com>', # Initial discovery, poc
'Matt "hostess" Andreko <mandreko[at]accuvant.com>' # Msf module
],
'References' =>
[
Expand Down Expand Up @@ -174,7 +174,7 @@ def dump_configuration

unless length == data.length
vprint_warning("#{peer} - Inconsistent length / data packet")
#return nil
# return nil
end

return { :length => length, :data => data }
Expand Down
26 changes: 13 additions & 13 deletions modules/auxiliary/admin/mssql/mssql_enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def run
:type => 'MSSQL_ENUM',
:data => "Version: #{sqlversion}")

#-------------------------------------------------------
#Check Configuration Parameters and check what is enabled
#---------------------------------------------------------
# Check Configuration Parameters and check what is enabled
print_status("Configuration Parameters:")
if vernum.join != "2000"
query = "SELECT name, CAST(value_in_use AS INT) from sys.configurations"
Expand All @@ -59,7 +59,7 @@ def run
sysconfig[l[0].strip] = l[1].to_i
end
else
#enable advanced options
# enable advanced options
mssql_query("EXEC sp_configure \'show advanced options\', 1; RECONFIGURE")[:rows]
query = "EXECUTE sp_configure"
ver = mssql_query(query)[:rows]
Expand All @@ -71,7 +71,7 @@ def run
end

#-------------------------------------------------------
#checking for C2 Audit Mode
# checking for C2 Audit Mode
if sysconfig['c2 audit mode'] == 1
print_status("\tC2 Audit Mode is Enabled")
report_note(:host => datastore['RHOST'],
Expand All @@ -89,7 +89,7 @@ def run
end

#-------------------------------------------------------
#check if xp_cmdshell is enabled
# check if xp_cmdshell is enabled
if vernum.join != "2000"
if sysconfig['xp_cmdshell'] == 1
print_status("\txp_cmdshell is Enabled")
Expand Down Expand Up @@ -126,7 +126,7 @@ def run
end

#-------------------------------------------------------
#check if remote access is enabled
# check if remote access is enabled
if sysconfig['remote access'] == 1
print_status("\tremote access is Enabled")
report_note(:host => datastore['RHOST'],
Expand Down Expand Up @@ -162,7 +162,7 @@ def run
end

#-------------------------------------------------------
#check if Mail stored procedures are enabled
# check if Mail stored procedures are enabled
if vernum.join != "2000"
if sysconfig['Database Mail XPs'] == 1
print_status("\tDatabase Mail XPs is Enabled")
Expand Down Expand Up @@ -199,7 +199,7 @@ def run
end

#-------------------------------------------------------
#check if OLE stored procedures are enabled
# check if OLE stored procedures are enabled
if vernum.join != "2000"
if sysconfig['Ole Automation Procedures'] == 1
print_status("\tOle Automation Procedures are Enabled")
Expand Down Expand Up @@ -451,7 +451,7 @@ def run
end

#-------------------------------------------------------
#Check for local accounts with same username as password
# Check for local accounts with same username as password
sameasuser = []
if vernum.join != "2000"
sameasuser = mssql_query("SELECT name FROM sys.sql_logins WHERE PWDCOMPARE\(name, password_hash\) = 1")[:rows]
Expand Down Expand Up @@ -479,7 +479,7 @@ def run
end

#-------------------------------------------------------
#Check for local accounts with empty password
# Check for local accounts with empty password
blankpass = []
if vernum.join != "2000"
blankpass = mssql_query("SELECT name FROM sys.sql_logins WHERE PWDCOMPARE\(\'\', password_hash\) = 1")[:rows]
Expand Down Expand Up @@ -507,7 +507,7 @@ def run
end

#-------------------------------------------------------
#Check for dangerous stored procedures
# Check for dangerous stored procedures
fountsp = []
dangeroussp = [
'sp_createorphan',
Expand Down Expand Up @@ -732,7 +732,7 @@ def run
end

#-------------------------------------------------------
#Enumerate Instances
# Enumerate Instances
instances =[]
if vernum.join != "2000"
querykey = "EXEC master..xp_regenumvalues \'HKEY_LOCAL_MACHINE\',\'SOFTWARE\\Microsoft\\Microsoft SQL Server\\Instance Names\\SQL\'"
Expand Down Expand Up @@ -769,7 +769,7 @@ def run
end

#---------------------------------------------------------
#Enumerate under what accounts the instance services are running under
# Enumerate under what accounts the instance services are running under
print_status("Default Server Instance SQL Server Service is running under the privilege of:")
privdflt = mssql_query("EXEC master..xp_regread \'HKEY_LOCAL_MACHINE\' ,\'SYSTEM\\CurrentControlSet\\Services\\MSSQLSERVER\',\'ObjectName\'")[:rows]
if privdflt != nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def check_trust_dbs
return nil
end

#Parse results
# Parse results
parsed_result = res.body.scan(/#{clue_start}(.*?)#{clue_end}/m)

if parsed_result && !parsed_result.empty?
Expand Down
24 changes: 12 additions & 12 deletions modules/auxiliary/admin/mssql/mssql_findandsampledata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def run_host(ip)

def sql_statement()

#DEFINED HEADER TEXT
# DEFINED HEADER TEXT
headings = [
["Server","Database", "Schema", "Table", "Column", "Data Type", "Sample Data","Row Count"]
]

#DEFINE SEARCH QUERY AS VARIABLE
# DEFINE SEARCH QUERY AS VARIABLE
sql = "
-- CHECK IF VERSION IS COMPATABLE = > than 2000
IF (SELECT SUBSTRING(CAST(SERVERPROPERTY('ProductVersion') as VARCHAR), 1,
Expand Down Expand Up @@ -341,11 +341,11 @@ def sql_statement()



#STATUSING
# STATUSING
print_line(" ")
print_status("Attempting to connect to the SQL Server at #{rhost}:#{rport}...")

#CREATE DATABASE CONNECTION AND SUBMIT QUERY WITH ERROR HANDLING
# CREATE DATABASE CONNECTION AND SUBMIT QUERY WITH ERROR HANDLING
begin
result = mssql_query(sql, false) if mssql_login_datastore
column_data = result[:rows]
Expand All @@ -355,14 +355,14 @@ def sql_statement()
return
end

#CREATE TABLE TO STORE SQL SERVER DATA LOOT
# CREATE TABLE TO STORE SQL SERVER DATA LOOT
sql_data_tbl = Rex::Ui::Text::Table.new(
'Header' => 'SQL Server Data',
'Indent' => 1,
'Columns' => ['Server', 'Database', 'Schema', 'Table', 'Column', 'Data Type', 'Sample Data', 'Row Count']
)

#STATUSING
# STATUSING
print_status("Attempting to retrieve data ...")

if (column_data.count < 7)
Expand All @@ -386,15 +386,15 @@ def sql_statement()
print_line(" ")
end

#SETUP ROW WIDTHS
# SETUP ROW WIDTHS
widths = [0, 0, 0, 0, 0, 0, 0, 0]
(column_data|headings).each { |row|
0.upto(7) { |col|
widths[col] = row[col].to_s.length if row[col].to_s.length > widths[col]
}
}

#PRINT HEADERS
# PRINT HEADERS
buffer1 = ""
buffer2 = ""
headings.each { |row|
Expand All @@ -406,7 +406,7 @@ def sql_statement()
buffer2 = buffer2.chomp(",")+ "\n"
}

#PRINT DIVIDERS
# PRINT DIVIDERS
buffer1 = ""
buffer2 = ""
headings.each { |row|
Expand All @@ -417,7 +417,7 @@ def sql_statement()
print_line(buffer1)
}

#PRINT DATA
# PRINT DATA
buffer1 = ""
buffer2 = ""
print_line("")
Expand All @@ -429,7 +429,7 @@ def sql_statement()
print_line(buffer1)
buffer2 = buffer2.chomp(",")+ "\n"

#WRITE QUERY OUTPUT TO TEMP REPORT TABLE
# WRITE QUERY OUTPUT TO TEMP REPORT TABLE
sql_data_tbl << [row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7]]

buffer1 = ""
Expand All @@ -448,7 +448,7 @@ def sql_statement()
)
end

#CONVERT TABLE TO CSV AND WRITE TO FILE
# CONVERT TABLE TO CSV AND WRITE TO FILE
if (save_loot=="yes")
filename= "#{datastore['RHOST']}-#{datastore['RPORT']}_sqlserver_query_results.csv"
path = store_loot("mssql.data", "text/plain", datastore['RHOST'], sql_data_tbl.to_csv, filename, "SQL Server query results",this_service)
Expand Down
6 changes: 3 additions & 3 deletions modules/auxiliary/admin/mysql/mysql_enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def run
print_status("Running MySQL Enumerator...")
print_status("Enumerating Parameters")
#-------------------------------------------------------
#getting all variables
# getting all variables
vparm = {}
res = mysql_query("show variables") || []
res.each do |row|
#print_status(" | #{row.join(" | ")} |")
# print_status(" | #{row.join(" | ")} |")
vparm[row[0]] = row[1]
end

Expand Down Expand Up @@ -77,7 +77,7 @@ def run
query = "use mysql"
mysql_query(query)

#Account Enumeration
# Account Enumeration
# Enumerate all accounts with their password hashes
print_status("Enumerating Accounts:")
query = "select user, host, password from mysql.user"
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/oracle/oracle_sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def run
begin
print_status("Sending statement: '#{query}'...")
result = prepare_exec(query)
#Need this if 'cause some statements won't return anything
# Need this if statement because some statements won't return anything
if result
result.each do |line|
print_status(line)
Expand Down
Loading

0 comments on commit 4bd40fe

Please sign in to comment.