728x90
728x90
728x90
 

itsecgames.com

 

www.itsecgames.com

[사진 1]

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

 

low

[사진 2]
[사진 3]

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

 

medium

[사진 4]

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

 

high

[사진 5]

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

 

[사진 6]
[사진 7]

서버 코드를 보면 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

728x90
728x90

+ Recent posts