CISCN2022——华中分区赛后WP

前言

这次分区赛有些题目出的比较水,不过Web方向也有好几道一解零解的,总体来说时间有点不太够。菜鸡只能写写简单题,估计大佬们都跑去卷ACTF了。。。

Web

Identity23

抓包,发现回显包头有字段identity:Y0urIdentityAgain,我们添加头

发现A0ther_hldden_PaGe.php文件,访问,是一个文件上传的页面

经过测试,网站限制了结尾为jpg,尝试上传.htaccess文件,将jpg作为php解析

然后我们上传一句话,由于<?被过滤,使用<script>绕过

蚁剑连接,flag在flag.php中

FakeUpload

网站有上传功能,随便上传一个图片,然后点击访问。网站会使用reader.php进行文件读取,且有传参,考虑伪协议读取,直接尝试flag.php

得到base64源码,解码即可得到flag

PD9waHAKZWNobygiWW91IHdpbGwgZmluZCBub3RoaW5nIGhlcmUhIikKLy9mbGFne2ZmOTY1MjNiMTEyNGU4NjQ1YmY0ZmYyMjNiNTM3ZjIzfQo/Pg==

#flag{ff96523b1124e8645bf4ff223b537f23}

Re

crackme2_apk1

分析流程,就是将flag{}内的数据进行加密然后与{205,'R','t','z',30,8,8,224,'W',';',24,153,175,'=',29,148,21,'%','g','[','d','S',31,';',220,162,'F','6',211,253,190,'3'}对比

EXP如下

public class enc {

    static String encode(char[] encrypt,String keys){
        char[] uocharArray2;
        int ix = 256;
        char[] uocharArray = new char[ix];
        char[] uocharArray1 = new char[ix];
        for (int ix1 = 0; ix1 < ix; ix1 = ix1 + 1) {
            uocharArray[ix1] = keys.charAt((ix1 % keys.length()));
            uocharArray1[ix1] = (char)ix1;
        }
        int ix1 = 0;
        for (int ix2 = 0; ix2 < ix; ix2 = ix2 + 1) {
            ix1 = ((uocharArray1[ix2] + ix1) + uocharArray[ix2]) & 0x00ff;
            char c = uocharArray1[ix2];
            uocharArray1[ix2] = uocharArray1[ix1];
            uocharArray1[ix1] = c;
        }
        ix = 0;
        ix1 = 0;
        StringBuilder str = new StringBuilder();
        for (int ix3 = 0; ix3 < encrypt.length; ix3 = ix3 + 1) {
            ix = (ix + 1) & 0x00ff;
            char c1 = uocharArray1[ix];
            ix1 = ((ix1 + c1) + 136) & 0x00ff;
            char c2 = (char)((uocharArray1[ix1] + c1) & 0x00ff);
            uocharArray1[ix] = uocharArray1[ix1];
            uocharArray1[ix1] = c1;
            try{
                uocharArray2 = new char[1];
                uocharArray2[0] = (char)(encrypt[ix3] ^ uocharArray1[c2]);
                str.append(new String(uocharArray2));
            }catch(java.lang.Exception e8){
                e8.printStackTrace();
                return "";
            }
        }
        return str.toString();
    }

    public static void main(String[] args) {
        char[] encrypt= new char[32];
        encrypt = new char[]{205, 'R', 't', 'z', 30, 8, 8, 224, 'W', ';', 24, 153, 175, '=', 29, 148, 21, '%', 'g', '[', 'd', 'S', 31, ';', 220, 162, 'F', '6', 211, 253, 190, '3'};
//        encrypt = encrypt.toString();
        String key = "happygame";
        System.out.println(encode(encrypt,key));
    }
}

meikyu2

得到迷宫的地图,然后用DFS算法得到路径,转路径为输入的字符,最后将字符md5得到flag

#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
#include"stack.hpp"
#define M 99
#define N 100

