作者:
F1uYu4n
·
2014/11/03 16:22
0x01 misc
too young too simple
一個叫flag.bmp的檔案,但是無法開啟。檔案頭42 4D確實是bmp檔案的頭,但是檔案尾 49 45 4E 44 AE 42 60 82
卻是png檔案的尾。


另外檔案頭中的IHDR也能確信這是一個png圖片。將檔案頭的 42 4D E3 BF 22 00 00 00
修改為png頭 89 50 4E 47 0D 0A 1A 0A
,順利開啟得到一張圖片。

圖上是appleu0大神的blog地址,後面的提示意味不明。搜了下weichuncai
並訪問blog才知道這是blog上的動漫人物。與之聊天輸入flag得到Flag。Flag貌似是海賊王裡的。大神果然是十足的動漫控啊!

你喜不喜歡萌萌噠的姐姐
一張loli的圖,在jpg尾FF D9後還有很多可顯字元。

全部複製出來,看編碼應該是base64,放到hackbar裡base64decode一下,卻得到很多不可顯字元,但是發現了JFIF標識,應該是base64encode了一張圖片得到的。

下面是解碼指令碼。
#!/usr/bin/env python
import base64
f = open('1.jpg', 'rb')
pic = f.read()
index = pic.find('\xff\xd9')
flag = pic[index + 5:]
f.close()
f1 = open('flag.jpg', 'w')
f1.write(base64.decodestring(flag))
f1.close()
執行得到flag.jpg。

開胃小菜
題目要求修改參賽口號為Hacked by white god!。
在個人資訊頁面http://hack.myclover.org/team_info
的HTML註釋中發現提示:

更新口號翻譯為upvoice,簡直不忍直視,不能再low。 訪問 http://hack.myclover.org/team_info/upvoice?voice=Hacked+by+white+god!
得到Flag。

白神的假期
一張jpg圖片,在檔案尾FF D9後還有不少內容,而且是rar檔案頭52 61 72 21
。

複製出剩下的部分成rar檔案解壓得到flag.txt。

在base64decode一下就得到Flag:KEY:SYC{Y34h!Thi5_15_th3_jp9_r4r_K3Y}
reg

看到com啥的基本上就知道這肯定是個url了,再加上開始部分twi以及com之前的部分是從syclover中取,就能猜出是twitter.com,追加上後面的asdlalalalala得到url:twitter.com/asdlalalalala
,訪問url得到Flag。

bilibili
最坑的題沒有之一。出題者喪心病狂居然要求透過bilibili的會員晉級考試,還得至少80分。好不容易透過修改HTML程式碼弄出了一張透過圖,竟然還要關注出題者。無奈只好仔細百度做題,還好這時候只需要60就晉級成功,出題者也無法分辨我到底是60還是80。
0x02 pentest
HTTP Base1
Flag在HTTP response header中。

HTTP Base2

題目要求必須本機訪問,開始以為加上X-Forwarder-For: 127.0.0.1到request header中就能解決,後來才知道也有從Client-IP來判斷訪問者來路的,於是填上Client-IP: 127.0.0.1到request header中得到Flag。

HTTP Base3

題目顯示訪問者是普通使用者,所以思路是變成管理員,再加上cookie中發現有:userid=33; userlevel=2;於是將userid和userlevel都置為1,再次訪問得到Flag。

CrackPWD1

直接上ophcrack。Ophcrack基於彩虹表來破解hash口令,特別是針對XP的LM-NT hash,成功率很高。 下載地址:
http://sourceforge.jp/projects/ophcrack/releases/
http://sourceforge.net/projects/ophcrack/files/

CrackPWD2

提示口令起始為SYC#
且長度為8,只需要生成一份包含所有可能性的字典交給工具跑。後4位每位上可見字元一共94個,字典大小為94的4次方行,約7800w。

再加上毛子強大的工具oclhashcat(http://hashcat.net/oclhashcat/),幾乎是秒破口令。oclhashcat是一款使用GPU顯示卡來破密碼的工具,分為N卡版和A卡版,號稱世界上最快的密碼破解器。 執行命令:
cudaHashcat64.exe -t 32 -m 1000 NT.hash pass.dic

美男子

按提示需要認證為美男子。檢視cookie發現是: user=diaosi; isboy=0; pass=d93fa3b25f83f202cc51257eee2c9207;
訪問者被設為diaosi了,不能忍,果斷修改user=meinanzi; isboy=1;
重新整理得到Flag。

Cookie中的md5解開是ds0,沒用上。
Login

以username=appleU0&password=syclover
登入,發現一行提示 Tips: coverage login。 各種搜尋不知道啥叫覆蓋登入。各種亂想終於想到是覆蓋login,變數覆蓋漏洞。經歷ISCC2014的變數覆蓋題,猜變數名是一件頭大的事。我設想了幾個可能的變數名:
admin\flag\key\KEY\user\login\submit
以及可能的值: 1\true\flag\key\admin\flag\login
,爆破了下沒有結果,甚至連中文的值都試過,登入\提交,無果。最終覺得既然是覆蓋login,變數名應該就是login,於是在GET的url後面新增上?login=1,嘗試了下得到Flag。

白神的shell

直接上程式碼吧,多執行緒也不會,跑的慢點,不過也能出結果。
#!/usr/bin/env python
import httplib
s = 'zxcvbnmasdfghjklqwertyuiop'
length = len(s)
uri = '/pentest/findshell/white_god_s_webshell_'
conn = httplib.HTTPConnection("syc.myclover.org")
for i in range(length):
for j in range(length):
for k in range(length):
conn.request("GET", uri + s[i] + s[j] + s[k] + ".php")
response = conn.getresponse()
response.read()
if response.status == 200:
print "white_god_s_webshell_%s%s%s" % (s[i], s[j], s[k]) + ".php"
exit()


德瑪西亞

下載的dhs檔案可以用7z解壓縮,開啟解壓的檔案發現內容是某使用者訪問baidu的cookie,於是可以用劫持到的cookie冒充該使用者登入百度。

利用hackbar修改cookie,重新整理登入百度,該使用者的baidu id是dsploit_test。開始以為flag會在網盤、文庫等地方,找了下沒找到,回到個人中心,發現使用者有貼吧操作痕跡,果斷檢視發帖和回帖發現Flag。

Web Base1
簡單的Get型注入。
python sqlmap.py –u http://syc.myclover.org/pentest/web1/read.php?id=1 --dbms mysql -D webbase1 -T flag --dump

Web Base2
Post搜尋型注入。
python sqlmap.py –u http://syc.myclover.org/pentest/web2/search.php --data “key=my” --dbms mysql -D webbase2 -T #flag --dump

SQL隱碼攻擊
連結是sqlmap.org的山寨頁面,在http response header裡發現提示,index.php?id=。分別取id=1/2/3/4,頁面與預設頁面均不同。id=4-1與id=3一樣,id=2%2B1與id=3也一樣,id應該就是所需要的注入點了。 如果直接上sqlmap的話,會發現有mysql的payload,但是sqlmap無法識別database型別。

在嘗試多個tamper之後,發現對關鍵字進行保護(對關鍵字新增/!/,如/!select/)的versionedmorekeywords.py能有斬獲,payload發生了變化,也可以跑出一個資料庫。

MySQL的表結構都存放在information_schema中,不能訪問這個庫,就無法知道sqli庫的結構,使用common-tables爆破錶名也未果。下圖中無法獲取資料庫的個數,當時覺得可能是過濾了information_schema,也沒有想到好的繞過方法,至此暫時陷入了僵局。

兩天後,主辦方在頁面註釋中給出了新提示,