Well tinand cont ca la mine merge, eu zic ca mai bine te uiti pe unde ai 
redirectat alte nebunii gen "write" :))

Gushterul

On 24 Mar 2003, Dorel Nastasa 
wrote:

> Am pus kernel_lock()/unlock() dupa ce am salvat registrii si nu merge.
> 
>  |
>  | 
> \ / E cam ce spun eu.
> 
> On Mon, 2003-03-24 at 17:51, Gushterul wrote:
> > Well sper sa nu bat campii prea tare:
> > 
> > la init :  sys_call_table[__NR_execve] = hacked_execve;
> > 
> > si 
> > 
> > int hacked_execve(struct pt_regs regs)
> >            {
> >     int ret;
> >     char *filename;
> >     lock_kernel();
> >     filename = getname((char *)regs.ebx);
> > 
> >     printk(KERN_DEBUG "EXEC: %s via: %s uid: %d euid: %d gid: %d egid: %d 
> > suid: %d sgid: %d fsuid: %d fsgid: %d pid: 
> > %d\n",filename,current->comm,current->uid,current->euid,current->gid,current->egid,current->suid,
> >  
> > current->sgid,current->fsuid,current->fsgid,current->pid);
> > 
> >     ret = PTR_ERR(filename);
> >     if(IS_ERR(filename)) { unlock_kernel();return ret;}
> > 
> >     ret = do_execve(filename,(char **)regs.ecx,(char **)regs.edx, &regs);
> 
> daca hacked_execve este generica (void), primeste parametrii pe stiva.
> In loc de do_execve am incercat sa fac "int $0x80" si apoi sa scot
> rezultatul din eax. Merge.
> Insa ceva crapa, pentru ca daca fac dupa int...:
>       sys_call_table[ __NR_sys0 ] = hacked_sys0;
>                       (al meu=0)
> crapa, cu mesajul:
> 
> Pentru o singura functie merge sa ii faci un prototip si sa il salvezi.
> Pentru NR_syscalls?????:-(
> ------------------------------------------------
>  tralala, inside syscall: 4
>  trlalaEND 4 <1>Unable to handle kernel paging request at virtual
> address 817eddbc
>  printing eip:
> c480570f
> *pde = 00000000
> Oops: 0002
> CPU:    0
> EIP:    0010:[<c480570f>]    Not tainted
> EFLAGS: 00000286
> eax: 00000018   ebx: c480592f   ecx: 00000004   edx: c1561fbc
> esi: c1561fbc   edi: 00000004   ebp: 080cd40c   esp: c1561f84
> ds: 0018   es: 0000   ss: 0018
> Process bash (pid: 7441, stackpage=c1561000)
> Stack: c1561fbc 00000004 00000018 00000018 0807d3a0 fffffff7 00000018
> c1560000
>        00000018 080cd40c 00000004 c1560000 00000018 080cd40c bffffad8
> c0108a73
>        00000001 080cd40c 00000018 00000018 080cd40c bffffad8 00000004
> 0000002b
> Call Trace:    [<c0108a73>]
> 
> Code: c7 86 00 be 28 c0 94 56 80 c4 83 c4 10 83 7f 1c 00 79 0a 83
> 
>  tralala, inside syscall: 5
>  trlalaEND 5 general protection fault: 3584
> CPU:    0
> EIP:    0010:[<c480570d>]    Not tainted
> EFLAGS: 00000286
> eax: 00000018   ebx: c480592f   ecx: 00000005   edx: c10b62e0
> esi: c1183000   edi: 00000005   ebp: 00000002   esp: c1ef3f7c
> ds: 0018   es: 0018   ss: 0018
> Process sshd (pid: 7440, stackpage=c1ef3000)
> Stack: 40243585 c1ef2000 c1ef3fbc 00000005 00000018 00000018 fffffeff
> fffffff2
>        40243585 c1ef2000 00000018 00000002 00000005 c1ef2000 40243585
> 40245e90
>        bffff078 c0108a73 40243585 00000002 400539dc 40243585 40245e90
> bffff078
> Call Trace:    [<c0108a73>]
> 
> Code: 1f 07 c7 86 00 be 28 c0 94 56 80 c4 83 c4 10 83 7f 1c 00 79
> 
> 
> 
> 
> 
> 
> >     if(ret == 0)        current->flags &= ~PT_DTRACE;
> >     putname(filename);unlock_kernel();return ret;
> >            }
> > 
> > 
> > On 24 Mar 2003, Dorel Nastasa wrote:
> > 
> > > 
> > > Modul kernel care trebuie sa monitorizeze apelurile de sistem.
> > > Daca sistemul face apel atunci sau intra in functia mea sau in cea
> > > originala a lui.
> > > Nu ar trebuie sa dea eroare.
> > > 
> > > 
> > > Ce gresesc? Mai mult ce sigur niste registri nelalocul lor insa cum...
> > > sa vad ce se intampla pe acolo?
> > > 
> > > 
> > > 
> > > On Mon, 2003-03-24 at 17:04, Claudiu Cismaru wrote:
> > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > Hash: SHA1
> > > > 
> > > > On Monday 24 March 2003 16:45, Dorel Nastasa wrote:
> > > > > Salut tuturor.
> > > > >
> > > > > Poate ma ajuta cineva cu urmatoarea problema:
> > > > > - am o functia care inlocuieste apelurile sistem, acestea fiind salvate
> > > > > intr-un tablou, functie definita:
> > > > >       asmlinkage int  functie( void )
> > > > >
> > > > > inlocuieste in sys_call_table[ __NR_open, etc... ] un apel sistem care
> > > > > este interceptat. La utilizare din userspace a apelului se intra in
> > > > > functie, se salveaza registrii, reface vechea adresa a apelului sistem,
> > > > > face int 80h, si INCEARCA sa modifice apelul sistem
> > > > > din nou pe functia mea: moment in care crapa.
> > > > 
> > > > Functia asta e intr-un kernel module ? Sau in userspace ? Daca e in kmod, ai 
> > > > tinut cont ca esti in MULTIuser/MULTItasking mode ? Adica de unde stii ca tu 
> > > > cand faci modificare sistemul nu face apel la acel syscall la care tu 
> > > > modifici adresa ?
> > > > 
> > > > PS: daca faci in userspace... sanatate...
> > > > 
> > > > - -- 
> > > >   Claudiu
> > > > -----BEGIN PGP SIGNATURE-----
> > > > Version: GnuPG v1.2.1 (GNU/Linux)
> > > > 
> > > > iD8DBQE+fx52rwEDsE5SrbgRArKYAKDqkj3ODO4seyJhhFjLdX0QO1toFwCfTHuB
> > > > jAgOTDcbactV7/lIXHWUtOg=
> > > > =X1X0
> > > > -----END PGP SIGNATURE-----
> > > > 
> > > > --
> > > > Pentru dezabonare, trimiteti mail la 
> > > > [EMAIL PROTECTED] cu subiectul 'unsubscribe rlug'.
> > > > REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > > 
> > > -------------------------------------------------------
> > > Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
> > > Xnet automatically scans all messages for viruses using RAV AntiVirus.
> > > 
> > > Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele 
> > > lor.
> > > Va rugam sa luati in considerare ca exista un risc de fiecare data cand 
> > > deschideti
> > > fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu 
> > > cauzat
> > > de virusi.
> > > 
> > > Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
> > > Please be aware that there is a risk involved whenever opening e-mail attachments
> > > to your computer and that MobiFon is not responsible for any damages caused by
> > > viruses.
> > > 
> > > --
> > > Pentru dezabonare, trimiteti mail la 
> > > [EMAIL PROTECTED] cu subiectul 'unsubscribe rlug'.
> > > REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
> > > 
> > > 
> > 
> > --
> > Pentru dezabonare, trimiteti mail la 
> > [EMAIL PROTECTED] cu subiectul 'unsubscribe rlug'.
> > REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
> > 
> > 
> > 
> > -------------------------------------------------------
> > Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
> > Xnet automatically scans all messages for viruses using RAV AntiVirus.
> > 
> > Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele 
> > lor.
> > Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
> > fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
> > de virusi.
> > 
> > Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
> > Please be aware that there is a risk involved whenever opening e-mail attachments
> > to your computer and that MobiFon is not responsible for any damages caused by
> > viruses.
> > 
> 
> 
> 
> 
> -------------------------------------------------------
> Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
> Xnet automatically scans all messages for viruses using RAV AntiVirus.
> 
> Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
> Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
> fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
> de virusi.
> 
> Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
> Please be aware that there is a risk involved whenever opening e-mail attachments
> to your computer and that MobiFon is not responsible for any damages caused by
> viruses.
> 
> --
> Pentru dezabonare, trimiteti mail la 
> [EMAIL PROTECTED] cu subiectul 'unsubscribe rlug'.
> REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
> 
> 

--
Pentru dezabonare, trimiteti mail la 
[EMAIL PROTECTED] cu subiectul 'unsubscribe rlug'.
REGULI, arhive si alte informatii: http://www.lug.ro/mlist/


Raspunde prin e-mail lui