WebShell文件上傳分析溯源(第2題)
靶場背景:
![2efc7cd948c1453cf2a3b3fe7cb9fec 2efc7cd948c1453cf2a3b3fe7cb9fec](http://static.javashuo.com/static/loading.gif)
經過掃描發現如下目錄
![image image](http://static.javashuo.com/static/loading.gif)
點擊查看/admin 目錄是空白頁面,查看admin/upload.php目錄的時候,會跳轉到upload1.php頁面並顯示無權限訪問,接着點擊肯定後跳轉到upload2.php。整個過程有一個頁面一閃而過,嘗試對頁面進行抓包,抓到了上傳文件的頁面,嘗試進行上傳一句話木馬,上傳成功了,結果上傳成功。
![image image](http://static.javashuo.com/static/loading.gif)
![image image](http://static.javashuo.com/static/loading.gif)
可是殊不知道上傳文件的位置在哪。查看題目給的提示,掌握cookie的基本知識。觀察upload1.php的cookie的值是從verify/xxx.txt的文件中讀取的,那能夠嘗試讀取upload_file.php文件源碼,源碼中查找文件命名的路徑和規則
![image image](http://static.javashuo.com/static/loading.gif)
將uploadmd5=upload_file.php,成功的讀取到了文件的內容
![image image](http://static.javashuo.com/static/loading.gif)
理解代碼,找出命名的規則
![image image](http://static.javashuo.com/static/loading.gif)
能夠看到上面代碼仍是比較容易讀懂得,文件得路徑形似:uploadfile/年月日_$verify_上傳的文件名
![image image](http://static.javashuo.com/static/loading.gif)
根據上述獲得的信息,鏈接一句話木馬
![image image](http://static.javashuo.com/static/loading.gif)
歡迎關注本站公眾號,獲取更多信息