Files
metasploit-gs/modules/post/linux/gather/checkcontainer.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.2 KiB
Ruby
Raw Normal View History

##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Post
2024-04-26 21:32:20 -04:00
include Msf::Post::Linux::System
2023-02-08 13:47:34 +00:00
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Linux Gather Container Detection',
'Description' => %q{
This module attempts to determine whether the system is running
inside of a container and if so, which one. This module supports
2023-07-16 18:03:34 +02:00
detection of Docker, WSL, LXC, Podman and systemd nspawn.
2023-02-08 13:47:34 +00:00
},
'License' => MSF_LICENSE,
'Author' => [ 'James Otten <jamesotten1[at]gmail.com>'],
2024-04-26 21:32:20 -04:00
'Platform' => %w[linux unix],
'SessionTypes' => %w[shell meterpreter],
'Notes' => {
'Stability' => [ CRASH_SAFE ],
'Reliability' => [ REPEATABLE_SESSION ],
'SideEffects' => []
}
2023-02-08 13:47:34 +00:00
)
)
end
# Run Method for when run command is issued
def run
2024-04-26 21:32:20 -04:00
container = get_container_type
2024-04-26 21:58:43 -04:00
if container == 'Unknown'
2023-02-08 13:47:34 +00:00
print_status('This does not appear to be a container')
2024-04-26 21:58:43 -04:00
else
print_good("This appears to be a '#{container}' container")
end
end
end