기본 콘텐츠로 건너뛰기

Reflected XSS Attacks [ Cross-Site-Scripting ]

Reflected XSS Attacks






[Description]

Reflected XSS 는 반사형 XSS 로 URL을 통해 사용자에게 전달하여 사용자가 해당 URL을 클릭 시 악성 스크립트가 실행되는 방식입니다.


[그림1] 

[그림 1] XSS 구문이 적힌 스크립트를 입력하는 그림. 

위와 같이 <script>alert(1339)</script> 를 작성 후 , Purchase 를 누르는 동시에 
패킷을 잡고 Request 값을 분석하여 매개변수에 작성한 XSS 구문을 분석합니다.





[그림 2] 


[그림 2] 패킷을 통해 잡은 Request 값 분석 그림

Request 값 분석 시 URL 은 다음과 같습니다.


http://localhost:8080/WebGoat/attack?Screen=923&menu=900&QTY1=1&QTY2=1&QTY3=1&QTY4=1
&field2=4128+3214+0002+1999&field1=%3Cscript%3Ealert(1339)%3C%2Fscript%3E&SUBMIT=Purchase


위 URL 을 복사 후 , 페이지를 열어 XSS 에 취약한지 취약점을 진단합니다.



[그림 3] 

[그림 3] 악성 자바스크립트 코드 호출 성공 그림

삽입한 XSS 구문의 자바스크립트 코드가 필터링 없이 그대로 서버에 처리되어 
경고창을 띄우는데 성공합니다.






[impact]


공격자는 피싱 사이트 유도 , 사용자 쿠키 값 탈취 등
다양한 공격을 수행할수있습니다.

댓글

이 블로그의 인기 게시물

HackerOne Vulnerability Analysis 1

이 문서는  HackerOne 에서  제출된 많은 보고서들을 토대로 핵심 Payload만 요약하여 직접 작성하였습니다. Link :  https://hackerone.com/ Vulnerabilities list 1. CRLF Injection 2. Open Redirection  3. Cross-Site-Scripting 4. SQL-Injection 5. Path Traversal  CRLF Injection PoC http://www.myshopify.com/xxcrlftest%0aSet-Cookie:test=test3;domain=.myshopify.com; https://www.blackfan.myshopify.com/xxx%0aSet-Cookie:test=test2;domain=.myshopify.com; HTTP Response: HTTP/1.1 302 Moved Temporarily ... Location: http://myshopify.com/xxcrlftest Set-Cookie:test=test;domain=.myshopify.com; PoC: https://engineeringblog.yelp.com/xxcrlftest%0d%0aSet-Cookie:%20test=test;domain=.yelp.com HTTP Response: HTTP/1.1 301 Moved Permanently ... Location: http://engineeringblog.yelp.com/xxcrlftest Set-Cookie: test=test;domain=.yelp.com PoC (Chrome, Internet Explorer) http://gratipay.com/%0dSet-Cookie:csrf_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; HTTP Resp...

XVWA Xpath Injection

XVWA Xpath I njection [그림 1] Summary [그림1]  는  Xpath Injection  공격을 시도해 볼 수 있도록 개발된 폼을 제공하고 있습니다. Description ' or substring(name(parent::*[position()=1]),1,1)='A ' or substring(name(parent::*[position()=1]),1,1)='B ' or substring(name(parent::*[position()=1]),1,1)='C 노드 대입을 통한 결과 다음과 같이 Xpath 에 취약한 결과가 나오는것을 확인할수있습니다. ' or '1'='1  주입결과. Steps to reproduce 1. ' or substring((//user[position()=1]/child::node()[position()=1]),1,1)="a" or ''=' Source Code Impact 공격자는 Xpath Query 주입을 통해  액세스 할 수없는 데이터에 접근할수있습니다.

Juice Shop XSS [ Dom based XSS ]

Juice Shop XSS [ Dom based XSS ] Search 입력란에 악성 스크립트를 넣어 XSS 취약점을 진단합니다. Payload :  <iframe src="javascript:alert(`xss`)">   다음과 같이 이는 < , > 는 &lt; , &gt; 로 특수문자를 필터링하지 않기에 XSS 에 취약합니다.