Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  Free BSD php extension dynamic analysis

Topic created on: July 10, 2011 02:40 CDT by gemoroy .

Hi i'm reversing shared library which is an php zend extension.
My first goal was to determine which function of this module will be called by a standard php handler and it's input.
Problem is, apache is preforked so i can't determine which child will handle the request as a result i can't just attach with gdb and add rwatch to a prospective(after static analysis) function.
What i've done already in short: i've written a kernel module which marks memory region where module is mapped as non-executable, and hook's pagefault handing.
parsing exception frame to determine address of code that called lookup it's stack and so on.
So after that seems like i've achieved my goal, and now i can emulate this input by my own software and debug it as normal, or, for example put it into radare VM.
But i was wondering if there is a better way to do it?
What for example if i did't have xd bit or running i386 distro without PAE?
Thanks in advance!
PS:I was thinking about reloc redirection but loading address are randomized.

  NirIzr     July 13, 2011 13:17.10 CDT
won't it be easier to patch (i think you can even configure it in the appache conf files) it to it will only create one working thread to handle requests?..

  gemoroy     July 14, 2011 01:21.09 CDT
> NirIzr: won\'t it be easier to patch (i think you can even configure it in the appache conf files) it to it will only create one working thread to handle requests?..
Omg, sure it would! Solution was so simple that i somehow missed it, thank you, NirIzr =).
PS:However my solution now comes in handy in unpacking for example when unpacked code gets mapped in section, and you need to break there on execution to find OEP, So it is not lost in vain =))

  janjensen     September 26, 2011 05:06.50 CDT
Did they update the patch?

Note: Registration is required to post to the forums.

Active in Last 5 Minutes
obnoxioussean

There are 29,874 total registered users.


Recently Created Topics
Attach to program us...
May/13
IDA PRO how to make ...
May/12
FACT: OpenRCE is dead.
May/08
Int 3 anti debug?
May/05
help needed - Beginn...
May/03
Attaching IDA Pro to...
Apr/27
File type
Apr/21
Debugging iphone app...
Apr/15
Attaching
Apr/12
Displaying data and ...
Apr/11


Recent Forum Posts
Ollydbg 2.0 - Plugin...
openrce...
IDA PRO how to make ...
codeinject
FACT: OpenRCE is dead.
codeinject
IDA Resource Viewer ...
r2x64
FACT: OpenRCE is dead.
djnemo
FACT: OpenRCE is dead.
codeinject
FACT: OpenRCE is dead.
pedram
help needed - Beginn...
araujo
Attaching IDA Pro to...
codeinject
Int 3 anti debug?
codeinject


Recent Blog Entries
sweetyss
May/18
Adam Wainwright continues t...

lowpriority
Apr/13
OllyMigrate Plugin for Olly...

everdox
Mar/08
2 anti-trace mechanisms spe...

everdox
Mar/07
Advanced debugging techniques

everdox
Mar/06
Branch tracing and LBR acce...

More ...


Recent Blog Comments
clarisonic on:
Apr/03
New version of Ollydbg!

clarisonic on:
Apr/03
New version of Ollydbg!

trackerx90 on:
Mar/04
SuppressDebugMsg As Anti-De...

coachfactory on:
Feb/25
Portable Executable Format ...

coachfactory on:
Feb/25
A new Anti-Olly trick.

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit