Top Banner
masSEXploitation The Rook
29

MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

Sep 03, 2018

Download

Documents

doxuyen
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

masSEXploitation

The Rook

Page 2: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

http://ppdhuluperak.gov.my

Page 3: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

Defaced!

Page 4: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

… and the next day....

Page 5: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHPNuke.org too!?

Page 6: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

Eleonore Exploit Pack.

Page 7: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

“What I cannot create, I do not understand.” – Richard Feynman

Why?

Page 8: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

Overview

“Layers of security.”--Unkown

“Complexity is the worst enemy of security.”--Bruce Schneier

Page 9: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

ManageEngine Firewall Analyzer 5 CSRF

Execute SQL quires (Not injection) Create a new administrative account

XSS The results from a sql query SELECT “<script>alert(/xss/)</script>”

Page 10: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

Profense Web Application Firewall "Defenses against all OWASP Top Ten

vulnerabilities" CSRF - CVE-2009-0468

Proxy for MITM Configuration changes Shutdown the machine (DoS)

Reflective XSS - CVE-2009-0467

Page 11: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

The PHP-Nuke Exploit(Aug 2009)

● PHP-Nuke 8.1.35● (User account Required!)● SQL Injection

● Get admin● Broken admin● Path disclosure● Filter Bypass● Another sql injection● Local File Include

(Nov 2004)● PHP-Nuke 7.0● SQL Injection

● Get admin● Broken admin

● Enable phpBB● Filter Bypass● Eval()

The PHP-Nuke Exploit

Page 12: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

The PHP-Nuke ExploitThe PHP-Nuke Exploit● (OWASP A1) SQL Injection ● (OWASP A3) Broken Authentication ● (CWE-200) Information Exposure● (CWE-436) Filter Bypass● (OWASP A1) SQL Injection (Again!)● (CWE-98) Local File Include (LFI)

Page 13: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

The PHP-Nuke ExploitThe PHP-Nuke Exploit● (OWASP A1) SQL Injection ● (OWASP A3) Broken Authentication ● (CWE-200) Information Exposure● (CWE-436) Filter Bypass● (OWASP A1) SQL Injection (Again!)● (CWE-98) Local File Include (LFI)

Page 14: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

DEMO!

Page 15: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

Fruit Analogy

Page 16: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHP-Nuke Exploit

OWASP A1: Injection

● SQL Injection in the Journal module to get administrative credentials

Page 17: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHP-Nuke Exploit

OWASP A3:Broken Authentication and Session Management

● Shortcut to admin privileges

Page 18: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHP-Nuke Exploit PHP-Nuke Login:

Secure Login:

Page 19: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

Overview

● PoC Exploit:

Page 20: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHPSecInfo Rocks!

Page 21: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

Demo!

Why 2 sql injection exploits?

Page 22: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

●(CWE-436)Filter Bypass

'%20union%20' '*/union/*' ' union '

Page 23: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

●(CWE-436)Filter Bypass

'%20union%20' '*/union/*' ' union '

Page 24: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHPMyAdmin CSRF+SQLi=RCE (CVE-2008-5621)

Page 25: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHP-Nuke Exploit

PHP Local File Include->Remote Code Execution.

AppArmor will not allow MySQL write to /var/www/ (Even if its chomd 777!)

Page 26: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHP-Nuke Exploit

SQL Injection To create a file in /tmp/ AppArmor allows this. Local File Include to execute the file in

/tmp/

Page 27: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

SELinux doesn't allow this!

Page 28: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHP-Nuke Exploit

● Eval() and preg_replace /e● SELinux does not stop this.

Study in Scarlet (http://www.securereality.com.au/studyinscarlet.txt)

Page 29: MasSEXploitation - DEF CON® Hacking Conference · PHP-Nuke Exploit PHP Local File Include->Remote Code Execution. AppArmor will not allow MySQL write to /var/www/ (Even if its chomd

PHP-Nuke Exploit

END