error: tuple index out of range
Hey !
I've been trying to start coding around this project, but have encountered a recurring error when trying the commands.
I'm creating the agent with
./client.py --name payload --freeze 123.45.67.89 64646
and launching the server with
./server.py --host 192.168.1.50 --port 64646
The agent is connecting back to the server properly, but when trying commands like screenshot, I'll encounter the following :
screenshot error: tuple index out of range
I got the same error when trying outlook.
I narrowed down the crashes to payloads.py, function : load, line :
exec 'import {}'.format(module) in target
As far as i've seen, the global table gets the symbol :
screenshot = <module 'screenshot' from 'http://10.3.141.98:64647/screenshot.py'>
but it takes a long time to do so.
Even though the symbol is here, i'm still getting in the screenshot file
screenshot error: tuple index out of range
I may have not understood how to import modules, I am kind of unsure about that.
Thank you for this project !
Try it with a fresh install really quick and let me know if the issue persists, because shortly after you posted this the server & database just underwent significant updates that should address this issue.
I don't see anything immediately pointing to failure on the return attributes from payload. I noticed some oddness with payloads a while ago, and perhaps it's because of global sharing; I have been using hostnames to not have to worry about translation issues;
exp; ./server.py --host master.example.com --port 31337 ./client.py --freeze --name mybot --host master.example.com --port 31337 server~# echo 127.0.0.1 master.example.com >> /etc/hosts client ~# echo 123.45.67.89 master.example.com >> /etc/hosts
One potential issue is that it doesn't check proactively for active displays... if there is no display (headless) on *nix, it hangs the interpreter I think. Doesn't appear to be the same issue, and windows/apple you know it has a display pretty much always.
Thoughts on proactive display checking in *nix; screenshot.py
import os
import sys
# this is a simple check, something more robust would be better long run;
if 'linux' in sys.platform:
if 'DISPLAY' in os.environ:
#<... screencap>
else:
#<...errorlog>
else:
#<... screencap>
What Python Version are you using ?
I haven't had the time to try again, as I have quite a few deadlines coming up.
Sorry about that, I'll try to get some time whenever I can
I believe this has been resolved. But do let me know if your issue persists.