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

Diary of a Hack

Diary of a Hack

Telling the story how Websites are hacked. Starting from day one with creating and deploying a feature with a vulnerability and ending with cleaning up the website after it was taken over by attackers.

Helmut Hummel

April 22, 2016
Tweet

More Decks by Helmut Hummel

Other Decks in Technology

Transcript

  1. Inspiring people to share Diary of a Hack Vulnerabilities and

    Attacks Diary of a Hack Helmut Hummel <[email protected]> 22.04.2016 Vulnerabilities and Exploits 1
  2. 14

  3. Diary of a Hack 17 lib.sqliSimple = CONTENT
 lib.sqliSimple {


    table = tt_content
 select.where.wrap = colPos=|
 select.where.data = GP:colPos
 }
  4. Diary of a Hack 18 lib.sqliSearch = CONTENT
 lib.sqliSearch {


    table = tt_content
 select.where.wrap = header like '%|%'
 select.where.data = GP:search
 }
  5. Diary of a Hack 21 'BE/debug' => '1' 'FE/debug' =>

    '1' 'SYS/devIPmask' => '*' 'SYS/displayErrors' => '1' 'SYS/sqlDebug' => '1' 'SYS/exceptionalErrors' => '28674'
  6. 32 'SELECT * FROM tt_content WHERE colPos = ' .

    $_GET['colPos'] Excursion - SQLi
  7. 34 'SELECT * FROM tt_content WHERE colPos = ' .

    $_GET['colPos'] Excursion - SQLi
  8. 35 'SELECT * FROM tt_content WHERE colPos = 0 or

    hidden = 1' $_GET['colPos'] Excursion - SQLi
  9. Diary of a Hack 39 $ sqlmap -u 'http://security.dev/index.php?id=37&colPos=0' -p

    'colPos' ! GET parameter 'colPos' is vulnerable. Do you want to keep testing the others? [y/N] sqlmap identified the following injection points with a total of 30 HTTP(s) requests:
  10. Diary of a Hack 44 $ john pw Loaded 1

    password hash (phpass MD5 [128/128 SSE2 intrinsics 4x4x5]) password (dummy) guesses: 1 time: 0:00:00:01 DONE (Thu Jun 4 11:00:44 2015) c/s: 900 trying: 123456 - fishing
  11. 48

  12. Diary of a Hack Analysis • Make a backup of

    current state (files, DB, logs) • Search all logs for „suspicious“ entries • Find point of entry (security issue) • If in doubt: get help 50
  13. Diary of a Hack 52 lib.sqliSimple = CONTENT
 lib.sqliSimple {


    table = tt_content
 select.where = colPos=###colPos###
 select.markers {
 colPos.data = GP:colPos
 }
 }
  14. Diary of a Hack 53 lib.sqliSearch = CONTENT
 lib.sqliSearch {


    table = tt_content
 select.where = header like ###search###
 select.markers {
 search.data = GP:search
 search.wrap = %|%
 }
 }
  15. Diary of a Hack Fix • Close security issue in

    Code/ Extension/ Core • Restore from backup • Or if you really know what you are doing: cleanup installation • Go online again • Plan improvements (education, monitoring, …) 54
  16. Inspiring people to share Security of Web Applications Vulnerabilities and

    Attacks Topictext Lessons learned • Development/ Testing Environment • Deploy to Production • Least privilege • There is no Software without bugs. Be prepared! 56
  17. Diary of a Hack Best Practice • Operations • Regular

    updates • Backups • Monitoring • Development • Peer Reviews (TypoScript, Code, Templates) • (automated) Tests • Focus • Education • Allocate time for all of the above 57
  18. Inspiring people to share Security of Web Applications Vulnerabilities and

    Attacks Diary of a Hack Resources • http://docs.typo3.org/typo3cms/SecurityGuide/ • http://sqlmap.org • http://www.openwall.com/john/ • https://www.owasp.org/ 59