1.base64stego
打開壓縮包提示需要輸入密碼,就打開壓縮包的詳細信息,但是什么都沒有,然后就打開binwalk,查看發現沒有隱藏文件。
然后想到可能是zip偽加密:
zip文件有三個部分組成:壓縮源文件數據區(第一個50 4B)+壓縮源文件目錄區(第二個50 4B)+壓縮源文件目錄結束標志(第三個50 4B)
偽加密一般存在於壓縮源文件目錄區,也就是第二個50 4B之后。
壓縮源文件目錄區:50 4B 01 02:目錄中文件文件頭標記
3F 03:壓縮使用的 pkware版本
14 03:解壓文件所需 pkware 版本
09 00:全局方式位標記(有無加密,這個更改這里進行偽加密,改為00 08打開就會提示有密碼了)
使用winhex打開文件后,找到第二個50 4B,往后數第七個和第八個,正常情況下應該是00 08,但這里是09 00;
修改完之后就可以正常解壓了 ,打開txt之后,發現內容是base64加密過的,解密之后發現是一篇關於介紹隱寫術的文章:
Steganography is the art and science of writing hidden messages in such a way that no one, apart from the sender and intended recipient, suspeage,
a form of security through obscurity. The word steganography is of Greek origin and means "concealed writing" from the Greek words steganos meaning
"covered or protected", and graphein meaning "to write". The first recorded use of the term was in 1499 by Johannes Trithemius in his Steganographia,
a treatise on cryptography and steganography disguised as a book on magic. Generally, messages will appear to be something else: images, articles,
shopping lists, or some other covertext and, classically, the hidden message may be in invisible ink between the visible lines of a private letter. The advantage of steganography, over cryptography alone, is that messages do not attract attention to themselves. Plainly visible encrypted messages
no matter how unbreakable will arouse suspicion, and may in themselves be incriminating in countries where encryption is illegal. Therefore, whereas
cryptography protects the contents of a message, steganography can be said to protect both messages and communicating parties. Steganography includes the concealment of information within computer files. In digital steganography, electronic communications may include steganographic
coding inside of a transport layer, such as a document file, image filn because of their large size. As a simple example, a sender might start with
an innocuous image file and adjust the color of every 100th pixel to correspond to a letter in the alphabet, a change so subtle that someone not
specifically looking for it is unlikely to notice it. The first recorded uses of steganography can be traced back to 440 BC when Herodotus mentions two examples of steganography in The Histories
of Herodotus. Demaratus sent a warning about a forthcoming attack to Greece by writing it directly on the wooden backing of a wax tablet before
applying its beeswax surface. Wax tablets were in common use then as reusable writing surfaces, sometimes used for shorthand. Another ancient
example is that of Histiaeus, who shaved the head of his most trusted slave and tattooed a message on it. After his hair had grown the message
was hidden. The purpose was to instigate a revolt against the Persians. Steganography has been widely used, including in recent historical times and the present day. Possible permutations are endless and known examples include: * Hidden messages within wax tablets: in ancient Greece, people wrote messages on the wood, then covered it with wax upon which an innocent
covering message was written * Hidden messages on messenger's body: also used in ancient Greece. Herodotus tells the story of a message tattooed on a slave's shaved head,
hidden by the growth of his hair, and exposed by shaving his head again. The message allegedly carried a warning to Greece abois method has
obvious drawbacks, such as delayed transmission while waiting for the sn the number and size of messages that can be encoded on one person's scalp. * In WWII, the French Resistance sent some messages written on the backs of couriers using invisible ink. * Hidden messages on paper written in secret inks, under other messages or on the blank parts of other messages. * Messages written in Morse code on knitting yarn and then knitted into a piece of clothing worn by a courier. * Messages written on the back of postage stamps. * During and after World War II, espionage agents used photographically produced microdots to send information back and forth. Microdots
were typically minute, approximately less than the size of the period produced by a typewriter. WWII microdots needed to be embedded in
the paper and covered with an adhesive (such as collodion). This was reflective and thus detectable by viewing against glancing light.
Alternative techniques included inserting microdots into slits cut into the edge of post cards. * During World War II, a spy for Japan in New York City, Velvalee Dickinson, sent information to accommodation addresses in neutral South America.
She was a dealer in dolls, and her letters discussed how many of this or that doll to ship. The stegotext was the doll orders, while the
concealed "plaintext" was itself encoded and gave information about ship movements, etc. Her case became somewhat famous and she became
known as the Doll Woman. * Cold War counter-propaganda. In 1968, crew members of the USS Pueblo (AGER-2) intelligence ship held as prisoners by North Korea,
communicated in sign language during staged photo opportunities, informing the United States they were not defectors but rather were
being held captive by the North Koreans. In other photos presented to the US, crew members gave "the finger" to the unsuspecting
North Koreans, in an attempt to discredit photos that showed them smiling and comfortable. -- http://en.wikipedia.org/wiki/Steganography
在線翻譯了一下:
隱寫術是一門藝術和科學,它以一種除了發送者和預期接收者之外,任何人都無法通過隱藏的方式來書寫隱藏的信息。“隱寫術”一詞源於希臘語,意為“隱藏的寫作”,
源於希臘語單詞steganos,意為“覆蓋或保護”,而graphein意為“寫作”。1499年,約翰內斯·特里特米烏斯(Johannes Trithemius)在他的《隱寫術》(Steganographia)一書中首次使用了這個詞。
一般情況下,信息會以其他形式出現:圖像、文章、購物清單或其他一些隱藏文本,通常,隱藏的信息可能是私人信件可見行之間的隱形墨水。 與密碼學相比,隱寫術的優勢在於,消息本身不會引起注意。顯而易見的加密信息,無論多么牢不可破,都會引起懷疑,而且在加密非法的國家,這些信息本身就可能構成犯罪。
因此,雖然密碼學保護消息的內容,但是隱寫術可以同時保護消息和通信方。 隱寫術包括在計算機文件中隱藏信息。在數字隱寫術中,由於傳輸層(如文檔文件、圖像文件)的大尺寸,電子通信可能包括傳輸層內部的隱寫編碼。舉個簡單的例子,
發送者可能從一個無害的圖像文件開始,每100個像素調整一次顏色,使之與字母表中的一個字母相對應,這種變化如此細微,以至於沒有專門查找它的人不太可能注意到它。 有記錄的第一次使用隱寫術可以追溯到公元前440年,希羅多德在他的歷史中提到了兩個隱寫術的例子。德瑪拉圖斯在塗上蜂蠟表面之前,直接把它寫在一塊蠟板的木制底座上,
警告希臘即將受到攻擊。蠟片當時普遍用作可重復使用的書寫表面,有時也用於速記。另一個古老的例子是希斯提厄斯,他剃光了他最信任的奴隸的頭,並在上面紋了一條信息。
他的頭發長了以后,這條信息就被藏了起來。目的是煽動對波斯人的起義。 隱寫術已被廣泛應用,包括在最近的歷史時期和今天。可能的排列是無窮無盡的,已知的例子包括: *蠟版內的隱藏信息:在古希臘,人們把信息寫在木頭上,然后用蠟把木頭蓋上,在上面寫上一個無辜的信息 *信使身體上的隱藏信息:也用於古希臘。希羅多德講了一個故事,一個奴隸剃光了頭,上面紋着一條信息,隱藏在他的頭發后面,再剃一次頭就露出來了。
據稱,這條信息帶有向希臘發出警告的信息,abois方法有明顯的缺陷,比如在等待sn時傳輸延遲。sn是可以在一個人的頭皮上編碼的信息的數量和大小。 *二戰期間,法國抵抗運動用隱形墨水在信使的背上寫了一些信息。 *用秘密墨水寫在紙上的隱藏信息,在其他信息下面或其他信息的空白部分。 *用莫爾斯電碼寫在針織紗線上的信息,然后編織成快遞員穿的衣服。 寫在郵票背面的信息。 *在第二次世界大戰期間和之后,間諜人員使用照相制作的微粒來來回傳送信息。微粒通常是微小的,大約比打字機產生的周期的大小還要小。第二次世界大戰的微粒需要嵌入在紙上,
並覆蓋上粘合劑(如膠棉)。這是反射的,因此可以通過對光的觀察來檢測。其他的技術包括將微粒插入明信片邊緣的縫隙中。 *第二次世界大戰期間,駐紐約的日本間諜維瓦利·迪金森(Velvalee Dickinson)將信息發送到中立的南美的住宿地址。她是一個玩偶經銷商,她在信中討論了要運送多少個這樣或那樣的玩偶。
隱寫文本是娃娃的命令,而隱藏的“明文”本身是編碼的,並提供有關船只移動等信息。她的情況變得有點出名,她成為眾所周知的娃娃女人。 *冷戰反宣傳。1968年,被朝鮮扣押的美國普韋布洛號(USS Pueblo, AGER-2)號情報艦的船員在拍照時用手語交流,告知美國他們不是叛逃者,而是被朝鮮扣押的。在提交給美國的其他照片中,
機組人員向毫無戒心的朝鮮人豎起了“手指”,試圖抹掉他們微笑和舒適的照片。 -- http://en.wikipedia.org/wiki/Steganography
之后就沒有思路了,然后看了wp,發現需要寫一個base64解密的腳本,我暈,解密工具果然還是有不足之處的
flag:Base_sixty_four_point_five
附上代碼:
# -*- coding: UTF-8 -*- def get_base64_diff_value(s1, s2): base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' res = 0 for i in xrange(len(s1)): if s1[i] != s2[i]: return abs(base64chars.index(s1[i]) - base64chars.index(s2[i])) return res def solve_stego(): with open('C:\\Users\\Desktop\\stego.txt', 'rb') as f: file_lines = f.readlines() bin_str = '' for line in file_lines: steg_line = line.replace('\n', '') norm_line = line.replace('\n', '').decode('base64').encode('base64').replace('\n', '') diff = get_base64_diff_value(steg_line, norm_line) pads_num = steg_line.count('=') if diff: bin_str += bin(diff)[2:].zfill(pads_num * 2) else: bin_str += '0' * pads_num * 2 res_str = '' for i in xrange(0, len(bin_str), 8): res_str += chr(int(bin_str[i:i+8], 2)) print res_str solve_stego()
不過奇怪的是,我運行之后,什么都沒輸出。。。。。。。
自閉中...................................
2.簽到題
剛打開題目感覺很簡單的樣子 (*^▽^*)
base64解密,提交,金幣到手(滑稽~)
but,嗯???竟然不對 Σ(⊙▽⊙"a
果然還是我想的太簡單了,,,,仔細看了看,排除工具出了問題,這串字符看起來像是被柵欄加密過的
然后柵欄解密
對比一下,感覺第二欄更有可能與flag有關
前五個字符應該是猜測是ssctf,但是好像還是被加密了,然后就嘗試了幾種加密方式,最后覺得還是rot13更接近
然后發現解密的結果似乎和凱撒更接近,然后凱撒解密
成功發現flag
總結:密碼學大雜燴,6星的題果然沒那么簡單,,,,,,
3.Avatar
這道題看起來就是一個簡單的隱寫題
然后Stegsolve分析圖層,沒什么發現;然后分析數據,還是什么都沒有;下一步winhex,似乎也沒有什么;在下一步biwalk,只有一張圖片;最后一步,改后綴名,這次絕望了,還是什么都沒有 o(╥﹏╥)o。。。。。。。
然后就是一通亂分析(更改大小,內容搜索,解碼。。。),還是沒效果 T_T
突然感覺這道題好像無解,,,,
最后看別人做題的時候突然想起來了一個神奇的工具----outguess
果然,這道題還是要用outguess解開
成功獲得flag
這是我見過最獨特的flag,,,,
4.眼見非實
打開壓縮包之后,就看到了一個word文件,打開文件看到一堆亂碼,但是第一頁的開頭是‘PK’,對應的應該是一個zip文件;然后修改后綴名,解壓得到一個文件夾,打開文件夾,發現許多xml文件
推測flag應該是在word文件夾中,打開word文件夾,
推測flag是在document.xml文件中,打開文件
發現flag
5.What-is-this
解壓發現兩張圖片,感覺兩張圖片有點像二維碼,但是一直沒找到什么線索;
然后想到可能需要將兩張圖片合並,打開StegSolve,選擇Image Combiner,將兩張圖片合並,發現flag
感覺7分的題也沒那么難 ^_^
6.Training-Stegano-1
這個大概是我見過的,最簡單的,圖片隱寫題,沒有之一
直接右鍵記事本打開就找到flag了,果然很基礎
好簡單,,,
7.easycap
打開數據包,沒發現什么線索,然后試着跟蹤了一下數據流,然后,,,就沒有然后了,因為找到了flag
果然很easy,哈哈哈。。。。
8.Test-flag-please-ignore
這個就比較簡單了,下載,解壓
感覺有點像md5或hex,然后先去嘗試了hex,然后獲得flag
感覺還行
9.4-2
下載,解壓,發現一段毫無規律的英文片段
然后柵欄了一下,沒有用,接着嘗試了一下詞頻分析,成功解出
唯一比較坑的是出題人沒有說明flag格式。。。
flag格式為flag{}
10.glance-50
點擊下載,竟然被我的谷歌攔截了,然后用了火狐,才下載成功,打開是一張gif圖,然后就能看到flag,只是看的眼睛有些難受
11.隱藏在黑夜里的秘密
下載,解壓時發現有密碼,然后首先想到了偽加密,解密
解壓文件,然后使用Stegsolve查看圖片,發現flag
結束......
12.Get-the-key.txt
下載,解壓,發現什么都沒有
用file指令查看,發現了:/forensic100: Linux rev 1.0 ext2 filesystem data, UUID=0b92a753-7ec9-4b20-8c0b-79c1fa140869
感覺應該是掛載,然后就嘗試了掛載
根據題目中的提示找key.txt
進入mnt目錄,執行命令:for file in *;do echo $file&&strings $file ;done
發現了好多和key相關的txt,最后發現第一個就是
然后就解壓,獲得flag
提交,結束...
13.Cephalopod
下載,打開數據包,開始閱讀數據,突然發現一個flag.png
flag可能與png有關,再往下,找到了一個png文件
然后保存數據,刪除多余的內容
接着,保存,重命名,發現flag
實在懶得打字了,就截圖識別了
14.embarrass
下載,解壓,打開,然后一臉絕望,,,,這內容也太多了!!!
然后查看了一下http協議,也沒發現啥
絕望,接着就分離了一下文件,分離出來一堆文件,但是都看了一遍啥都沒看到
將要放棄的時候
大佬提示用strings
然后我差點砍了這道題[○・`Д´・ ○]
話說回來,ctf本來就是考驗腦洞的,還是佛系一點比較好.........
15.pure_color
下載完直接放到Stegsolve里,就可以看到flag了
16.misc1
打開是一串16進制字符,直接解密就好了
# 將一串十六進制編碼變為ascii # # a=raw_input("請輸入一串十六進制編碼:") # b=len(a) # for i in range(0,b,2): # if ord('a')<=ord(str(a[i]))<=ord('z'): # c=ord(str(a[i]))-ord('a') # c+=10 # else: # c=ord(str(a[i]))-ord('0') # if ord('a')<=ord(str(a[i+1]))<=ord('z'): # d=ord(str(a[i+1]))-ord('a') # d+=10 # else: # d=ord(str(a[i+1]))-ord('0') # e=c*16+d # e%=128 # sys.stdout.write("{}".format(chr(e)))
17.hit-the-core
下載,解壓,發現是一個core文件,然后用strings查看,發現一串很像flag的字符串
還發現了兩個大括號,提交了一下,錯了,繼續向下看
根據這道題是alexctf-2017的題,仔細觀察,發現“cvqAeqacLtqazEigwiXobxrCrtuiTzahfFreqc”中包含的大寫字母正是“ALEXCTF”,然后根據規律,寫程序
#include<iostream> #include<conio.h> #include<stdio.h> #include<string.h> #include<math.h> #include<algorithm> using namespace std; int main() { char a[1000]; scanf("%s",a); int l=strlen(a); for(int i=0;i<l;i+=5) { printf("%c",a[i]); } printf("\n"); }
輸入:AeqacLtqazEigwiXobxrCrtuiTzahfFreqc{bnjrKwgk83kgd43j85ePgb_e_rwqr7fvbmHjklo3tews_hmkogooyf0vbnk0ii87Drfgh_n1kiwutfb0ghk9ro987k5tfb_hjiouo087ptfcv}
解出flag
18.肥宅快樂題
下載,打開,是一個小游戲,然后反編譯,發現內容似乎有點多
然后看提示,需要通關!!!!
然后發現可以用PotPlayer拖動進度條,直接拖到了最后
發現了疑似base64加密的內容
然后解密,發現flag
19.can_has_stdio?
下載的時候發現沒辦法下載,然后就去求助於大佬,然后大佬給了一個題目下載鏈接
下載完之后,直接用Brainfuck 解碼就好了
20.神奇的Modbus
下載,打開,看到好多數據,然后篩選modbus,跟蹤tcp流,就可以看到flag
但是提交之后錯了,仔細看過之后發現flag中少了個 ‘ o ’,不曉得是不是出題人的失誤.....
21.2-1
下載完之后直接扔進010里,修復文件頭,發現還是無法打開,分析了一下發現是IHDR的CRC值出錯了
然后在網上找到了一個爆破CRC的腳本
import os import binascii import struct misc = open("misc4.png","rb").read() for i in range(1024): data = misc[12:16] + struct.pack('>i',i)+ misc[20:29] crc32 = binascii.crc32(data) & 0xffffffff if crc32 == 0x932f8a6b: print i
獲得flag