Skip to content

Commit c6e8ffb

Browse files
committed
Fix some "mistakes" following the style guide
1 parent 9250869 commit c6e8ffb

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

modules/post/linux/gather/enum_system.rb

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class Metasploit3 < Msf::Post
1111
include Msf::Post::File
1212
include Msf::Post::Linux::System
1313

14-
def initialize(info={})
15-
super( update_info( info,
14+
def initialize(info = {})
15+
super(update_info(info,
1616
'Name' => 'Linux Gather System and User Information',
1717
'Description' => %q{
1818
This module gathers system information. We collect
@@ -31,7 +31,6 @@ def initialize(info={})
3131
'Platform' => ['linux'],
3232
'SessionTypes' => ['shell', 'meterpreter']
3333
))
34-
3534
end
3635

3736
def run
@@ -60,7 +59,7 @@ def run
6059
mount = execute("/bin/mount -l")
6160
crons = get_crons(users, user)
6261
diskspace = execute("/bin/df -ahT")
63-
disks = (mount + "\n\/" + diskspace)
62+
disks = (mount + "\n\n" + diskspace)
6463
logfiles = execute("find /var/log -type f -perm -4 2> /dev/null")
6564
uidgid = execute("find / -xdev -type f -perm +6000 -perm -1 2> /dev/null")
6665

@@ -74,11 +73,10 @@ def run
7473
save("Setuid/setgid files", uidgid)
7574
end
7675

77-
78-
def save(msg, data, ctype="text/plain")
76+
def save(msg, data, ctype = 'text/plain')
7977
ltype = "linux.enum.system"
8078
loot = store_loot(ltype, ctype, session, data, nil, msg)
81-
print_status("#{msg} stored in #{loot.to_s}")
79+
print_status("#{msg} stored in #{loot}")
8280
end
8381

8482
def get_host
@@ -148,8 +146,8 @@ def get_services(distro)
148146
end
149147

150148
def get_crons(users, user)
151-
if user == "root" && users != nil
152-
users = users.chomp.split()
149+
if user == "root" && !users.nil?
150+
users = users.chomp.split
153151
users.each do |u|
154152
if u == "root"
155153
vprint_status("Enumerating as root")
@@ -164,10 +162,9 @@ def get_crons(users, user)
164162
vprint_status("Enumerating as #{user}")
165163
cron_data = "***** Listing cron jobs for #{user} *****\n\n"
166164
cron_data += execute("crontab -l")
167-
end
168165

169-
# Save cron data to loot
170-
return cron_data
166+
# Save cron data to loot
167+
return cron_data
168+
end
171169
end
172-
173170
end

0 commit comments

Comments
 (0)