From 96cd65a205ed83e83eb8905c19b4ee2e6426af4e Mon Sep 17 00:00:00 2001 From: AlbertoCoding Date: Fri, 1 Jun 2018 02:57:03 +0200 Subject: [PATCH] Added new whoami module and some fixes --- modules/post/linux/pepa/pepa_cat.rb | 1 - modules/post/linux/pepa/pepa_ls.rb | 3 +-- modules/post/linux/pepa/pepa_whoami.rb | 29 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 modules/post/linux/pepa/pepa_whoami.rb diff --git a/modules/post/linux/pepa/pepa_cat.rb b/modules/post/linux/pepa/pepa_cat.rb index ba991f719d..dd36f73ee9 100644 --- a/modules/post/linux/pepa/pepa_cat.rb +++ b/modules/post/linux/pepa/pepa_cat.rb @@ -32,6 +32,5 @@ class MetasploitModule < Msf::Post cat_result.each do |line| print_line(line) end - print_line("\n") end end diff --git a/modules/post/linux/pepa/pepa_ls.rb b/modules/post/linux/pepa/pepa_ls.rb index fb56fa5429..dcd2920263 100644 --- a/modules/post/linux/pepa/pepa_ls.rb +++ b/modules/post/linux/pepa/pepa_ls.rb @@ -30,12 +30,11 @@ class MetasploitModule < Msf::Post if dir == "" print_status("Doing ls without ls command in current session path DIR") else - print_status("Doing ls without ls command in DIR: #{dir}") + print_status("Doing ls without ls command in DIR: #{dir}") end ls_result=pepa_ls(dir) ls_result.each do |line| print_line(line) end - print_line("\n") end end diff --git a/modules/post/linux/pepa/pepa_whoami.rb b/modules/post/linux/pepa/pepa_whoami.rb new file mode 100644 index 0000000000..f0df4534b2 --- /dev/null +++ b/modules/post/linux/pepa/pepa_whoami.rb @@ -0,0 +1,29 @@ +## +# This module requires Metasploit: https://metasploit.com/download +# Current source: https://github.com/rapid7/metasploit-framework +## + +class MetasploitModule < Msf::Post + include Msf::Post::File + include Msf::Post::Linux::Pepa + + def initialize + super( + 'Name' => 'PEPA Whoami (whoami without whoami)', + 'Description' => %q{ + This module will be applied on a session connected to a shell. It will + extract current username. + }, + 'Author' => 'Alberto Rafael Rodriguez Iglesias ', + 'License' => MSF_LICENSE, + 'Platform' => ['linux'], + 'SessionTypes' => ['shell'] + ) + end + + def run + print_status("Doing whoami without whoami command") + whoami_result=pepa_whoami()[0] + print_line(whoami_result) + end +end