1、題目資訊
FLAG被我弄丟了>_<不過,JBN應該記得,或許你能從他那得到一些線索。
附件是壓縮包有密碼。。
2、解題方法
暴力破解壓縮包,測試長度為6,選擇所有數位
得到密碼後解壓
train.py
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import cv2
class JBN(nn.Module):
def __init__(self):
super(JBN, self).__init__()
self.main = nn.Sequential(
nn.Linear(100, 256),
nn.ReLU(),
nn.Linear(256, 512),
nn.ReLU(),
nn.Linear(512, 452 * 280),
nn.Tanh()
)
def forward(self, x):
img = self.main(x)
img = img.view(-1, 452, 280)
return img
def watch_flag(img):
flag = cv2.imread('./data/data/flag.png')
gray_image = cv2.cvtColor(flag, cv2.COLOR_BGR2GRAY)
flag_tensor = torch.from_numpy(np.array(gray_image))
flag_tensor = flag_tensor.unsqueeze(0).transpose(1, 2)
img_tensor = img
flag_tensor = flag_tensor.unsqueeze(0)
img_tensor = img_tensor.unsqueeze(0)
loss_fn = torch.nn.MSELoss()
loss = loss_fn(flag_tensor.float(), img_tensor)
return loss
jbn = JBN()
g_optimizer = torch.optim.Adam(jbn.parameters(), lr=0.001)
min_loss = float('inf')
for epoch in range(10):
random_noise = torch.randn(1, 100)
jbn_img = jbn(random_noise)
g_optimizer.zero_grad()
g_loss = watch_flag(jbn_img)
g_loss.backward()
g_optimizer.step()
with torch.no_grad():
if g_loss < min_loss:
min_loss = g_loss
torch.save(jbn.state_dict(), 'jbn.pth')
還有一個jbn.pth
懶得看了,直接交給GPT看看能不能解
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import cv2
class JBN(nn.Module):
def __init__(self):
super(JBN, self).__init__()
self.main = nn.Sequential(
nn.Linear(100, 256),
nn.ReLU(),
nn.Linear(256, 512),
nn.ReLU(),
nn.Linear(512, 452 * 280),
nn.Tanh()
)
def forward(self, x):
img = self.main(x)
img = img.view(-1, 452, 280)
return img
jbn = JBN()
jbn.load_state_dict(torch.load('jbn.pth'))
random_noise = torch.randn(1, 100)
jbn_img = jbn(random_noise)
jbn_img = jbn_img.squeeze().detach().numpy()
jbn_img = (jbn_img + 1) / 2 # 將影象畫素值範圍從[-1, 1]轉換為[0, 1]
jbn_img = (jbn_img * 255).astype(np.uint8) # 將影象畫素值轉換為[0, 255]的整數
jbn_img = cv2.resize(jbn_img, (280, 452)) # 調整影象大小為452x280
flag_image = Image.fromarray(jbn_img)
flag_image.save('flag.png')
得到flag圖片,需要翻轉一下,放到PS裡垂直翻轉畫布即可
1、題目資訊
小C收到了一個加密的word檔案,但是苦於沒有密碼,你能幫他解開嗎?
2、解題方法
有個加密檔案,所以要破解密碼,010開啟分析一下
拉到尾部範圍內也是有很多字串資訊,其中有一段十六進位制,但這些都解不出來沒啥用,仔細往上看可以發現一些宏的現象。
所以我們可以用oletools提取出vba指令碼。
oletools是一個python工具包,用於分析Microsoft OLE2檔案,如Microsoft Office檔案或Outlook訊息,主要用於惡意軟體分析、取證和偵錯。
其中的 olevba 用來從檔案中提取和分析VBA宏程式碼,範例:
# 掃描單個檔案
olevba file.doc
# 掃描單個檔案 只顯示VBA程式碼,不分析
olevba file.doc -c
# 掃描單個檔案 顯示解碼之後的混淆字串
olevba file.doc --decode
# 掃描單個檔案 顯示經過字串反混淆之後的VBA宏程式碼
olevba file.doc --reveal
瞭解之後我們提取一下
olevba attachment.doc
得到
Sub XOREncryptFile()
Dim numbers(8) As Integer
numbers(0) = 19
numbers(1) = 71
numbers(2) = 122
numbers(3) = 99
numbers(4) = 65
numbers(5) = 111
numbers(6) = 43
numbers(7) = 67
Dim CurrentDirectory As String
CurrentDirectory = ".\"
If Dir(CurrentDirectory & "abc") = "" Then
Exit Sub
End If
Dim FileNumber As Integer
FileNumber = FreeFile
Open CurrentDirectory & "abc" For Binary Access Read Write As #FileNumber
Dim FileContent As String
FileContent = Input$(LOF(FileNumber), #FileNumber)
Close #FileNumber
Dim EncryptedContent As String
For i = 1 To Len(FileContent)
EncryptedContent = EncryptedContent & Chr(Asc(Mid(FileContent, i, 1)) Xor numbers((i - 1) Mod 8))
Next i
FileNumber = FreeFile
Open CurrentDirectory & "enc" For Binary Access Write As #FileNumber
Put #FileNumber, , EncryptedContent
Close #FileNumber
End Sub
仔細分析發現是xor,而被xor的字串感覺像是檔案最下面的那一串十六進位制,總覺得這串肯定有用
於是我們去解一下看看,注意這裡我們通過vba指令碼可以得到「13477a63416f2b43」這個就是互斥或的key
然後得到密碼去開啟檔案得到資訊
UEsDBBQACQAIAFZ/RVfYoRV90yAAAJUhAAAEAAAAZmxhZy5wbme1Wvc3HM4Wl0TiKwUJUUIiBRuiR7DKCtFWWdFZLVr0tnpPEZ1NdLFL9LJ6t1jRIgiy+tqou4LVgtVZz/edV/6Ad979Yc7cmTtn5jMz98znzkzUS4jKjat3rlJRUd0AqyrqUFFRA87zcn9dOU9HznLkqajuU4EV5fX8EOtIaRgBfSs80BWZr0pnan6h9SIu6lHhYNFLCI/n8g/a21BcXjwizfRt3btiWo0NJZbRDC7VBdyXvDPUQuvSQaSzzJ3pOJ7nJ1Dav6j+LfcZzq6ZUf1HTMVVIf+te/w/K2cfBP+V/6KmzaToDzn007C+g7VnQitSUc2xcAH+Wff15uWBQi3y1v6f1IweOTKoc21SQkm8sGHCDsrPfSYCcdgFWQoxUlG5vyWGAfZwGwS58qez77CRQc37goeP8mZktSN9hvpfzz5ldnGdnV307N+QkWkM2ljZfxTa2ufh8VGiQHPfvZYAXFEuE8w327IcUexWdLtbZ4yzsNv+XVmKnwEFlrMU8jNLkuH+pjf0J84EHfxl5EOuGyRcy/7ifKToO1za9dNy+9pa9dcvlmS3+QWVB4Gg/IbQCfKfQGXG1Ic0pMDaBEZbgszdQmxgU3YGe87qKg0azRlzxbbcRTwfPwH1dzNfxquPG0smH7K3hvCXDLYkR+YcfDLn4IVq25B399Q4O4qLm+qQJ8fQNhux1mBupPm40t6ekkXDaNZ0d8E0aIWwObv9+mgHNOLpbvXKzk2LPIXfuNkdFYDzOT38xZKnuNAkFLq839VgL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5XAi5HgOTO7p5GuABVk6z5+zyqVlpjC9o27KvO9tOGx6RxLdZPqmO3ObEzZ/XrwafP6Q1zkIC9UzOmBRwQOzQEOMX7LtUxeCgZKhTyAKY+Oe9OxUUQKMA7iRj8Jr/3i+8D24+OFyohqR2YTZBcA6YjC3KUUhdCmZDvqeC8F0bR/I63ujh05Fsuvv9c3jjFkJxdim9drhkp+1x5TgcH3SaXc4cO1HkyhnquX4G0feVTj0098WtJ2lY8MzeL2rgbI0IQNLD8RGBzDZ0ba7scz6mFtApRJyx1ukZImjmUGbyAXTRluDzg1uPFKrTXS0v1L1HEkVmm785QOwEAB23AC8+Flb30D1mAibpUVBde/v0X4NX3d6Ca+tmL/7J/mfslq6/HjdzmEkmkbnz8bWKMnsRvvmTFeuFfBsI8gdLQbMHIeyvmnizXExjnclgHzItg9/u30781NIgh7ZJsVXX/Zfvm1qKvbjVwoLCBvOonR5PcFBW4vtk+l8E4t/29IK695tvYTcd/mbpvSGYaWi5SN8o4D6Vf+Vfhz/vRAxYHlKUWMSoEVW6vdHBFiO6nYCx+ieZUQG4GNhLI/u+OZG8qfUpTkwUNd57+IP1l7LxK9W95/rKy7NJ/NHl52MX/l3Iop8mOozaHNz/7WwUrQRTLFV69+wdQSwECPwAUAAkACABWf0VX2KEVfdMgAACVIQAACAAkAAAAAAAAACAAAAAAAAAAZmxhZy5wbmcKACAAAAAAAAEAGAB4FtrCYffZARc9ZA1i99kBhPTMwmH32QFQSwUGAAAAAAEAAQBaAAAA+SAAAAAA
百度一下可以知道這是一串zip的base64形式,我們轉成zip儲存,但發現有密碼。。。010看一波
我們發現第A列下第二行處04這個地方檔名長度有問題,我們給它改回去改成08
但還是需要密碼,我們用偽加密解看看
成功解決,解壓後是一張圖片內容就是flag
1、題目資訊
Do you know the classic encryption method for zip?
2、解題方法
明文攻擊,嘗試後發現所給的key檔案就是經過壓縮的secret key.zip的前半段,於是直接拿來用
.\bkcrack -C purezip.zip -c "secret key.zip" -p key -o 0 >1.log
得到金鑰e63af7cc 55ef839d dc10b922,直接解壓
.\bkcrack -C purezip.zip -c "secret key.zip" -k e63af7cc 55ef839d dc10b922 -d 1.zip
注意此時的zip是壓縮之後的,需要解壓一下,然後cyberchef裡面使用raw inflate解一下
壓縮包註釋提示password is two bytes
直接zip2john和hashcat進行爆破,得到密碼為$HEX[9c07]
隨便寫個指令碼解壓,然後裡面給了一串金鑰,結合zpaq檔案尾的提示,一眼丁真直接爆
.\bkcrack -k e48d3828 5b7223cc 71851fb0 -r 3 ?b
得到密碼
MD5再用bandizip解開zpaq壓縮包即可。
1、題目資訊
聽聽這是什麼
2、解題方法
我們先掃一下hint.png
明顯是漢信碼,但線上工具掃不出來,然後發現還有一個可以掃「中國編碼APP」下載一下APP掃就行了
得到密碼「0urS3cret」我們利用ourSecret來解bmp檔案,匯入檔案,輸入密碼得到txt檔案。
這裡為什麼用這個工具,因為密碼的提示以及檔案的名字就可以想到。
開啟txt得到
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_}{-?!
像是某種表。。先不管它了看看WAV吧
音訊的話試了好多發現使用Sonic Visualiser可以,下載官網:https://www.sonicvisualiser.org/
開啟一看就是十進位制,右上方是設定。
我們需要提取十進位制資料,左上角匯出圖片然後寫指令碼讀畫素
from PIL import Image
img = Image.open('1.png')
flag = []
for x in range(58,6561,17):
for y in range(868):
col = img.getpixel((x,y))[0]
if(col >= 210):
flag.append(y)
break
flgg = []
for i in flag:
if(i < 250):
print(0,end='')
elif(i < 280):
print(1,end='')
elif(i < 320):
print(2,end='')
elif(i < 350):
print(3,end='')
elif(i < 390):
print(4,end='')
elif(i < 430):
print(5,end='')
elif(i < 470):
print(6,end='')
elif(i < 520):
print(7,end='')
elif(i < 580):
print(8,end='')
else:
print(9,end='')
然後得到十進位制資料
0900030907000309100003100007100307100022277031005192203203432284426284735274836292742424842463147282734424837362942334460720080624061811100213180401000920140308111000181321001411220513021020010006211814083733362813100301092108201804080511070022131021010910032111041881000051310002215140514150005142926442845316448075218191108130662196162281413321042462081305141712001952141367676763
根據我們第一步解出來的txt檔案中的表猜測可能是每兩位int一下後再去表裡找相應的字元,如果超出範圍就捨去。
table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_}{-?!"
a = "0900030907000309100003100007100307100022277031005192203203432284426284735274836292742424842463147282734424837362942334460720080624061811100213180401000920140308111000181321001411220513021020010006211814083733362813100301092108201804080511070022131021010910032111041881000051310002215140514150005142926442845316448075218191108130662196162281413321042462081305141712001952141367676763"
for i in range(len(a)//2):
try:
ii = a[2*i:2*i+2]
print(table[int(ii)],end='')
except:
continue
但只得到了右半邊的flag
腦洞一下,刪掉第一個0再轉一下,得到了另一半flag,為什麼這麼幹呢?我們可以分析下第一次得到的結果「{Q2qSvkE?vqwPHvey_informat1on!!!}」,明顯我們可以發現前面的「Q2qSvkE?vqwPHvey」肯定不全是flag,一般我們得到的flag都是有一定意義的(大部分形式上都可以翻譯出來)為什麼得到的不全是flag呢?因為我們剛才也說了兩位一組超出範圍就捨去所以肯定有出入。因此我們可以通過控制十進位制前面數位的增減來檢視情況,經檢驗發現把開頭0刪去可以得到flag字首「DASCTF{」,那麼也就是說這樣做是正確的。
經過上面兩次結果我們可以拼接出flag大概形式
DASCTF{Wh1stling_t0_ConGkQUuEZPubvPK Q2qSvkE?vqwPHvey_informat1on!!!}
我們再根據意義來分析一下最終可得正確flag
DASCTF{Wh1stling_t0_Convey_informat1on!!!}