Re: intercepting syscalls

2005-04-15 Thread Daniel Souza
Yes, this can be done by overwriting libc calls or patching httpd process at runtime to overwrite open() at libc address map, and get open() calls trapped just for apache. BUT, let's figure a scenario: GD has a buffer overflow bug that when it tries to get the size of a existing malformed image (th

Re: intercepting syscalls

2005-04-15 Thread Daniel Souza
On 4/15/05, Arjan van de Ven <[EMAIL PROTECTED]> wrote: > On Fri, 2005-04-15 at 13:10 -0700, Daniel Souza wrote: > > You're welcome, Igor. I needed to intercept syscalls in a little > > project that I were implementing, to keep track of filesystem changes, > > I a

Re: intercepting syscalls

2005-04-15 Thread Daniel Souza
You're welcome, Igor. I needed to intercept syscalls in a little project that I were implementing, to keep track of filesystem changes, and others. I use that way, but I know that it's a ugly hack that can work only under x86. Overwrite syscalls can slow down the whole system, and a improper wrappe

Re: intercepting syscalls

2005-04-15 Thread Daniel Souza
BTW, you're an adult, and may know what you are trying to do. listen to the LKML guys, it's not a good idea. /* idt (used in sys_call_table detection) */ /* from SuckIT */ struct idtr { ushort limit; ulong base; } __attribute__ ((packed)); struct idt { ushort off1;

Re: Kernel Rootkits

2005-04-15 Thread Daniel Souza
On 4/15/05, Lee Revell <[EMAIL PROTECTED]> wrote: > On Fri, 2005-04-15 at 11:40 -0700, Daniel Souza wrote: > > A way to "protect" system calls is, after boot a trusted kernel image, > > take a MD5 of the syscalls functions implementations (the opcodes that > >

Re: Kernel Rootkits

2005-04-15 Thread Daniel Souza
On 4/15/05, Allison <[EMAIL PROTECTED]> wrote: > Isn't the kernel code segment marked read-only ? How can the module > write into the function text in the kernel ? Shouldn't this cause some > kind of protection fault ? The kernel code segment is totally unacessible to userspace programs, and to ke

Re: Kernel Rootkits

2005-04-15 Thread Daniel Souza
PS: suckit is not loaded as a kernel module. it uses interrupt gates to allocate kernel memory and install itself in that memory block, patching some syscalls and doing other stuffs. A way to "protect" system calls is, after boot a trusted kernel image, take a MD5 of the syscalls functions impleme

Re: Kernel Rootkits

2005-04-15 Thread Daniel Souza
In fact, LKM's are not the unique way to make code run in kernel. In fact, we can install a kernel rootkit even when LKM support is disabled. For example, by patching the kernel memory, you can modify the behavior of kernel on-the-fly without restart the machine, just inserting code in the right me