web向wargame:natas通关手记

    与之前做过的跟ssh和终端打交道的题目不同,在natas当中,我们通过寻找一个网站的漏洞来获得通向下一个关卡的钥匙。

    在开始之前,先介绍一个工具:curl

    curl是利用URL语法在命令行方式下工作的开源文件传输工具。在处理与web有关的问题时,简单易行的命令行有时候会比通过浏览器更加便捷。

    使用curl能方便地修改get和post的参数,甚至cookie,以及http header当中的各个参数。



Natas 0:

    题目并无给出太多信息,如果通过浏览器打开,只能看到“You can find the password for the next level on this page.”这样一句话在空荡荡的屏幕上。这时候就轮到curl出场了。

 

 curl -isu natas0:natas0 http://natas0.natas.labs.overthewire.org

HTTP/1.1 200 OK
Date: Sat, 16 Aug 2014 14:21:46 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Fri, 12 Jul 2013 13:35:26 GMT
ETag: "25fa6-396-4e15095574380"
Accept-Ranges: bytes
Content-Length: 918
Vary: Accept-Encoding
Content-Type: text/html
X-Pad: avoid browser bug

<html>
<head>
<!-- This stuff in the header has nothing to do with the level -->
<link rel="stylesheet" type="text/css" href="http://natas.labs.overthewire.org/css/level.css">
<link rel="stylesheet" href="http://natas.labs.overthewire.org/css/jquery-ui.css" />
<link rel="stylesheet" href="http://natas.labs.overthewire.org/css/wechall.css" />
<script src="http://natas.labs.overthewire.org/js/jquery-1.9.1.js"></script>
<script src="http://natas.labs.overthewire.org/js/jquery-ui.js"></script>
<script src=http://natas.labs.overthewire.org/js/wechall-data.js></script><script src="http://natas.labs.overthewire.org/js/wechall.js"></script>
<script>var wechallinfo = { "level": "natas0", "pass": "natas0" };</script></head>
<body>
<h1>natas0</h1>
<div id="content">
You can find the password for the next level on this page.

<!--The password for natas1 is gtVrDuiDfck831PqWsLEZy5gyDz1clto -->
</div>
</body>
</html>


   

    以上是输出,上半部分是-i选项输出的http请求头,下半部分是返回的html文档。可以很容易发现,文档中有这样一句话:<!--The password for natas1 is gtVrDuiDfck831PqWsLEZy5gyDz1clto -->。这就是我们想要的密码了。

    当然,查看源代码这个工作不需要curl也能做到,直接右键“view source code”或者在chrome或firefox下f12打开调试控制台,都可以很容易看到这句话。




Natas 1:

   通过浏览器打开时,能看到这么一句话“You can find the password for thenext level on this page, but rightclicking has been blocked!”.理论上它应当是把右键屏蔽了。然而事实上我发现,无论是在chrome还是firefox当中,只要不点在中间那一块白色区域上,都能右键打开菜单。所以完全与上一题相同的三种方法,就能够找到答案了。




Natas 2:

   这次的无论是网页还是源代码,可就真的空空如也了。有点让人头疼。可注意到“<img src="files/pixel.png">”这一句,就给我们提了个醒。它暴露了服务器的文件夹结构,如果没有设置合理的访问权限的话,我们或许能够获得一些信息。

 

 curl -isu natas2:ZluruAthQk7Q2MqmDeTiUij2ZvWy2mBi http://natas2.natas.labs.overthewire.org/files/

   很容易发现,该目录下有users.txt这么一个文件,它很像是我们需要的文件。而访问的结果也确实如此,在里面找到了natas3的密码。



Natas 3:

打开这个网页,你会发现,页面上如同上一题,什么都没有。

循着上一题的经验,你开始寻找源代码里有没有泄露服务器上文件结构的线索,仍然什么都没有。

于是你陷入了沉思。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值