반응형

출처: http://www.hahwul.com/2015/07/web-hacking-xsscross-site-script.html


웹 해킹으로 먹고 살기에 어김없이 보던 중 최근 WVS 결과를 보고 재미있는 사실을 알았습니다.
바로 XSS 와 함께 Cross Frame Script를 보게되었는데, XFS는 처음 들어본 단어였습니다.

XSS와 유사하지만 약간 달라서 XFS라고 명시하고 따로 부르는 듯 합니다.
찾아보니 OWASP에서도 정확하게 명시되어 있었네요..

XFS란?

Cross-Frame Scripting (XFS) is a method of exploiting Cross-site Scripting (XSS). In an XFS attack, the attacker exploits a specific cross-frame-scripting bug in a web browser to access private data on a third-party website. The attacker induces the browser user to navigate to a web page the attacker controls; the attacker's page loads a third-party page in an HTML frame; and then javascript executing in the attacker's page steals data from the third-party page.
XFS also sometimes is used to describe an XSS attack which uses an HTML frame in the attack. For example, an attacker might exploit a Cross Site Scripting Flaw to inject a frame into a third-party web page; or an attacker might create a page which uses a frame to load a third-party page with an XSS flaw.
-OWASP web site-

XSS와 XFS 차이


둘의 차이는 간단합니다. 더 말하자면 XSS가 발생범위가 더 크다고 봅니다. XFS가 발생하는 부분에는 대다수 XSS가 동일하게 들어가기 때문입니다.
XFS는 웹에서 받은 파라미터를 iframe 태그 내 src 속성에 전달하여 사용하는 과정에서 취약점이 발생합니다.

/viewer?page=/test/index.html 과 같은 형태로 viewer 페이지에 page 파라미터를 통해 전달할 때 아래와 같이 노출되는 기능이 있다고 가정합니다.

output
<iframe src="/test/index.html" width=100 height=100></iframe>

위와 같은 형태라면 page 파라미터를 조작하여 공격자가 의도한 페이지로 iframe 링크를 걸 수 있는 XFS 공격구문 구성이 가능합니다.

XFS(Cross Frame Script)
/viewer?page=http://www.codeblack.net

output
<iframe src="http://www.codeblack.net" width=100 height=100></iframe>

해당 부분에서 XSS의 경우에는 javascript 를 이용하거나 html 태그, 속성을 이용하여 공격이 가능할 것입니다.
XSS(Cross Site Script)

input : /viewer?page=javascript:alert(45)
output : <iframe src="javascript:alert(45)" width=100 height=100></iframe>

input : /viewer?page="><script>alert(45)</script><hahwul a="1
output : <iframe src=""><script>alert(45)</script><hahwul a="1" width=100 height=100></iframe>

input : /viewer?page=xss" onload=alert(45) a="
output : <iframe src="xss" onload=alert(45) a="" width=100 height=100></iframe>

두 취약점 모두 유사한 형태이지만 XFS는 단순히 frame 을 통해 다른 도메인으로 연결이 가능할 때 취약하고, XSS는 좀 더 넓게 다른 도메인 및
페이지내에서 스크립트 실행이 직접적으로 가능한 경우도 포함하기 때문에 XSS가 더 risk 가 높은 취약점이라고 이야기 할 수 있습니다.

비슷한 듯 다른 두 공격방법에 대한 이야기였습니다. 감사합니다 :)

반응형

+ Recent posts