zardus / preeny

Some helpful preload libraries for pwning stuff.
BSD 2-Clause "Simplified" License
1.57k stars 170 forks source link

Struggling with Desock #36

Open tomirio619 opened 6 years ago

tomirio619 commented 6 years ago

Hello,

I'm trying to use preeny to be able to fuzz StrongSwan, which is an IPsec implementation. I make use of a named pipe to feed my input to the process (which works with the test case provided by preeny) When enabling debug and starting StrongSwan, it tells me that the following happened (using desock):

--- synchronization of fd 0 to 510 shutting down due to read error ''

During loading of the process, it does throw a couple of warnings: (from StrongSwan's side):

00[NET] unable to set IP_PKTINFO on socket: Operation not supported
00[NET] could not open IPv6 socket, IPv6 disabled
--- Emulating bind on port 500
00[NET] unable to set IP_PKTINFO on socket: Operation not supported
00[NET] could not open IPv4 socket, IPv4 disabled

When I switch to desock_dup, it does not respond to any input. Again, it gives me some warnings:

00[NET] changing socket permissions for 'unix:///var/run/charon.ctl' failed: No such file or directory
--- Emulating bind on port 12150
00[NET] changing socket permissions for 'unix:///var/run/charon.vici' failed: No such file or directory

I've not been able to figure out what is causing this. I was wondering if you guys have any idea how this can be fixed.

Kind regards, Tom

zardus commented 6 years ago

It looks like it's doing operations on that socket that preeny doesn't intercept. To solve that, you'll need to figure out what functions it's calling (using ltrace or something) and add them to desock.c. That's a good place to start, at least.

tomirio619 commented 6 years ago

Thanks for your quick response. I will start my search from there