-
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stanislav WEB
committed
Jan 3, 2017
1 parent
5672459
commit 9a1dc27
Showing
44 changed files
with
238 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
*.pyc | ||
*~ | ||
*.swp | ||
Logs/ | ||
logs/ | ||
opendoor.egg-info/ | ||
/dist/ |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""ArgumentsConfig class""" | ||
|
||
class ArgumentsConfig: | ||
"""ArgumentsConfig class""" | ||
|
||
arguments = [ | ||
{ | ||
"args": None, | ||
"argl": "--port", | ||
"default": 80, | ||
"action": "store", | ||
"help": "Custom port (Default 80)", | ||
"type" : int | ||
}, | ||
{ | ||
"args": "-t", | ||
"argl": "--threads", | ||
"default": 1, | ||
"action": "store", | ||
"help": "Allowed threads (limited by CPU cores)", | ||
"type": int | ||
}, | ||
{ | ||
"args": "-d", | ||
"argl": "--delay", | ||
"default": 0, | ||
"action": "store", | ||
"help": "Delay between requests", | ||
"type": int | ||
}, | ||
{ | ||
"args": None, | ||
"argl": "--timeout", | ||
"default": 0, | ||
"action": "store", | ||
"help": "Request timeout", | ||
"type": int | ||
}, | ||
{ | ||
"args": None, | ||
"argl": "--debug", | ||
"default": 0, | ||
"action": "store", | ||
"help": "Debug level 1 - 3", | ||
"type": int | ||
}, | ||
{ | ||
"args": "-p", | ||
"argl": "--proxy", | ||
"default": False, | ||
"action": "store_true", | ||
"help": "Using proxylist", | ||
"type": bool | ||
}, | ||
{ | ||
"args": "-s", | ||
"argl": "--scan", | ||
"default": "directories", | ||
"action": "store", | ||
"help": "Scan type scan=directories or scan=subdomains", | ||
"type": str | ||
}, | ||
{ | ||
"args": "-l", | ||
"argl": "--log", | ||
"default": False, | ||
"action": "store_true", | ||
"help": "Scan logging", | ||
"type": bool | ||
}, | ||
{ | ||
"args": None, | ||
"argl": "--update", | ||
"default" : False, | ||
"action" : "store_true", | ||
"help": "Update from CVS", | ||
"type": bool | ||
}, | ||
{ | ||
"args": "-v", | ||
"argl": "--version", | ||
"default": False, | ||
"action": "store_true", | ||
"help": "Get current version", | ||
"type": bool | ||
}, | ||
{ | ||
"args": None, | ||
"argl": "--examples", | ||
"default": False, | ||
"action": "store_true", | ||
"help": "Examples of usage", | ||
"type": bool | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""DebugConfig class""" | ||
|
||
|
||
class DebugConfig: | ||
"""DebugConfig class""" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""MessagesConfig class""" | ||
|
||
|
||
class MessagesConfig: | ||
"""MessagesConfig class""" | ||
|
||
messages = { | ||
'online': "Server {0} {1}:{2} is online", | ||
'offline': "Oops Error occured, Server offline or invalid URL. Reason: {}", | ||
'redirect': "Redirect {0} --> {1}", | ||
'scanning': "Scanning {0} ...", | ||
'abort': "Session canceled", | ||
'timeout': "Connection timeout: {0} . Try to increase --delay between requests", | ||
'excluded': "Excluded path: {0}", | ||
'unresponsible': "Unresponsible path : {0}", | ||
'use_log': "Use --log param to save scan result", | ||
'max_threads': "Passed {0} threads max for your possibility", | ||
'has_scanned': "You already have the results for {0} saved in logs directory.\nWould you like to rescan? Press [ENTER] to continue: ", | ||
'file_detected': "Probably you found important filesource {0} {1}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from .HttpConfig import HttpConfig | ||
from .MessagesConfig import MessagesConfig | ||
from .ArgumentsConfig import ArgumentsConfig | ||
from .DebugConfig import DebugConfig |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"""HttpError class""" | ||
|
||
# -*- coding: utf-8 -*- | ||
class HttpError(Exception): | ||
"""HttpError class""" | ||
|
||
def __init__(self, arg): | ||
self.msg = arg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
from .ArgumentParserError import * | ||
from .HttpError import * |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Command helper class""" | ||
|
||
from argparse import RawDescriptionHelpFormatter | ||
|
||
import sys | ||
|
||
from src.Exceptions import ArgumentParserError, ThrowingArgumentParser | ||
from src.Logger import Logger as Log | ||
from src.Configs import ArgumentsConfig as config | ||
|
||
class Command: | ||
"""Command helper class""" | ||
|
||
def __init__(self): | ||
|
||
try: | ||
parser = ThrowingArgumentParser(description=__doc__, | ||
formatter_class=RawDescriptionHelpFormatter) | ||
required_named = parser.add_argument_group('required named arguments') | ||
required_named.add_argument('-u', '--url', help="URL or page to scan; -u http://example.com") | ||
|
||
for i in range(len(config.arguments)): | ||
arg = config.arguments[i] | ||
if arg['args'] is None: | ||
if bool == arg['type']: | ||
parser.add_argument(arg['argl'], default=arg['default'], action=arg['action'], help=arg['help']) | ||
else: | ||
parser.add_argument(arg['argl'], default=arg['default'], action=arg['action'], help=arg['help'], type=arg['type']) | ||
else: | ||
if bool == arg['type']: | ||
parser.add_argument(arg['args'], arg['argl'], default=arg['default'], action=arg['action'], help=arg['help']) | ||
else: | ||
parser.add_argument(arg['args'], arg['argl'], default=arg['default'], action=arg['action'], help=arg['help'], type=arg['type']) | ||
parser.parse_args() | ||
self.parser = parser | ||
except ArgumentParserError as e: | ||
sys.exit(Log.error(e.message)) | ||
|
||
def get_arg_values(self): | ||
"""Get used input arguments""" | ||
|
||
command_list = {} | ||
|
||
try: | ||
arguments = self.parser.parse_args() | ||
|
||
if not arguments.url and not arguments.version and not arguments.update and not arguments.examples: | ||
sys.exit(Log.error("argument -u/--url is required")) | ||
|
||
for arg, value in vars(arguments).iteritems(): | ||
|
||
if value: | ||
command_list[arg] = value | ||
|
||
if not command_list: | ||
self.parser.print_help() | ||
else: | ||
return command_list | ||
|
||
except AttributeError as e: | ||
sys.exit(Log.error(e.message)) |
Empty file.
Oops, something went wrong.