Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   Obsidium protection scheme as a target! (https://forum.exetools.com/showthread.php?t=16245)

Mr.reCoder 10-07-2014 03:01

Obsidium protection scheme as a target!
 
Hi all,
now a days i was looking for a trick to set HWBP on obsidium protected target! it clears HWBPs! when using ProtectDRX in phantom it detects debugger. it seems that obsidium detects KiUserExceptionDispatcher routine patch.
any idea to bypass this? or alternate trick? :)
sincerely.

sendersu 10-07-2014 03:28

ScyllaHide plugin for Olly2?

Mr.reCoder 10-07-2014 03:39

@sendersu:
So thanks, I tested it. but debugger has been detected! none of ScyllaHide in Olly1, Olly2 working fine with Obsidium! I am using Phantom+StrongOlly in win7-32 bit! and there is no problem except hwbp protection!

mm10121991 10-12-2014 07:48

1 Attachment(s)
Yes, obsiduim has a custom way to detect hwbp. If I remember well, It sets the hwbp to some specific location in the code to trigger the seh and the seh will set some values in memory.
after returning from the seh, those values will be tested to detect if hwbps were modified.

if you want to get near oep on 4.x targets, you can use this script.
It worked on many targets but I don't guarantee that it will work always.
Use a hidden olly.No hwbp and start it from entrypoint.

SubzEro 10-12-2014 13:53

@mm10121991 can you tell me how and which plugins to use to hide olly from obsidium

Mr.reCoder 10-12-2014 17:35

@mm10121991:
thnx for your share but can't download it! but my problem is not reaching OEP it is easy and I wrote a script that can find Stolen OEP opcodes. my problem is rebuilding IAT in some targets since I can not set hwpb on IAT write! however I will try to patch OBSIDIUM protection layer that detects hwbps! it may be good if you add IAT rebuild feature in your script :)

@Cyber_Coder:
I use StrongOlly and Phantom Plugins in a fresh and unchanged Olly to Hide from Obsidium! but you should disable ProtectDRX option in phantom.

mm10121991 10-12-2014 18:42

You don't need hwbp. After reaching oep, you just need to trace every redirected jump or call because there are no direct jumps or calls. Do not use shortcut ways. Trace the code and you will find places where to catch the redirected api.

http://ge.tt/47K8CN12/v/0
here you will find a few helper scripts to unpack obsiduim 4.x targets.
For the iat script, you have to modify this lines
mov iatb, 00B6B1B0 // start of iat
mov iate, 00B6C66C //end of iat
and make eip point to one of the redirected calls or jumps

Those scripts have worked on many 4.x targets but i don't guarantee they will always work.

SubzEro 10-12-2014 18:49

my ollydbg always get detected i try all hide plugins and no use

Edit: ok i got it it work now thx to all

Mr.reCoder 10-12-2014 20:59

@mm10121991
Perfect answer! so thanks.
OEP finder script needs some changes to work in win 7 32bit:
kernel32.dll -> kernelbase.dll
CreateRemoteThread -> CreateRemoteThreadEx

IAT script need more changes ;-)

@Cyber_Coder:
Disable all options in phantom.
Disable AdvEnumModule in StrongOD.
It works in win7 32bit perfectly.

SubzEro 10-12-2014 21:57

about CreateThread you can

Bp kernel32.CreateThread it work for me

Carbon 10-13-2014 00:45

