📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  PyDBG + firefox

Topic created on: April 13, 2010 20:41 CDT by choronzon .

Hi guys,
here is my problem : I'm writing a fuzzer for firefox using PyDBG. I need to run firefox with a .html file as arg and then after a while (i.e. XXX seconds) "kill" the process, and then move to another test case. But I had some problems in killing the process and re-start firefox. Here is an initial part of my code :

...
while(1):
...
   dbg = pydbg()
   dbg.set_callback(EXCEPTION_ACCESS_VIOLATION, av_handler)
   arg = "C:\\somefile.html"
   dbg.load("C:\\Programs\\Mozilla Firefox\\firefox.exe", arg)
   dbg.run()
   ...
   # save some coverage infos
   ...
   # here i kill the process
   for (pid, proc_name) in dbg.enumerate_processes():
     if proc_name.lower() == "firefox.exe":
        hhh = kernel32.OpenProcess(PROCESS_ALL_ACCESS, False, pid)
        kernel32.TerminateProcess(hhh, 0)
... # loop again

The problem here is that most of time I'm not doing the righ thing and firefox crashes (but not because of the input file :-P) or try to restore the previous page, while a would just close the browser when the html file computation ended. Can someone suggest me something better ? I also need a way to kill the process if it takes too long time to complete a computation (i.e. in case of DoS). Is it possible to put together this kind of stuff ?
Thank you
c.

  tr4nce     April 28, 2010 12:19.23 CDT
May be instead of killing and respawning, you could try snapshotting the pristine process first and just simply keep restoring that snapshot.

  codypierce     April 30, 2010 16:28.18 CDT
To ensure Firefox doesn't reload old content you can change the settings to never remember history.

Your crash is due to the fact you are terminating the process with a debugger attached trying to handle the exception.

As for a timer look at the PAIMEIfilefuzz module in the Paimei distro. It has an example of a threaded timer that terminates the process properly.

Like qaysel mentioned you should look at a different way of fuzzing firefox. It doesnt need to go through the lag of initialization. Instead write a server that serves a new file via content-refresh achieving much faster results.

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit