LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-27-2009, 02:28 PM   #1
hamedn
LQ Newbie
 
Registered: Sep 2009
Posts: 22

Rep: Reputation: 0
hooking interrupts (int 0x80 and sysenter)


Hi my friends
How I can hook interrupt 0x80 and sysenter via assembly code so that I can read cpu registers before interrupt execution?
Please help me andn if it's posible for u send me some approprate assembly code . sincerely u

Last edited by hamedn; 09-27-2009 at 02:30 PM.
 
Old 09-27-2009, 08:45 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
i dont think you can hook an interrupt in a 32 bit os
 
Old 09-28-2009, 12:42 AM   #3
hamedn
LQ Newbie
 
Registered: Sep 2009
Posts: 22

Original Poster
Rep: Reputation: 0
tanx my friend
but i think it's possible but i don't know how ?
for example by write a module and replce it's address whit int 0x80 when system try to execute this interrupt first execute my module and after this handle interrupt.isn't it.
i need some assembly code that do this.
please guid me .
 
Old 09-28-2009, 11:58 AM   #4
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
I do not really want to point you to certain sites as they may be deemed to be malicious and somewhat dubious however you may find valid information by searching for "system call hijacking","IDT","rootkit" and other related terms. What you are trying to do is a common approach for hackers and rootkit authors to try and gain privileged access to certain parts of a system. You may find out a lot by looking at the kernel source to see how the kernel initializes the IDT on boot up. Look at linux/arch/i386/{traps,head}.c in the kernel sources , amongst others.

As you can see this may be seen as being against forum rules and I trust the moderators will see that I am trying to be diplomatic and helpful here. Such topics should be of interest to anyone involved in Linux security and OS internals. This is not really a simple subject and you are best doing more research into this.
 
Old 09-29-2009, 06:10 PM   #5
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
That vector is set up at boot time. If you want to hook it, you either have to compile your own kernel or write a plugin driver module that will do what you want to do, then invoke that driver module from a userspace program that presumably is running as root. You then could change the vector table.

All the documentation is available; it shouldn't be too tough to do.

And, yes. This is a technique that a cracker would use. But there are also legitimate uses for it.
 
Old 09-30-2009, 12:36 AM   #6
hamedn
LQ Newbie
 
Registered: Sep 2009
Posts: 22

Original Poster
Rep: Reputation: 0
hi jiml8
thank u . could u give me some useful document.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
invalid conversion from 'int' to 'unsigned int*' tigerhp Programming 2 03-02-2008 04:21 PM
boot-as = 0x80? (booting windows from lilo) somae Slackware 4 06-27-2007 03:39 PM
invalid types ‘int[int]’ for array subscript medha Programming 16 08-25-2006 08:30 AM
Problem with sending a signed int to another signed int. Almost random number given. RHLinuxGUY Programming 8 08-15-2006 11:38 AM
invalid types int[int] for array subscript scuzzman Programming 2 11-16-2004 09:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration