Skip to main content

Screenshot with Python

Introduction
Since most of the pieces in the malwares or pentesting frameworks has the ability to tak screenshots against targets system. This can help us to capture images ,video frames or other sensitive data we might not be able to see with the packet captures or keyloggers.
Lets walkthrough the code and learn how we can build screenshot capturing script from scratch using python
You can also checkout other hacking scripts in this page hacking scripts
Code is explained for how we can capture the screenshot ,and merge it in the command and control trojan
##Required Libraries
First we acquire a handle to the entire desktop which include the entire viewable area across multiple monitors grab handle to the main desktop window
we then determine the size of the size of the screen so that we know the dimensions required for the screenshots determine the size of all monitors in pixels
create a device context we create a device context using GetWindowDC function call and pass in handle to our desktop
create a memory based device context now we create a memory-based device context where we will store our image capture until we store the bbitmap bytes to a file.
create a bitmap object we then create bitmap object that is set to the device context of our desktop The select object call then sets the memory-based device context to point at the bitmap thet we're capturing
copy the screen into our memory device context we use BitBlt function to take a bit-for-bit copy of the dekstop image and store it in the memory based contest.
Save the bitmap to a file ,the final step is to dump the shot
and then free our objects check the whole code in this repo : Screenshot_with_python



Checkout some more hacking scripts


SECURING SYSTEM BLUETOOTH ATTACKS STEALING AND SNIFFING ATTACKS KALI LINUX HACKING COMMANDS CHEATSHEET TROJAN AND BACKDOORS DICTIONARY AND BURTEFORCING ATTACKS MAN IN THE MIDDLE ATTACKS
1. Sign & Verify message 1. Bluetooth discovery 1. Stealing saved wifi password from windows 1. Hacking commands with Kali Linux 1. Command and Control Trojan 1. Dictionary Attack 1. Man in Browser Attack
2. SandBox Detection 2. Bluetooth SDP browsing 2. Sniffing packets 2. Reverse shell in python
3. TCP Proxy 3. Bluetooth OBEX 3. Email Credential sniffers 3. Keylogger
4. Bluetooth RCOMM channel scanner 4. Screenshot with Python
5. Blue Bug Exploit 5. Backdoor with Python
6. Blue Snarf Exploit
7. Bluetooth spoofing
8. Bluetooth sniffing