Web Shells
A web shell is a malicious piece of code or script created using server-side programming languages like PHP, ASP, PERL, RUBY, and Python. These scripts are then implanted onto a targeted server. This malicious code empowers attackers to establish remote access or remote administration control over the target server and its file system. Attackers introduce these malicious scripts by exploiting common vulnerabilities, including remote file inclusion (RFI), local file inclusion (LFI), exposure of administrative interfaces, and SQL injection.
You have access to different kinds of web shells on Kali here:
PHP Web Shells
Executing a single command:
Taking input from a URL parameter (e.g., shell.php?cmd=whoami):
The same as above, but using passthru
:
To make shell_exec
output the result, you need to echo it:
Note: exec()
does not output the result unless you echo it and only provides the last line. Thus, it's not very useful for capturing output:
Alternatively, you can use exec
to return the output as an array and then print it:
A cool trick using preg_replace
:
Using backticks to capture and display output:
Or simply:
Web Shell Tools
WSO (Web Shell by oRb)
b374k
C99
R57
Last updated