Hello there, I was having the idea to create a own kind of PHP Adminshell today, and just wrote down a small "concept", what to include, what may be fun to integrate and how.
Some notes I did:
==== PHP Adminshell Concept v0.1 ====
== General ==
- Sourcecode got type of a build process, which allows
to enable/disable different types of modules
- Buildprocess is used just by a normal PHP Script,
which combines multiple files into a single HTML File.
== Modularity ==
- Modules can be included, some examples can be a File Exmplorer,
Shell Execution and some other gimmicks
- Modules are defined in 2 sections:
- functions.php - Collection of Functions used of the Module
- layout.php - Layout of the Output
== Shell ==
Fallback using the 3 differnt functions of PHP, otherwise module
gets deactivated, with a warning.
== PHP Env. Checker ==
Checks for security related warnings like base.path, version and
some other stuff.
Check for the current rights of php running, its owner and so on.
== Security/Misc ==
Some weirdo concepts:
The shell gets encrypted, using AES. The Shell Content is then saved as string,
and gets decrypted at runtime. When eval() is avaiable, the string gets executed using eval().
In case eval() is deactivated, but the current folder got write rights,
the code would create a tmp file, include it, and delete it. That way the
shellcode would persist encrypted, at least as long there I no exact file logging.
Maybe there are some other weirdo concepts too, but that way the shell would be unable
to be detected by static-scanners, since you can use another salt every time.
The key can be passed as via Cookie or Header. Maybe even using a C&C Server, who uses
the IP + specific User Agent for authentication, sent by the PHP Script. That sounds rather
insecure, though.
== Why? ==
For me it's just some kind of educational project. If I would love to hear any
opinions, if that project is actually a fancy thing and if you have anything to add.
---------------------------
Thanks for reading.
Best Regards,
Schalla