{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShellEmpire/Empire/issues/222","repository_url":"https://api.github.com/repos/PowerShellEmpire/Empire","labels_url":"https://api.github.com/repos/PowerShellEmpire/Empire/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/PowerShellEmpire/Empire/issues/222/comments","events_url":"https://api.github.com/repos/PowerShellEmpire/Empire/issues/222/events","html_url":"https://github.com/PowerShellEmpire/Empire/issues/222","id":154377939,"number":222,"title":"Missing a way to get the handlers from the api it self","user":{"login":"tristandostaler","id":5489330,"avatar_url":"https://avatars.githubusercontent.com/u/5489330?v=3","gravatar_id":"","url":"https://api.github.com/users/tristandostaler","html_url":"https://github.com/tristandostaler","followers_url":"https://api.github.com/users/tristandostaler/followers","following_url":"https://api.github.com/users/tristandostaler/following{/other_user}","gists_url":"https://api.github.com/users/tristandostaler/gists{/gist_id}","starred_url":"https://api.github.com/users/tristandostaler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tristandostaler/subscriptions","organizations_url":"https://api.github.com/users/tristandostaler/orgs","repos_url":"https://api.github.com/users/tristandostaler/repos","events_url":"https://api.github.com/users/tristandostaler/events{/privacy}","received_events_url":"https://api.github.com/users/tristandostaler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-12T01:28:51Z","updated_at":"2016-05-18T22:15:17Z","closed_at":null,"body":"I modified a little bit the \"empire\" python file with the following content to make it work. I just tought it would be a nice to have!\r\n\r\n\r\ndef start_restful_api(startEmpire=False, suppress=False, username=None, password=None, port=1337):\r\n\"\"\"\r\n(...)\r\n\"\"\"\r\n\r\n    handlers = '''\r\nGET,http://localhost:1337/api/version,return the current Empire version\r\n\r\nGET,http://localhost:1337/api/config,return the current default config\r\n\r\nGET,http://localhost:1337/api/stagers,return all current stagers\r\nGET,http://localhost:1337/api/stagers/X,return the stager with name X\r\nPOST,http://localhost:1337/api/stagers,generate a stager given supplied options (need to implement)\r\n\r\nGET,http://localhost:1337/api/modules,return all current modules\r\nGET,http://localhost:1337/api/modules/<name>,return the module with the specified name\r\nPOST,http://localhost:1337/api/modules/<name>,execute the given module with the specified options\r\nPOST,http://localhost:1337/api/modules/search,searches modulesfor a passed term\r\nPOST,http://localhost:1337/api/modules/search/modulename,searches module names for a specific term\r\nPOST,http://localhost:1337/api/modules/search/description,searches module descriptions for a specific term\r\nPOST,http://localhost:1337/api/modules/search/description,searches module comments for a specific term\r\nPOST,http://localhost:1337/api/modules/search/author,searches module authors for a specific term\r\n\r\nGET,http://localhost:1337/api/listeners,return all current listeners\r\nGET,http://localhost:1337/api/listeners/Y,return the listener with id Y\r\nGET,http://localhost:1337/api/listeners/options,return all listener options\r\nPOST,http://localhost:1337/api/listeners,starts a new listener with the specified options\r\nDELETE,http://localhost:1337/api/listeners/Y,kills listener Y\r\n\r\nGET,http://localhost:1337/api/agents,return all current agents\r\nGET,http://localhost:1337/api/agents/stale,return all stale agents\r\nDELETE,http://localhost:1337/api/agents/stale,removes stale agents from the database\r\nDELETE,http://localhost:1337/api/agents/Y,removes agent Y from the database\r\nGET,http://localhost:1337/api/agents/Y,return the agent with name Y\r\nGET,http://localhost:1337/api/agents/Y/results,return tasking results for the agent with name Y\r\nDELETE,http://localhost:1337/api/agents/Y/results,deletes the result buffer for agent Y\r\nPOST,http://localhost:1337/api/agents/Y/shell,task agent Y to execute a shell command\r\nPOST,http://localhost:1337/api/agents/Y/rename,rename agent Y\r\nGET/POST http://localhost:1337/api/agents/Y/clear,clears the result buffer for agent Y\r\nGET/POST http://localhost:1337/api/agents/Y/kill,kill agent Y\r\n\r\nGET,http://localhost:1337/api/reporting,return all logged events\r\nGET,http://localhost:1337/api/reporting/agent/X,return all logged events for the given agent name X\r\nGET,http://localhost:1337/api/reporting/type/Y,return all logged events of type Y (checkin, task, result, rename)\r\nGET,http://localhost:1337/api/reporting/msg/Z,return all logged events matching message Z, wildcards accepted\r\n\r\nGET,http://localhost:1337/api/creds,return stored credentials\r\n\r\nGET,http://localhost:1337/api/admin/login,retrieve the API token given the correct username and password\r\nGET,http://localhost:1337/api/admin/permanenttoken retrieve the permanent API token, generating/storing one if it doesn't already exist\r\nGET,http://localhost:1337/api/admin/shutdown,shutdown the RESTful API\r\nGET,http://localhost:1337/api/admin/restart,restart the RESTful API\r\n'''\r\n\r\n(...)\r\n\r\n    @app.route('/api/handlers', methods=['GET'])\r\n    def get_handlers():\r\n        \"\"\"\r\n        Returns all the available handlers\r\n        \"\"\"\r\n        return jsonify({'Handlers':handlers})\r\n\r\nCould probably be better but it was made quick for a tool."},"comment":{"url":"https://api.github.com/repos/PowerShellEmpire/Empire/issues/comments/220174545","html_url":"https://github.com/PowerShellEmpire/Empire/issues/222#issuecomment-220174545","issue_url":"https://api.github.com/repos/PowerShellEmpire/Empire/issues/222","id":220174545,"user":{"login":"tristandostaler","id":5489330,"avatar_url":"https://avatars.githubusercontent.com/u/5489330?v=3","gravatar_id":"","url":"https://api.github.com/users/tristandostaler","html_url":"https://github.com/tristandostaler","followers_url":"https://api.github.com/users/tristandostaler/followers","following_url":"https://api.github.com/users/tristandostaler/following{/other_user}","gists_url":"https://api.github.com/users/tristandostaler/gists{/gist_id}","starred_url":"https://api.github.com/users/tristandostaler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tristandostaler/subscriptions","organizations_url":"https://api.github.com/users/tristandostaler/orgs","repos_url":"https://api.github.com/users/tristandostaler/repos","events_url":"https://api.github.com/users/tristandostaler/events{/privacy}","received_events_url":"https://api.github.com/users/tristandostaler/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T22:15:17Z","updated_at":"2016-05-18T22:15:17Z","body":"I found a solution. I will make a pull request soon."}}