蚁景网安新手村10道题

晚上去做蚁景网安《CTF-WEB实战技能特训班》新手村的10道题,有些不会,搜半天找不到writeup,心累,记录一下吧。

网址:http://a.y1ng.vip:1126/

01,EzLogin

1,进入,是一个登录框,随意输入用户名密码,提示“pls login as admin”。

2,用户名为admin,随意输入密码,“wrong password”。查看网页源代码,可以看到一段代码:

  <!-- SSBoYXZlIG5vIFNRTA== -->base64->asii,I have no SQL
  <!-- 7765616B -->hex->asii,weak

3,根据提示可知,是弱密码,可以用BurpSuite进行暴力破解。

Intrude->payloads模块,add from list可以选择“passwords"字典进行爆破。

4,破解得到密码:administrator,得到flag{Burp_Intruder_1s_UseFUll}。

02,canyouaccess

知识点,修改http文件头

1,打开页面,提示请从本地访问。将本地访问IP(20条)都沾上,提示,请从google.com访问

2,添加 referer: google.com,提示 请用 ABC Browser访问

3,修改User-Agent: ABC Browser

4,flag{HTTP_He4deR_c4n_b3_CoNtr0led}

5,也可使用hackbar插件做题。

<?php
	$flag = "flag{HTTP_He4deR_c4n_b3_CoNtr0led}";

	if ($_SERVER['HTTP_CLIENT_IP'] != '127.0.0.1'){
		if ($_SERVER['HTTP_X_FORWARDED_FOR'] == "127.0.0.1") {
			die("你以为我不知道X-Forwarded-For?");
		} 
		die("请从本地访问");
	}

	if ($_SERVER['HTTP_REFERER'] != 'google.com')
		die('请从google.com访问');

	if ($_SERVER['HTTP_USER_AGENT'] != 'ABC Browser')
		die('请使用ABC Browser');

	echo $flag;
?>

03,chopper

1,点进页面,标题为Chopper & AntSword,内容是一串代码:

<?php @eval($_POST['a']); ?>

2,用蚁剑连接,网址:http://a.y1ng.vip:1126/chopper/ ,密码:a,能看到整个网站目录结构。逐目录查找,根目录下有一个flag文件夹,打开得到flag{07d12a5e-1649-fc7c-3e9f-e89243c0117e}

3,知识点:一句话木马

04,cookie

1,打开页面,查看源代码,都看不到有用信息。用BurpSuite进行抓包。

2,抓包没有有用信息,点击send,看到返回的cookie字段包含 fl4g.txt,直接访问,得到f14g.txt

05,employeeswork

<?php
include 'flag.php';
if (isset($_GET['source']) && $_GET['source'] == 'true') {
    show_source(__FILE__);
    exit;
}
if (isset($_GET['work'])) {
    $what_is_your_attitude_of_your_work = $_GET['work'];
    $what_you_say_can_gain_more_income = "y1ng_pretty_handsome";
    $what_Precoce_de_Malingre_said = preg_replace(
            "/$what_you_say_can_gain_more_income/",'', $what_is_your_attitude_of_your_work
    );
    if ($what_Precoce_de_Malingre_said === $what_you_say_can_gain_more_income) {
        work_worthy();
    }
}
?>

知识点:preg_replace()函数

根据题目可知,work参数,替换掉“y1ng_pretty_handsome”后,仍然等于“y1ng_pretty_handsome”,那就是将一个“y1ng_pretty_handsome”插入到另一个““y1ng_pretty_handsome”中,有多种写法,比如

访问网址:http://a.y1ng.vip:1126/employeeswork/index.php?work=y1ng_y1ng_pretty_handsomepretty_handsome

得到flag{iNput_R3pl4c3_i5_W3aK}

06,ezinclude

<?php
highlight_file(__FILE__);
error_reporting(0);
/*flag in flag.php*/

if (!isset($_POST['abc']))
	die('i am abc, post it damn you');

if (strpos($_POST['abc'],"http"))
	die('fxck ur rf1 out of shit');

if (strpos($_POST['abc'],"hello123"))
	die('i am abc! you fxcking hacker');

if (file_get_contents($_POST['abc']) != 'hello123' )
	die('file get contents! FILE! GET! CONTENTS!');

include($_POST['file']);

没做出来,也没搜索到

07,ezsearch

1,打开网页,看到“where is flag“。

2,查看源代码,在最下面看到flag{1st_st3p_SH0w_s0uRce}。

08,robots

1,打开,看到一段文字“听说狗东仓库使用robots配货”。

2,访问robots.txt文件,得到如下提示:

User-agent: *
Disallow: 
/robot-nurses
/flag.htmlw

3,访问flag.html文件,得到“no~"

4,访问robot-nurses,最下方得到Y1ng{R0bots_m4ke_u_Kn0w_s0m3th1ng}。下回还是f12查看吧。

09,vim

1,页面提示“I wrote this page by vim!”

2,vim意外退出时,自动生成备份文件 .文件名.swp 文件,第二次生成swo,第三次生成 swn文件。

3,访问 .index.php.swp ,自动下载文件,txt打开,得到flag{v1m_b4ckup_swp_aNd_~}

10,wtfbutton

1,看到一个flag按钮,但是不能点击。F12查看源代码,看到输入框有限制:

<input disabled="" class="btn btn-default" style="height:50px;width:200px;" type="submit" value="flag" name="auth">

2,将 disabled="" 删除后,按回车运行,得到Y1ng{E1em3nt_123s_Us3fulll}。

posted @ 2022-07-14 21:31  小黑眼睛  阅读(845)  评论(0编辑  收藏  举报