bWAPP A3 Cross-Site-Scripting - Reflected (Referer)
itsecgames.com
www.itsecgames.com
현재 웹페이지를 어디서 접속했는지에 대한 정보가 웹페이지에 출력된다(referer).
low
low 레벨이다. 웹페이지 소스코드를 보면 i 태그 값으로 박힌 것을 확인할 수 있다.
burp로 프록시를 잡아서 referer 값을 위와 같이 변조한다.
위와 같이 쿠키 값이 출력된 것을 확인할 수 있다.
medium
medium 레벨도 XSS 공격이 먹힌다.
high
high 레벨에선 XSS 공격이 먹히지 않는다.
서버 코드를 보면 medium 레벨은 addslaehs() 함수, high 레벨의 경우 htmlspecialchars() 함수엥 의해 입력 값이 필터링된다. medium 레벨에서만 XSS 공격이 통하는 이유는 addslashes() 함수는 XSS 공격에 사용되는 특수문자 "<" 꺽쇄를 필터링하지 않기 때문이다. 따라서, high 레벨에서는 XSS 공격이 어렵겠다.
* PHP addslashes() Funfction
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 A3 Cross-Site-Scripting - Stored (Blog) (0) | 2020.11.24 |
---|---|
bWAPP A3 Cross-Site-Scripting - Reflected (User-Agent) (0) | 2020.11.24 |
bWAPP A3 Cross-Site-Scripting - Reflected (PHP_SELF) (0) | 2020.11.24 |
bWAPP A3 Cross-Site-Scripting - Reflected (phpMyAdmin) (0) | 2020.11.24 |
bWAPP A3 Cross-Site-Scripting - Reflected (Login Form) (0) | 2020.11.24 |