Skip to content

Commit 4a603b9

Browse files
committed
Merge remote-tracking branch 'upstream/master' into beug/session
Conflicts: lib/msf/base/simple/post.rb
2 parents 2476d9b + 18816f3 commit 4a603b9

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

lib/msf/core/post_mixin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def session
7474
return @session if @session and not session_changed?
7575

7676
if datastore["SESSION"]
77-
@session = framework.sessions[datastore["SESSION"].to_i]
77+
@session = framework.sessions.get(datastore["SESSION"].to_i)
7878
else
7979
@session = nil
8080
end

lib/msf/core/session_manager.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,17 @@ def deregister(session, reason='')
279279
# Returns the session associated with the supplied sid, if any.
280280
#
281281
def get(sid)
282-
return self[sid.to_i]
282+
session = nil
283+
sid = sid.to_i
284+
285+
if sid > 0
286+
session = self[sid]
287+
elsif sid == -1
288+
sid = self.keys.sort[-1]
289+
session = self[sid]
290+
end
291+
292+
session
283293
end
284294

285295
#

modules/post/linux/gather/enum_system.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def initialize(info={})
2727
'Stephen Haywood <averagesecurityguy[at]gmail.com>', # get_cron and original enum_linux
2828
'sinn3r', # Testing and modification of original enum_linux
2929
'ohdae <bindshell[at]live.com>', # Combined separate mods, modifications and testing
30+
'Roberto Espreto <robertoespreto[at]gmail.com>', # log files and setuid/setgid
3031
],
3132
'Platform' => [ 'linux' ],
3233
'SessionTypes' => [ 'shell' ]
@@ -59,13 +60,17 @@ def run
5960
crons = get_crons(users, user)
6061
diskspace = execute("/bin/df -ahT")
6162
disks = (mount +"\n\/"+ diskspace)
63+
logfiles = execute("find /var/log -type f -perm -4 2> /dev/null")
64+
uidgid = execute("find / -xdev -type f -perm +6000 -perm -1 2> /dev/null")
6265

6366
save("Linux version", distro)
6467
save("User accounts", users)
6568
save("Installed Packages", installed_pkg)
6669
save("Running Services", installed_svc)
6770
save("Cron jobs", crons)
6871
save("Disk info", disks)
72+
save("Logfiles", logfiles)
73+
save("Setuid/setgid files", uidgid)
6974

7075
end
7176

0 commit comments

Comments
 (0)