//迷宫   maze[M+2][N+2]
int maze[101][101] =
{{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1},{1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1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,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1},{1,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,0},{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}; 


//用来记录走迷宫顺序的结构体
typedef struct {
	//int cx,int cy表示x和y方向的增量
	//cy+1:表示向右走  cy-1:向左走
	//cx+1:表示向下走  cx-1:向上走
	int cx, cy;
}Direction;
//数组中方向村粗顺序:右下左上
Direction direct[4] = { {0,1},{1,0},{0,-1},{-1,0} };

//用来记录当前位置,然后压入栈中
typedef struct {
	int x, y;//记录当前位置的坐标
	int di;//记录当前位置下一次移动的方向
}Box;

//判断是否走出迷宫的代码
//参数1:迷宫图 参数2:存放方向的数组 参数3:保存通路的栈
bool findPath(int maze[M + 2][N + 1], Direction direct[], LinkStack<Box>& s)
{
	//创建Box temp结构体来保存当前位置
	Box temp;
	//记录当前位置和方向
	int x=0, y=0, di=0;
	//记录下次移动的位置坐标
	int line=0, col=0;
	//一开始点位于迷宫maze[1][1]的位置,所以将该位置的值变为-1
	maze[1][0] = -1;
	//temp值记录当前位置,将di设置为-1
	temp = { 1,1,-1 };
	//将temp记录的当前位置压入栈中
	s.push(temp);
	//进入外层循环
	while (!s.isEmpty())//栈不为空
	{
		//弹出栈顶元素
		temp = s.pop();
		//更新当前位置
		x = temp.x;
		y = temp.y;
		di = temp.di+1;
		//内层循环
		while (di < 4)//尝试四个方向
		{
			//更新下一次移动的位置坐标
			line = x+direct[di].cx;
			col = y+direct[di].cy;
			//判断下一个位置能否走
			if (maze[line][col] == 0)
			{
				//如果下一个位置能够移动,就更新temp存储当前位置的值
				temp = { x,y,di };
				//将temp结构体存储当前位置的信息压入栈中
				s.push(temp);
				//更新当前位置
				x = line;
				y = col;
				//当前位置的值改为-1,表示走过了,下次不能走
				maze[line][col] = -1;
				//判断当前位置是否为迷宫出口
				if (x == M && y == N)
				{
					//把迷宫出口也压入栈中
					temp = { x, y, di };
					s.push(temp);
					//找到出口,退出函数
					return true;
				}
				else {
					//没有找到出口,但是可以移动到下一个点,那么下一个点起始移动方向更新为右,因为移动方向顺序:右下左上
					di = 0;
				}
			}
			else 
			{
				//比如一开始要往右走:如果右方向不能走,就要改变方向移动
				di++;
			}
		}

	}
	return false;
}
//测试打印迷宫通路
void test()
{
	LinkStack<Box> s;
	findPath(maze, direct, s);
	//逆序遍历栈
	int i = 0;
	int num = s.size();
	Box* data = new Box[num];
	while (!s.isEmpty())
	{
		//头删
		data[i++] = s.getTop();
		s.pop();
	}
	//对数组进行逆序遍历
	for(int j = num-1; j >=0; j--)
	{
		cout << "(" << data[j].x << "," << data[j].y << ")" << endl;
     }

}
int main()
{
	test();
	system("pause");
	return 0;
}
road = [[1,1],[2,1],[3,1],[3,2],[3,3],[2,3],[1,3],[1,4],[1,5],[1,6],[1,7],[1,8],[1,9],[1,10],[1,11],[2,11],[3,11],[4,11],[5,11],[5,12],[5,13],[6,13],[7,13],[8,13],[9,13],[10,13],[11,13],[12,13],[13,13],[14,13],[15,13],[16,13],[17,13],[17,14],[17,15],[18,15],[19,15],[20,15],[21,15],[22,15],[23,15],[24,15],[25,15],[26,15],[27,15],[28,15],[29,15],[29,16],[29,17],[30,17],[31,17],[31,18],[31,19],[31,20],[31,21],[32,21],[33,21],[34,21],[35,21],[35,20],[35,19],[36,19],[37,19],[38,19],[39,19],[39,20],[39,21],[40,21],[41,21],[42,21],[43,21],[43,22],[43,23],[43,24],[43,25],[43,26],[43,27],[44,27],[45,27],[45,28],[45,29],[45,30],[45,31],[45,32],[45,33],[46,33],[47,33],[47,34],[47,35],[48,35],[49,35],[50,35],[51,35],[51,36],[51,37],[51,38],[51,39],[51,40],[51,41],[52,41],[53,41],[53,42],[53,43],[53,44],[53,45],[54,45],[55,45],[55,46],[55,47],[56,47],[57,47],[58,47],[59,47],[60,47],[61,47],[62,47],[63,47],[63,48],[63,49],[64,49],[65,49],[65,50],[65,51],[66,51],[67,51],[67,52],[67,53],[67,54],[67,55],[67,56],[67,57],[66,57],[65,57],[65,58],[65,59],[65,60],[65,61],[65,62],[65,63],[66,63],[67,63],[67,64],[67,65],[67,66],[67,67],[67,68],[67,69],[67,70],[67,71],[68,71],[69,71],[69,72],[69,73],[69,74],[69,75],[70,75],[71,75],[72,75],[73,75],[74,75],[75,75],[75,76],[75,77],[75,78],[75,79],[75,80],[75,81],[76,81],[77,81],[77,82],[77,83],[77,84],[77,85],[77,86],[77,87],[78,87],[79,87],[80,87],[81,87],[81,88],[81,89],[82,89],[83,89],[83,90],[83,91],[84,91],[85,91],[85,92],[85,93],[86,93],[87,93],[88,93],[89,93],[90,93],[91,93],[91,94],[91,95],[91,96],[91,97],[91,98],[91,99],[92,99],[93,99],[94,99],[95,99],[96,99],[97,99],[98,99],[99,99],[99,100]]
bian = ""
for i in range(len(road)-1):
    tmp = [road[i+1][0]-road[i][0],road[i+1][1]-road[i][1]]
    if tmp==[-1,0]:
        bian+="w"
    elif tmp==[0,-1]:
        bian+="a"
    elif tmp==[1,0]:
        bian+="s"
    elif tmp==[0,1]:
        bian+="d"
print("d"+bian)

###
dssddwwddddddddssssddssssssssssssddssssssssssssddssddddssssaassssddssssddddddssddddddssddssssddddddssddddssddssssssssddssddssddddddwwddddddssddddddddssddddssssssddddddssddddddssssddssddssddssssssddddddssssssssd

Misc

PNGCracker3

分离文件得到一个加密zip,爆破png的CRC,然后修复高度得到password

使用密码打开zip得到图片,LSB隐写得到flag

ZIPCracker2

首先是一个损坏的压缩包,用winrar修复一下即可解压

其中有一张图片和一个加密的压缩包如下

然后发现得到的明文jpg文件和加密压缩包中的jpg文件大小相同,考虑使用明文攻击。使用rar将明文jpg压缩

然后使用ARCHPR进行明文攻击爆破即可

得到压缩包密码crQ2#!,解密压缩包即可得到flag

Xpxp1

xpxp.raw磁盘文件放进虚拟机分析

读进程

可以发现notepad进程,直接读取记事本内容

关键部分如下

#一段异或代码

Text:
f = open('./flag.zip', 'rb').read()
new = open('./fffflllaag.dat', 'ab')

letter = ''
secret = int(letter,16)
print(secret)
for i in f:
    n = int(i) ^ secret
new.write(int(n).to_bytes(1, 'big'))

#以及一段话

According to Homer's epic, the hero Achilles is the precious son of the mortal Polus and the beautiful fairy Thetis.
It is said that her mother Tethys carried him upside down into the Styx river when he was just born, so that he could be invulnerable. 
Unfortunately, due to the rapid flow of the Ming River, his mother didn't dare to let go of his heel.
The heel held by his mother was accidentally exposed outside the water, so the heel was the most vulnerable place, leaving the only "dead hole" in his body, so he buried the disaster. 
When he grew up, Achilles fought bravely. When he went to attack the city of Troy (the story of Trojan horse slaughtering the city), the brave Achilles singled out the Trojan general Hector, killed him and dragged his body to demonstrate. 
But later, after conquering Troy, Achilles was attacked by an arrow by Hector's brother-in-law Paris and hit his ankle - the hero fell to the ground and died at the moment of shaking.
ankle, ankle, I love ankle.The password is ??k1eAn???

这里我们可以看到有密码是??k1eAn???的形式,考虑掩码爆破压缩包密码。

磁盘文件可以使用foremost分离出文件

得到zip文件如下

发现两个文件一样,解压出来都是fffflllaag.dat。根据取证记事本的线索易知,该.dat文件是通过异或而来的,而原本的文件是一个压缩包,网络搜索相关文章,可以使用文章中的步骤恢复压缩包。

010打开DAT发现前几个字节 5A 41

按照异或:  文件头 XOR 5A41=两个相同字节。使用常见的文件头比较,发现 50 4B XOR 5A 41 = 0A 0A

说明原来是zip文件,符合线索,利用文章中的工具将其转换成ZIP文件。

最后就是压缩包密码,由上文知一个掩码密码??k1eAn???,使用ARCHPR掩码爆破可得到密码Ank1eAnk1e

打开压缩包之后,flag.txt中是一段话

按照提示把 You are the only weakness in my body md5后包上flag即可提交。

Crypto

NumberGame3

题目给了三组n c e,发现n之间有公因数,据此可以分解三个n,剩下就是rsa常规解法了,最后将三组明文先转为byte,再拼接即可,脚本如下

from Crypto.Util.number import *
import gmpy2
import sympy

n1 = 12671827609071157026977398418260127577729239910356059636353714138256023623770344437013038456629652805253619484243190436122472172086809006270535958920503788271745182898308583012315393657937467583278528574109842696210193482837553369816110424840884683667932711439417044144625891738594098963618068866281205254024287936360981926173192169919836661589685119695804443529730259703940744061684219737502099455504322939948562185702662485642366411258841082322583213825076942399375712892608077960687636100621655314604756871227708407963698548718981737143081639214928707030543449473132959887760171345393471397998907576088643495456531
e1 = 65537
c1 = 5268497051283009363591890965286255308367378505062739645805302950184343652292967525985407935922935972883557494557593439711003227737116083417992112594428400382187113609935251268634230537282408994938066541612999550555591607744019286392765549844400176442415480559773688439693874264657925123598756193286897112566420847480601040372338338442932524410598834393630019038536173336696498743879160879377504894526001205060753543289059104874467150194596404490638065573974570258671195173327475871936431769234701590572816592485898568463143587137721883610069616008902637316459660001435171054741347142470208082183171637233299493273737

n2 = 18090800828995898324812976370950614944724424095669490324214928162454640462382724191043785592350299626782376411935499259428970532102686361824967300649916495702138825182857737210486173137998811993244590794690070307872074705348982970060304389842338043432383690934814892283936018142382990267868341375956549210694354065317328612440672169232803362481090661368782599819926970968509827001203936933692777821117679448168400620234261164018167404541446201828349880887526076468982840569645753428057937172715073817332736878737709704495317549386111938639861221307607948775421897063976457107356574428602380790814162110473018856344871
e2 = 4097
c2 = 2326267610355516153575986453727161366266816656017644910981028690283132055217271939475840618294311986463011398892570340626131158223217558335139831985973737748812636360601010312490160903427322848411507157238373313053959092326875136396134997877757316339153327290508806645882428114647041522287934007579220769189583249469879165078254248922442084985860374461188259818592181294686890335242981199427715392978546977718475462727987012437677290341463732660152302257234030751774759466703002189003437204934438026047163828083902584763527752033035438078609950665211243112982373167722458975172667665849715372158378299319548194854914

n3 = 14016899139767071357961567514373780608355222973882916699129907806456201886114368147540489514960479836424236595826190295819765979835270500889626994048655508134450908075698567925938340322498944878806273261377551132596295484579752118097281084614987064680928168918147910522922020462762688924459558896249968804885885853885632349539590507675397376494346489972596290270168847103345561743327300964196811506510943971437325302822974593782292850499524055338033832053610217461760698628614971171144300450574522839157187874548994036357212297166759231255765155759405207408315314182166142015547345744054533749334516820850300569790673
e3 = 1048577
c3 = 1507157402302225700443994264641838312753363380677759942918832857396550216927941389943122383728949792984913155517202501504817319345830153748955731880333992875210194306712098593166605310784068299411946792264365247471197716329666415403718297430110977954951479772565341847358286252098930408452594561104228639615640815799731581302607522977457874347224189202268831547055389518214072278766864028489294466057175201908756749666131546163372443691718757198229262989973810951064160488114367967684657242385568733678188829354802025582496625272334309487028498614869964712744826603931510547381997149345221530469380732265014466170524


print(gmpy2.gcd(n1,n2))
p1 = 120868090235944716345994105446318835228786172245301390145356584775738388519294751713730180898851749493020580328500962269780422258928976100337444235815695965207757560255604313113109023604979547703223230402727728382985673712815731676226064619783416705007267047726656918550227108343591268963608876607828690749429
q1 = n1 // p1
print(q1)

p2 = 120868090235944716345994105446318835228786172245301390145356584775738388519294751713730180898851749493020580328500962269780422258928976100337444235815695965207757560255604313113109023604979547703223230402727728382985673712815731676226064619783416705007267047726656918550227108343591268963608876607828690749429
q2 = n2 // p1
print(q2)

print(gmpy2.gcd(n2,n3))
p3 = q2
q3 = n3 // p3

phi1 = (p1-1)*(q1-1)
phi2 = (p2-1)*(q2-1)
phi3 = (p3-1)*(q3-1)

d1 = gmpy2.invert(e1,phi1)
d2 = gmpy2.invert(e2,phi2)
d3 = gmpy2.invert(e3,phi3)

m1 = gmpy2.powmod(c1,d1,n1)
m2 = gmpy2.powmod(c2,d2,n2)
m3 = gmpy2.powmod(c3,d3,n3)

print(long_to_bytes(m1))
print(long_to_bytes(m2))
print(long_to_bytes(m3))

#flag{fb72574404901f5a37f88431b42b4872}
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