ScyllaHide v1.3 should work with Obsidium on plain Olly v1 (or show me a target that doesn't work).

https://bitbucket.org/NtQuery/scyllahide/downloads/ScyllaHide_v1.3fix_Olly1.rar

You need to ignore the exceptions.

SubzEro 10-13-2014 00:55

fail my ollydbg crash

Quote:

Originally Posted by Carbon (Post 95124)
(or show me a target that doesn't work).



Mr.reCoder 10-13-2014 07:02

Quote:

Originally Posted by Cyber_Coder (Post 95125)
fail my ollydbg crash

see this video: Click Here!
target: DP Animation Maker
Use fresh copy of original olly and Phantom + StrongOD

--------------------------------------

But "ScyllaHide_v1.3fix_Olly1" fails and debugger detects!: Click Here!

SubzEro 10-13-2014 15:30

@Mr.reCoder thx you are great

Carbon 10-13-2014 20:29

I tested ScyllaHide on Windows XP and Windows 7 32bit. Everything works fine.

ScyllaHide on Win 7 64bit doesn't work :(

Obsidium is really an anti-debug hell. It uses this:
OutputDebugStringA
Illegal Instruction Exception
EnumWindows
NtQuerySystemInformation
NtQueryInformationProcess
NtClose
PEB

OutputDebugStringA is one of the last checks... something is missing on windows x64....

Somebody has any idea?

ahmadmansoor 10-15-2014 08:15

No my friend it should work fine .
I test it here ( win 7.0 x64) with this options :
hxxp://s000.tinyupload.com/?file_id=55501563102665112295
maybe ur Antivirus make some trouble .

SubzEro 10-15-2014 13:22

@ahmadmansoor can you share your "exetools ollydbg"

cybercoder 10-15-2014 13:52

Obsidium is fun to unpack if you have a lot of time.. crypted calls, sometimes direct calls to api's. Took me a long time the first time..

Carbon 10-15-2014 13:58

I don't have much time at the moment, but this is what I found so far:

Breakpoint on CreateFileW is very good.

After some breaks:
Code:

0018FD8C    757A3F66  /CALL to CreateFileW from kernel32.757A3F61
0018FD90    00C882F0  |FileName = "\\\\.\\VBoxGuest"
0018FD94    C0000000  |Access = GENERIC_READ|GENERIC_WRITE
0018FD98    00000003  |ShareMode = FILE_SHARE_READ|FILE_SHARE_WRITE
0018FD9C    00000000  |pSecurity = NULL
0018FDA0    00000003  |Mode = OPEN_EXISTING
0018FDA4    40000080  |Attributes = NORMAL|OVERLAPPED
0018FDA8    00000000  \hTemplateFile = NULL

Obsidium is checking for Virtual Box VM! If Obsidium is run under VBox, some anti-debug stuff will be disabled. I guess it is a hardware anti-debug check. Maybe something with HWBP.

Yeh, this is a hot trick in general...

here is the vbox check

00383929 83F8 FF CMP EAX,-1
0038392C 74 20 JE 0038394E

don't let it jump and enjoy less anti-debug

Mr.reCoder 10-15-2014 16:26

Hi,
now I used your tricks to set HWBP in IAT and successfully found where IAT writes. :)
See this viedo! password: exetools.com
time to trace! use shift-f9 to run!
I used win7-32bit and ScyllaHideOlly1 and fresh-unchanged copy of olly.
B.R.

mm10121991 10-21-2014 07:30

on DP Animation Maker
you can restore IAT with my script
just change the line
"je @dx2" to "jne @dx2"
still,you have to do the vm.

SubzEro 10-21-2014 12:49

@mm10121991 awesome stuff can you tell me something about vm short explain i don know about that what i need to do. i know its lame to you tell me all but i wanna learn obsidium is hard to unpack thx.

Mr.reCoder 10-21-2014 22:24

calling recovery
 
Hi,
there is no problem with IAT. main problem is VM unvirtualize or decrypttion.
also there is changes in calling some IAT functions with EDI,ESI,EBX,EBP. like:

Code:

006DF06A  MOV ESI,0x5D2C2BD9
006DF06F  NOP
006DF070  CALL ESI

but original code is:

Code:

006DF06A  MOV ESI,DWORD PTR DS:[0x6F9EB4]
006DF070  CALL ESI

calling with register is a common method in VC++ compilers. I wrote a little script to restore original code. (change code section address, IAT start and end addresses if desired. (target EditorGIF.exe))

Code:

VAR CONST
VAR CODE_SECTION
VAR IAT_START
VAR IAT_END

MOV IAT_START,006F9000
MOV IAT_END,006FA2A8
MOV CODE_SECTION,00401000

FINDCMD CODE_SECTION, "MOV R32,CONST;NOP"
MOV LINE,0
DONEXTCALL:
INC LINE
GREF LINE
MOV C_ADDR,$RESULT
CMP C_ADDR,0
JE DONE
MOV CONST,[C_ADDR+1]
FIND IAT_START,CONST
CMP $RESULT,0
JE DONEXTCALL
CMP $RESULT, IAT_END
JG DONEXTCALL
CMP [C_ADDR],0BF,1
JNE NOEDI
EVAL "MOV EDI, DWORD PTR DS:[{$RESULT}]"
ASM C_ADDR,$RESULT
NOEDI:
CMP [C_ADDR],0BB,1
JNE NOEBX
EVAL "MOV EBX, DWORD PTR DS:[{$RESULT}]"
ASM C_ADDR,$RESULT
NOEBX:
CMP [C_ADDR],0BE,1
JNE NOESI
EVAL "MOV ESI, DWORD PTR DS:[{$RESULT}]"
ASM C_ADDR,$RESULT
NOESI:
CMP [C_ADDR],0BD,1
JNE NOEBP
EVAL "MOV EBP, DWORD PTR DS:[{$RESULT}]"
ASM C_ADDR,$RESULT
NOEBP:
JMP DONEXTCALL
DONE:
RET


SinaDiR 06-02-2015 13:11

1 Attachment(s)
Obsidium unpacking:
1.use ObsiduimOEP.asm to find OEP;{Tnx to mm10121991}
2.use Mr.reCoder Script;
3.use attached file;{Mr.reCoder script fixed}
4.use ObsiduimIATFixer.asm;
5.enjoy. file was unpacked but vm not fixed.

giv 06-05-2015 16:25

Here is some advice.
Instead of manual imput of code base VA:
Quote:

MOV CODE_SECTION,00401000
just use:
Quote:

gmi eip, CODEBASE
mov CODE_SECTION, $RESULT
Is more safe IMHO.

cybercoder 06-06-2015 20:20

You can also use universal import fixer to find direct calls and fix them.

the_beginner 07-08-2015 02:23

Quote:

Originally Posted by SinaDiR (Post 99900)
Obsidium unpacking:
1.use ObsiduimOEP.asm to find OEP;{Tnx to mm10121991}
2.use Mr.reCoder Script;
3.use attached file;{Mr.reCoder script fixed}
4.use ObsiduimIATFixer.asm;
5.enjoy. file was unpacked but vm not fixed.

can someone upload this script somewhere for me please, I can not download any files since few days, I don't know why, 2 weeks ago there was no problem
Thanks in advance


All times are GMT +8. The time now is 16:43.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX