作者:
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檔案的尾。
![enter image description here](https://zhuanlan.kanxue.com/view/images/856535a2cc33a9ccdabbb69272c5368ded6b67df.jpg)
![enter image description here](https://zhuanlan.kanxue.com/view/images/8ef5cf9262a3c928d40e6d3fbb6edb214abe4e86.jpg)
另外檔案頭中的IHDR也能確信這是一個png圖片。將檔案頭的 42 4D E3 BF 22 00 00 00
修改為png頭 89 50 4E 47 0D 0A 1A 0A
,順利開啟得到一張圖片。
![enter image description here](https://zhuanlan.kanxue.com/view/images/448a78fe5588df47e7526b2c56edff374dc2fdbf.jpg)
圖上是appleu0大神的blog地址,後面的提示意味不明。搜了下weichuncai
並訪問blog才知道這是blog上的動漫人物。與之聊天輸入flag得到Flag。Flag貌似是海賊王裡的。大神果然是十足的動漫控啊!
![enter image description here](https://zhuanlan.kanxue.com/view/images/6e5b851e09354b623ecce8902986aca94e5b96dd.jpg)
你喜不喜歡萌萌噠的姐姐
一張loli的圖,在jpg尾FF D9後還有很多可顯字元。
![enter image description here](https://zhuanlan.kanxue.com/view/images/10b8610767f8de81fe8f5a855500bc9eb76a2986.jpg)
全部複製出來,看編碼應該是base64,放到hackbar裡base64decode一下,卻得到很多不可顯字元,但是發現了JFIF標識,應該是base64encode了一張圖片得到的。
![enter image description here](https://zhuanlan.kanxue.com/view/images/560f0aaca5c938abebb1f6f0acf28711d61c4008.jpg)
下面是解碼指令碼。
#!/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。
![enter image description here](https://zhuanlan.kanxue.com/view/images/2d352231c3f79d299df5766bc008535cb8d95e04.jpg)
開胃小菜
題目要求修改參賽口號為Hacked by white god!。
在個人資訊頁面http://hack.myclover.org/team_info
的HTML註釋中發現提示:
![enter image description here](https://zhuanlan.kanxue.com/view/images/2770b95e09848e49e60437ee0b62e661ee73bc35.jpg)
更新口號翻譯為upvoice,簡直不忍直視,不能再low。 訪問 http://hack.myclover.org/team_info/upvoice?voice=Hacked+by+white+god!
得到Flag。
![enter image description here](https://zhuanlan.kanxue.com/view/images/2472c2b856759a0fe69bbb0285b27bc0824066c9.jpg)
白神的假期
一張jpg圖片,在檔案尾FF D9後還有不少內容,而且是rar檔案頭52 61 72 21
。
![enter image description here](https://zhuanlan.kanxue.com/view/images/fc70a5417e7dafc5e5ebeba76393a8f07a3940df.jpg)
複製出剩下的部分成rar檔案解壓得到flag.txt。
![enter image description here](https://zhuanlan.kanxue.com/view/images/989a5c96fd4a7127629da41bc68c838173bcd20e.jpg)
在base64decode一下就得到Flag:KEY:SYC{Y34h!Thi5_15_th3_jp9_r4r_K3Y}
reg
![enter image description here](https://zhuanlan.kanxue.com/view/images/9d3a804dcf43c7637838bbc844596ba0eadde9d8.jpg)
看到com啥的基本上就知道這肯定是個url了,再加上開始部分twi以及com之前的部分是從syclover中取,就能猜出是twitter.com,追加上後面的asdlalalalala得到url:twitter.com/asdlalalalala
,訪問url得到Flag。
![enter image description here](https://zhuanlan.kanxue.com/view/images/7aeb7d092d3709af00ed1713ed7f1b0f0a317916.jpg)
bilibili
最坑的題沒有之一。出題者喪心病狂居然要求透過bilibili的會員晉級考試,還得至少80分。好不容易透過修改HTML程式碼弄出了一張透過圖,竟然還要關注出題者。無奈只好仔細百度做題,還好這時候只需要60就晉級成功,出題者也無法分辨我到底是60還是80。
0x02 pentest
HTTP Base1
Flag在HTTP response header中。
![enter image description here](https://zhuanlan.kanxue.com/view/images/226e9af315dc093cc77099fd36661e3107d23e90.jpg)
HTTP Base2
![enter image description here](https://zhuanlan.kanxue.com/view/images/7cab713befb6409b07371e16b5d2adace714a274.jpg)
題目要求必須本機訪問,開始以為加上X-Forwarder-For: 127.0.0.1到request header中就能解決,後來才知道也有從Client-IP來判斷訪問者來路的,於是填上Client-IP: 127.0.0.1到request header中得到Flag。
![enter image description here](https://zhuanlan.kanxue.com/view/images/31746e082f069b025c740ff778bcc6b8e7f34e03.jpg)
HTTP Base3
![enter image description here](https://zhuanlan.kanxue.com/view/images/6e15d6c82db2da9680fddd1e3f41d78264cb322c.jpg)
題目顯示訪問者是普通使用者,所以思路是變成管理員,再加上cookie中發現有:userid=33; userlevel=2;於是將userid和userlevel都置為1,再次訪問得到Flag。
![enter image description here](https://zhuanlan.kanxue.com/view/images/8d5f85e90942369d545aeedb55dd3ec16a470c79.jpg)
CrackPWD1
![enter image description here](https://zhuanlan.kanxue.com/view/images/007cd151b896490bd9cb336c5af5843a92224e83.jpg)
直接上ophcrack。Ophcrack基於彩虹表來破解hash口令,特別是針對XP的LM-NT hash,成功率很高。 下載地址:
http://sourceforge.jp/projects/ophcrack/releases/
http://sourceforge.net/projects/ophcrack/files/
![enter image description here](https://zhuanlan.kanxue.com/view/images/d6f16266cf43f137fb259d38979e483ed92ea51a.jpg)
CrackPWD2
![enter image description here](https://zhuanlan.kanxue.com/view/images/9a8019ae6dab98be026340a7273dba59860b5c54.jpg)
提示口令起始為SYC#
且長度為8,只需要生成一份包含所有可能性的字典交給工具跑。後4位每位上可見字元一共94個,字典大小為94的4次方行,約7800w。
![enter image description here](https://zhuanlan.kanxue.com/view/images/4b5cf678cfd710a8a5ea941302df26e172672ef8.jpg)
再加上毛子強大的工具oclhashcat(http://hashcat.net/oclhashcat/),幾乎是秒破口令。oclhashcat是一款使用GPU顯示卡來破密碼的工具,分為N卡版和A卡版,號稱世界上最快的密碼破解器。 執行命令:
cudaHashcat64.exe -t 32 -m 1000 NT.hash pass.dic
![enter image description here](https://zhuanlan.kanxue.com/view/images/99096f03f783bce3754cd3e7ca3cea1139aecacf.jpg)
美男子
![enter image description here](https://zhuanlan.kanxue.com/view/images/29d1a4574d331f38167fc85a4cfbcf2f4147375b.jpg)
按提示需要認證為美男子。檢視cookie發現是: user=diaosi; isboy=0; pass=d93fa3b25f83f202cc51257eee2c9207;
訪問者被設為diaosi了,不能忍,果斷修改user=meinanzi; isboy=1;
重新整理得到Flag。
![enter image description here](https://zhuanlan.kanxue.com/view/images/7a6e6994b673982870c8fbf280300b33ce56f74d.jpg)
Cookie中的md5解開是ds0,沒用上。
Login
![enter image description here](https://zhuanlan.kanxue.com/view/images/73be6c3351272cde1f0a1049536edfa8420ebd0d.jpg)
以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。
![enter image description here](https://zhuanlan.kanxue.com/view/images/fdd4504f9dc472f3f94fc1da6427aedc93eff667.jpg)
白神的shell
![enter image description here](https://zhuanlan.kanxue.com/view/images/db9acd8502d217cd836eee831e0d965de3b8b860.jpg)
直接上程式碼吧,多執行緒也不會,跑的慢點,不過也能出結果。
#!/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()
![enter image description here](https://zhuanlan.kanxue.com/view/images/981472836a7a8a9130be5a497ef4a69f09dc6ccd.jpg)
![enter image description here](https://zhuanlan.kanxue.com/view/images/ae62568966b7d7b0e4e655ace25fbf3d55fdb5bb.jpg)
德瑪西亞
![enter image description here](https://zhuanlan.kanxue.com/view/images/7dcbbd66a12a87bbc4ba62a386b4cbd903b4e99c.jpg)
下載的dhs檔案可以用7z解壓縮,開啟解壓的檔案發現內容是某使用者訪問baidu的cookie,於是可以用劫持到的cookie冒充該使用者登入百度。
![enter image description here](https://zhuanlan.kanxue.com/view/images/4bb73ff45453124b271c383e7a5fc4cb2155d56d.jpg)
利用hackbar修改cookie,重新整理登入百度,該使用者的baidu id是dsploit_test。開始以為flag會在網盤、文庫等地方,找了下沒找到,回到個人中心,發現使用者有貼吧操作痕跡,果斷檢視發帖和回帖發現Flag。
![enter image description here](https://zhuanlan.kanxue.com/view/images/0e63edc12941f6481a9e1544790316556fd0f904.jpg)
Web Base1
簡單的Get型注入。
python sqlmap.py –u http://syc.myclover.org/pentest/web1/read.php?id=1 --dbms mysql -D webbase1 -T flag --dump
![enter image description here](https://zhuanlan.kanxue.com/view/images/11e8448cb2e6096d16edb96f63ef3ef487f6d9fb.jpg)
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
![enter image description here](https://zhuanlan.kanxue.com/view/images/eb3cf9aa9b5c01d8ccea508b4bde97816143b744.jpg)
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型別。
![enter image description here](https://zhuanlan.kanxue.com/view/images/9a5e5b424339f38985f2a7ac249e481435d47dfa.jpg)
在嘗試多個tamper之後,發現對關鍵字進行保護(對關鍵字新增/!/,如/!select/)的versionedmorekeywords.py能有斬獲,payload發生了變化,也可以跑出一個資料庫。
![enter image description here](https://zhuanlan.kanxue.com/view/images/875076c8830e6545abe0353ee39460e59f14a7e3.jpg)
MySQL的表結構都存放在information_schema中,不能訪問這個庫,就無法知道sqli庫的結構,使用common-tables爆破錶名也未果。下圖中無法獲取資料庫的個數,當時覺得可能是過濾了information_schema,也沒有想到好的繞過方法,至此暫時陷入了僵局。
![enter image description here](https://zhuanlan.kanxue.com/view/images/37716aee69b604836f74fe73f041d677a1ab04d1.jpg)
兩天後,主辦方在頁面註釋中給出了新提示,