bWAPP A3 Cross-Site-Scripting - Stored (User-Agent)
itsecgames.com
www.itsecgames.com

웹페이지에 접근하면 User-Agent 값이 저장된다. burp로 프록시를 잡아서 User-Agent 값을 변조하면 될 것 같다.
low


low 레벨이다. burp로 User-Agent 값에 script 태그를 삽입하면 위와 같이 게시판에서 script 태그가 실행되어 쿠키 값이 출력되었다.
medium

medium 레벨에서도 XSS 공격이 먹힌다.
high

high 레벨에서는 XSS 공격이 먹히지 않는다.


서버 코드를 보면 medium 레벨의 경우 XSS 공격에 사용되는 특수문자를 필터링하지 않는 addslashes() 함수가 사용된다. 따라서, medium 레벨에서는 XSS 공격이 먹힌다. 그리고 high 레베렝서는 htmlspecialchars() 함수로 필터링되는데, 이 함수로 인해 모든 특수문자가 HTML 엔티티로 변환되어 XSS 공격이 어렵겠다.
* PHP addslashes() Function
PHP: addslashes - Manual
spamdunk at home dot com, your way is dangerous on PostgreSQL (and presumably MySQL). You're quite correct that ANSI SQL specifies using ' to escape, but those databases also support \ for escaping (in violation of the standard, I think). Which means that
www.php.net
* PHP htmlspecialchars() Function
PHP: htmlspecialchars - Manual
if your goal is just to protect your page from Cross Site Scripting (XSS) attack, or just to show HTML tags on a web page (showing on the page, for example), then using htmlspecialchars() is good enough and better than using htmlentities(). A minor point
www.php.net
'Wargame > bWAPP' 카테고리의 다른 글
| bWAPP A4 Insecure DOR (Reset Secret) (0) | 2020.11.24 |
|---|---|
| bWAPP A4 Insecure DOR (Change Secret) (0) | 2020.11.24 |
| bWAPP A3 Cross-Site-Scripting - Stored (SQLiteManager) (0) | 2020.11.24 |
| bWAPP A3 Cross-Site-Scripting - Stored (Cookies) (0) | 2020.11.24 |
| bWAPP A3 Cross-Site-Scripting - Stored (Change Secret) (0) | 2020.11.24 |