diff --git a/common/orchestra.py b/common/orchestra.py index 10b9f49..2a9537b 100644 --- a/common/orchestra.py +++ b/common/orchestra.py @@ -38,7 +38,7 @@ class Conductor: pass elif name.endswith(".pyc"): pass - else: + elif name.endswith(".py"): loaded_server_proto = imp.load_source(name.replace("/", ".").rstrip('.py'), name) self.server_protocols[name] = loaded_server_proto.Server(command_line_object) return diff --git a/protocols/servers/http_server.py b/protocols/servers/http_server.py index 5b0ee1f..3016e24 100644 --- a/protocols/servers/http_server.py +++ b/protocols/servers/http_server.py @@ -26,6 +26,7 @@ class Server: # handle keyboard interrupts except KeyboardInterrupt: print "[!] Rage quiting, and stopping the web server!" + return def serve_on_port(self): try: diff --git a/protocols/servers/https_server.py b/protocols/servers/https_server.py index a20ea6b..28c4d81 100644 --- a/protocols/servers/https_server.py +++ b/protocols/servers/https_server.py @@ -28,6 +28,7 @@ class Server: # handle keyboard interrupts except KeyboardInterrupt: print "[!] Rage quiting, and stopping the web server!" + return def serve_on_port(self): try: diff --git a/protocols/servers/server_template.txt b/protocols/servers/server_template.txt new file mode 100644 index 0000000..9df0eb8 --- /dev/null +++ b/protocols/servers/server_template.txt @@ -0,0 +1,31 @@ +''' + +A brief description of the server module can be placed up here +All import should go between the comments and class declaration +If you have a question, feel free to check out the other server +modules ot just hit me up. + +Finally, be sure to rename this to a .py file + +''' + +class Server: + + def __init__(self, cli_object): + # This is the protocol that is viewable when using --list-servers + # This is what the user would use along with --server + # You have complete access to command line arguments + # within __init__ + # Anything that needs to be set for the server to run should have + # a self attribute created within __init__ + self.protocol = "" + + # This is the main function that is called by the framework + # You can build out as many different functions, but they all + # need to be called from "serve". If there is a specific function + # or class that must be seperated out from this file (ideally keep + # everything in here if possible), then add them to the serverlibs + # directory + def serve(self): + + return