Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The need to use run for RCE is lacking documentation #52

Open
zombozo12 opened this issue Jun 22, 2018 · 2 comments
Open

The need to use run for RCE is lacking documentation #52

zombozo12 opened this issue Jun 22, 2018 · 2 comments
Labels
enhancement to be documented user experience impacts user experience or something is confusing to newcommers
Milestone

Comments

@zombozo12
Copy link

Why so many commands that cannot be executed? Like 'git' for example. I cant use git in phpsploit, but I can used it with WebConsole. Why? Is phpsploit used to be like back-connect?

this is phpsploit
gambar

this is webconsole
gambar

@zombozo12 zombozo12 changed the title Command not found Unknown Command Jun 22, 2018
@nil0x42
Copy link
Owner

nil0x42 commented Jun 22, 2018

Hi !
Indeed, phpsploit is NOT a simple backconnect, but a framework with INTERNAL commands.
Let me explain:
when you type help, the commands you see can be core commands (for managing phpsploit settings, connection, and showing help), then when you are connected to a TARGET, there are the PLUGIN COMMANDS, which run furtive php payloads hidden in http headers.

For example, when you type ls from a remote target, you are not actually running remote system's /bin/ls, but you are executing the ls phpsploit plugin, this PLUGIN executes a PHP CODE inside of target, with php functions like opendir(), is_dir(), etc.

This is a feature and not a bug, as MANY, MANY remote php servers simply DONT allow execution of RCE, so with phpsploit you still have access to basic commands in order to do your privesc & C&C.

But, if you use the awesome help command, you will discover that PLUGIN named run does exactly what you want, as this plugin tries multiple ways to execute arguments passed to it.
So in your case you must type:
run git ... instead of git.

Another tip for you:
If you use the help command, you will also discover that a special core command exists to bind phpsploit's shell to any command or plugin. This is useful when you are exploiting the remote server with a single plugin (for example run or mysql), and you are tired to always type this command at start of your commands.

For example, if you connect to a local mysql servetr through mysql PLUGIN, you will probably dedicate a good time only running sql commands, so instead of doing (example):

phpsploit(victim.com) > mysql show databases
phpsploit(victim.com) > mysql show tables
phpsploit(victim.com) > mysql select * from users
phpsploit(victim.com) > # etc...

You can first bind your phpsploit shell as follows:

phpsploit(victim.com) > bind mysql
phpsploit(victim.com) #mysql > show databases
phpsploit(victim.com) #mysql > show tables
phpsploit(victim.com) #mysql > select * from users

You can note the same applies for any plugin, in your case, the run plugin.
This is totally optional, but as i said it can be move convenient than having to prefix each command with plugin's name.

NOTE:
Phpsploit have no documentation, and it's manpage is old as f*ck, BUT the help command is very complete and totally up-to-date, so feel free to use it

@nil0x42 nil0x42 closed this as completed Jun 22, 2018
@nil0x42 nil0x42 reopened this Jan 15, 2019
@nil0x42 nil0x42 added enhancement user experience impacts user experience or something is confusing to newcommers labels Jan 15, 2019
@nil0x42 nil0x42 added this to the Release 3.1 milestone Jan 15, 2019
nil0x42 added a commit that referenced this issue Jan 15, 2019
as shown in issue #52, newcomming users tend to be frustrated
by thinking phpsploit is not working when they try to run a
remote command without using the `run` plugin.

This commit makes things clearer by explicitly suffixing:
    (use `run` plugin to run remote command)
to 'Unknown command' error message.
@nil0x42
Copy link
Owner

nil0x42 commented Jan 15, 2019

Partially resolved:

This user experience issue should not happen anymore since commit 4584e2c

TODO:

The lack of documentation for bind command and how the phpsploit commands work is still awaiting documentation

@nil0x42 nil0x42 changed the title Unknown Command The need to use run for RCE lacks documentation Jan 15, 2019
@nil0x42 nil0x42 changed the title The need to use run for RCE lacks documentation The need to use run for RCE is lacking documentation Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement to be documented user experience impacts user experience or something is confusing to newcommers
Projects
None yet
Development

No branches or pull requests

2 participants