免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4012 | 回复: 8
打印 上一主题 下一主题

请求高手给出一个系统调用替换能运行的例子 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-15 12:21 |只看该作者 |倒序浏览
本人使用的内核版本是2.6.31-20-generic,请求高手给出一个系统调用替换的例子,我的系统是 UBUNTU!谢谢了本人在网上找到的全不都不能运行的!

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
2 [报告]
发表于 2010-05-15 14:16 |只看该作者
既然你网上找到都不能用,那又怎么保证现在给你一个你能用呢。其实个人觉得是个内核版本有关了。

如果你想测试劫持系统调用,那么可以先找一个例子,在人家测试的版本上先看看能不能用。

我之前写过一个系统调用劫持的总结,其中的程序能在2.6.18.3的内核上成功执行。

论坛徽章:
0
3 [报告]
发表于 2010-05-15 18:42 |只看该作者
去UBUNTU论坛下载官方文档去

论坛徽章:
0
4 [报告]
发表于 2010-05-15 19:35 |只看该作者
本帖最后由 liuxuejin 于 2010-05-15 21:44 编辑

回复 2# Godbach

/home/liuxuejin/import/hackopen/hack_open.c:33: error: expected declaration specifiers or ‘...’ before string constant
/home/liuxuejin/import/hackopen/hack_open.c:33: warning: data definition has no type or storage class
/home/liuxuejin/import/hackopen/hack_open.c:33: warning: type defaults to ‘int’ in declaration of ‘ODULE_DESCRIPTION’
/home/liuxuejin/import/hackopen/hack_open.c:33: warning: function declaration isn’t a prototype
/home/liuxuejin/import/hackopen/hack_open.c:35: error: expected declaration specifiers or ‘...’ before string constant
/home/liuxuejin/import/hackopen/hack_open.c:35: warning: data definition has no type or storage class
/home/liuxuejin/import/hackopen/hack_open.c:35: warning: type defaults to ‘int’ in declaration of ‘ODULE_AUTHOR’
/home/liuxuejin/import/hackopen/hack_open.c:35: warning: function declaration isn’t a prototype
/home/liuxuejin/import/hackopen/hack_open.c:37: error: expected declaration specifiers or ‘...’ before string constant
/home/liuxuejin/import/hackopen/hack_open.c:37: warning: data definition has no type or storage class
/home/liuxuejin/import/hackopen/hack_open.c:37: warning: type defaults to ‘int’ in declaration of ‘ODULE_LICENSE’
/home/liuxuejin/import/hackopen/hack_open.c:37: warning: function declaration isn’t a prototype
/home/liuxuejin/import/hackopen/hack_open.c:53: error: expected declaration specifiers or ‘...’ before string constant
/home/liuxuejin/import/hackopen/hack_open.c:53: error: expected declaration specifiers or ‘...’ before ‘(’ token
/home/liuxuejin/import/hackopen/hack_open.c:53: error: expected declaration specifiers or ‘...’ before numeric constant
/home/liuxuejin/import/hackopen/hack_open.c:53: error: stray ‘##’ in program
/home/liuxuejin/import/hackopen/hack_open.c:53: error: expected declaration specifiers or ‘...’ before ‘args’
/home/liuxuejin/import/hackopen/hack_open.c:53: warning: data definition has no type or storage class
/home/liuxuejin/import/hackopen/hack_open.c:53: warning: type defaults to ‘int’ in declaration of ‘printk’
/home/liuxuejin/import/hackopen/hack_open.c:53: warning: function declaration isn’t a prototype
/home/liuxuejin/import/hackopen/hack_open.c:53: error: conflicting types for ‘printk’
/home/liuxuejin/import/hackopen/hack_open.c:53: note: a parameter list with an ellipsis can’t match an empty parameter name list declaration
include/linux/kernel.h:240: note: previous declaration of ‘printk’ was here
/home/liuxuejin/import/hackopen/hack_open.c: In function ‘new_execve’:
/home/liuxuejin/import/hackopen/hack_open.c:499: error: implicit declaration of function ‘getname’
/home/liuxuejin/import/hackopen/hack_open.c:499: error: ‘struct pt_regs’ has no member named ‘ebx’
/home/liuxuejin/import/hackopen/hack_open.c:499: warning: assignment makes pointer from integer without a cast
/home/liuxuejin/import/hackopen/hack_open.c:511: error: ‘struct pt_regs’ has no member named ‘ecx’
/home/liuxuejin/import/hackopen/hack_open.c:513: error: ‘struct pt_regs’ has no member named ‘edx’
/home/liuxuejin/import/hackopen/hack_open.c:529: error: implicit declaration of function ‘putname’
/home/liuxuejin/import/hackopen/hack_open.c: In function ‘intercept_init’:
/home/liuxuejin/import/hackopen/hack_open.c:557: error: stray ‘##’ in program
/home/liuxuejin/import/hackopen/hack_open.c:557: error: ‘__NR_’ undeclared (first use in this function)
/home/liuxuejin/import/hackopen/hack_open.c:557: error: (Each undeclared identifier is reported only once
/home/liuxuejin/import/hackopen/hack_open.c:557: error: for each function it appears in.)
/home/liuxuejin/import/hackopen/hack_open.c:557: error: expected ‘]’ before ‘x’
/home/liuxuejin/import/hackopen/hack_open.c:557: error: stray ‘##’ in program
/home/liuxuejin/import/hackopen/hack_open.c:557: error: ‘new_’ undeclared (first use in this function)
/home/liuxuejin/import/hackopen/hack_open.c:557: error: expected ‘;’ before ‘x’
make[2]: *** [/home/liuxuejin/import/hackopen/hack_open.o] 错误 1
make[1]: *** [_module_/home/liuxuejin/import/hackopen] 错误 2
make[1]:正在离开目录 `/usr/src/linux-headers-2.6.31-20-generic'
make: *** [default] 错误 2

论坛徽章:
0
5 [报告]
发表于 2010-05-15 21:45 |只看该作者
到底什么时候错误,我估计是我粘贴的时候 ,多粘贴了什么

论坛徽章:
0
6 [报告]
发表于 2012-05-16 17:24 |只看该作者
回复 5# liuxuejin


    我擦,楼主,直接粘的有好多问题的好不?

论坛徽章:
0
7 [报告]
发表于 2012-05-16 17:29 |只看该作者

2.6.31应该很多,就等有缘人赠送吧

论坛徽章:
0
8 [报告]
发表于 2014-02-17 22:13 |只看该作者
粘贴人家的MODULE粘贴丢了M,太明显了

论坛徽章:
0
9 [报告]
发表于 2014-02-28 19:30 |只看该作者
你这完全是编译错误呀!
看看8L的答复
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP