Nytro Posted March 13, 2012 Report Posted March 13, 2012 [h=1]win xp sp2 PEB ISbeingdebugged shellcode[/h]#name: win xp sp2 PEB ISbeingdebugged shellcode#Author: *********#Contact: teo.manojlovic@skole.hr#Date: 14.12.2009.here is the ASM code made using masm32if program is being run under debugger the shellcode wil start beeping //////////////////////begin///////////////////////////////////////.386.model flat, stdcalloption casemap :noneINCLUDE C:\MASM32\INCLUDE\WINDOWS.INCINCLUDE C:\MASM32\INCLUDE\KERNEL32.INCINCLUDE C:\MASM32\INCLUDE\USER32.INCINCLUDE C:\MASM32\INCLUDE\MASM32.INCINCLUDELIB C:\MASM32\LIB\KERNEL32.LIBINCLUDELIB C:\MASM32\LIB\USER32.LIBINCLUDELIB C:\MASM32\LIB\MASM32.LIB .dataExitMsg DB "Enter to Exit", 0 .code start:assume fs:nothingmov eax,fs:[30h]mov eax, [eax+02h]mov ebx, 7FFF8000hadd ebx,7FFF8000hinc ebxpush 300hpush 200hmov edx,7c837a8fhcmp eax,ebxjnz exitcall edxexit:invoke ExitProcess,NULLend start/////////////////////////////end///////////////////////////////here is the dump of code using olly debugger00401000 >/$ 64:A1 30000000 MOV EAX,DWORD PTR FS:[30]00401006 |. 8B40 02 MOV EAX,DWORD PTR DS:[EAX+2]00401009 |. BB 0080FF7F MOV EBX,7FFF80000040100E |. 81C3 0080FF7F ADD EBX,7FFF800000401014 |. 43 INC EBX00401015 |. 68 00030000 PUSH 300 ; /Duration = 768. ms0040101A |. 68 00020000 PUSH 200 ; |Frequency = 200 (512.)0040101F |. BA 8F7A837C MOV EDX,kernel32.Beep ; |00401024 |. 3BC3 CMP EAX,EBX ; |00401026 |. 75 02 JNZ SHORT antidebu.0040102A ; |00401028 |. FFD2 CALL EDX ; \Beep0040102A |> 6A 00 PUSH 0 ; /ExitCode = 00040102C \. E8 01000000 CALL <JMP.&kernel32.ExitProcess> ; \ExitProcess00401031 CC INT300401032 .-FF25 00204000 JMP DWORD PTR DS:[<&kernel32.ExitProcess>; kernel32.ExitProcesshere is the shellcode\x64\xA1\x30\x00\x00\x00\x8B\x40\x02\xBB\x00\x80\xFF\x7F\x81\xC3\x00\x80\xFF\x7F\x43\x68\x00\x03\x00\x00\x68\x00\x02\x00\x00\xBA\x8F\x7A\x83\x7C\x3B\xC3\x75\x02\xFF\xD2\x6A\x00\xE8\x01\x00\x00\x00\xCC\xFF\x25\x00\x20\x40\x00Sursa: win xp sp2 PEB ISbeingdebugged shellcodeAnti-debugging eficient... Quote