You are on page 1of 2

https://www.imperva.

com/learn/application-security/remote-code-execution/

Exploit Techniques

There are two primary methods for performing RCE: remote code evaluation and stored code
evaluation.

Remote Code Evaluation

Code evaluation occurs when functions that evaluate code accept user input. For example, some
applications allow users to generate variable names using their usernames—the users control their
usernames, so they can create a username including malicious code, and influence applications that
enable input evaluation for a certain programming language.

Stored Code Evaluation

This method differs from standard remote code evaluation because it relies on the interpreter
parsing files rather than specific language functions. The interpreter should not execute files with
user input. Web applications often have an upload functionality but do not sufficiently validate the
files.

For example, an application might have a control panel for each user with specific language variable
settings, which it stores in a config file. Attackers can modify the language parameter to inject code
into the configuration file, allowing them to execute arbitrary commands.

Examples of Known Remote

---

Web shell: https://www.upguard.com/blog/what-are-web-shell-attacks

During a web shell attack, a cybercriminal injects a malicious file into a target web server's directory
and then executes that file from their web browser.

After launching a successful web shell attack, cybercriminals could gain access to sensitive resources,
recruit the target system into a botnet, or create pathways for malware or ransomware injections.
Bind shell:

https://www.youtube.com/watch?v=TWbl-1BlBM0

Attacker initiates connection after sending shell on the target.

Reverse shell: most commonly used

Target initiates connection.

Bind Shell Reverse Shell


S.NO.

Bind Shells have the listener In the reverse shell, the attacker
running on the target and the has the listener running on his/her
attacker connects to the machine and the target connects
listener in order to gain to the attacker with a shell. So that
remote access to the target attacker can access the target
1. system. system.

In Bind shell, the attacker


finds an open port on the In the reverse shell, the attacker
server/ target machine and opens his own port. So that victim
then tries to bind his shell to can connect to that port for
2. that port. successful connection.

The attacker must know the The attacker doesn’t need to know
IP address of the victim the IP address of the victim,
before launching the Bind because the attacker is going to
3. Shell. connect to our open port.

The Reverse shell is opposite of


In Bind shell, the listener is the Bind Shell, in the reverse shell,
ON on the target machine the listener is ON on the Attacker
and the attacker connects to machine and the target machine
4. it. connects to it.

Reverse Shell can bypass the


Bind Shell sometimes will fail, firewall issues because this target
because modern firewalls machine tries to connect to the
don’t allow outsiders to attacker, so the firewall doesn’t
5. connect to open ports. bother checking packets.

You might also like