Created
December 28, 2016 11:17
-
-
Save cinu/58afe4d2ddea943206c19dae08b68569 to your computer and use it in GitHub Desktop.
PhpSourcerer (static code analysis tool) versus CVE-2016-10033 (PHPMailer < 5.2.18 Remote Code Execution)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php phpsourcerer.php --version | |
PhpSourcerer 0.1.1 | |
$ cat ~/tmp/PHPMailer-5.2.17/CVE-2016-10033.php | |
<?php | |
$mail = new PHPMailer; | |
$mail->setFrom($_POST['a'], $_POST['b']); | |
$ php phpsourcerer.php -i ~/tmp/PHPMailer-5.2.17 -o /tmp/output --gc-disabled -T 0 -M 2G --force | |
$ ls -l /tmp/output/vulnerabilities/ | |
razem 20 | |
drwx------ 6 redeemer redeemer 4096 gru 28 11:46 PHP::echo_POST | |
drwx------ 3 redeemer redeemer 4096 gru 28 11:46 Standard::fwrite_POST | |
drwx------ 3 redeemer redeemer 4096 gru 28 11:46 Standard::ini_set_POST | |
drwx------ 3 redeemer redeemer 4096 gru 28 11:46 Standard::mail_POST | |
drwx------ 4 redeemer redeemer 4096 gru 28 11:46 Standard::popen_POST | |
$ ls -l /tmp/output/vulnerabilities/Standard\:\:mail_POST/ | |
razem 4 | |
drwx------ 2 redeemer redeemer 4096 gru 28 11:46 class.phpmailer.php:700 | |
$ cat /tmp/output/vulnerabilities/Standard\:\:mail_POST/class.phpmailer.php\:700/Standard\:\:mail_POST | |
// ############################################################ | |
// # 2016-12-28 11:46:10 | |
// Sink: Standard::mail (cmdexec) | |
// Risk variable: _POST [/CVE-2016-10033.php:4] | |
// Callstack: | |
// PHPMailer::mailSend [/class.phpmailer.php:1454] | |
// PHPMailer::mailPassthru [/class.phpmailer.php:700] | |
// ############################################################ | |
// # 2016-12-28 11:46:11 | |
// Sink: Standard::mail (cmdexec) | |
// Risk variable: _POST [/CVE-2016-10033.php:4] | |
// Callstack: | |
// PHPMailer::mailSend [/class.phpmailer.php:1458] | |
// PHPMailer::mailPassthru [/class.phpmailer.php:700] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your blogpost & tool look amazing. I had the idea of starting a similar project like this. Wondering if you're going to open source it?
And did you use nikic/php-parser for parsing the php into a syntax tree?