37
37
from lib .attacks import (
38
38
nmap_scan ,
39
39
sqlmap_scan ,
40
- intel_me
40
+ intel_me # TODO:/ completely remove
41
41
)
42
42
43
43
try :
53
53
CLONE = "https://github.com/ekultek/zeus-scanner.git"
54
54
55
55
# current version <major.minor.commit.patch ID>
56
- VERSION = "1.1.28 " .format (PATCH_ID )
56
+ VERSION = "1.2 " .format (PATCH_ID )
57
57
# colors to output depending on the version
58
58
59
59
VERSION_TYPE_COLORS = {"dev" : 33 , "stable" : 92 , "other" : 30 }
@@ -402,18 +402,36 @@ def grab_random_agent(agent_path="{}/etc/text_files/agents.txt", verbose=False):
402
402
return retval .strip ()
403
403
404
404
405
- def prompt (question , opts = None ):
405
+ def prompt (question , opts = None , default = None ):
406
406
"""
407
407
ask a question
408
408
"""
409
- if opts is not None :
409
+ if opts is not None and default is None :
410
410
options = '/' .join (opts )
411
411
return raw_input (
412
412
"[{} {}] {}[{}]: " .format (
413
413
time .strftime ("%H:%M:%S" ),
414
414
"PROMPT" , question , options
415
415
)
416
416
)
417
+ elif default is not None :
418
+ if opts is not None :
419
+ options = "/" .join (opts )
420
+ print (
421
+ "[{} {}] {}[{}] {}" .format (
422
+ time .strftime ("%H:%M:%S" ), "PROMPT" ,
423
+ question , options , default
424
+ )
425
+ )
426
+ return default
427
+ else :
428
+ print (
429
+ "[{} {}] {} {}" .format (
430
+ time .strftime ("%H:%M:%S" ), "PROMPT" ,
431
+ question , default
432
+ )
433
+ )
434
+ return default
417
435
else :
418
436
return raw_input (
419
437
"[{} {}] {} " .format (
@@ -506,7 +524,7 @@ def write_to_log_file(data_to_write, path, filename):
506
524
os .getcwd ()
507
525
))) + 1 )
508
526
)
509
- skip_log_schema = ("url-log" , "blackwidow-log" , "zeus-log" )
527
+ skip_log_schema = ("url-log" , "blackwidow-log" , "zeus-log" , "extracted" )
510
528
to_search = filename .split ("-" )[0 ]
511
529
amount = len ([f for f in os .listdir (path ) if to_search in f ])
512
530
new_filename = "{}({}).{}" .format (
@@ -787,33 +805,36 @@ def check_for_protection(protected, attack_type):
787
805
logger .warning (set_color (
788
806
"provided target seems to have protection against this attack type..." , level = 30
789
807
))
790
- question = prompt (
791
- "continuing will most likely result in a failure, would you like to continue" , opts = "yN"
792
- )
793
- if question .lower ().startswith ("y" ):
794
- return True
795
- else :
796
- logger .warning (set_color (
797
- "skipping provided target URL..."
798
- ))
799
- return False
800
808
return True
801
809
802
810
803
- def deprecation (target_version , function , * args , ** kwargs ):
811
+ def deprecation (target_version , method , connect = True , * args , ** kwargs ):
804
812
"""
805
813
show a deprecation warning and return the function with the correct given arguments
806
814
"""
807
- print (
808
- "[{} DEPRECATION] {}" .format (
809
- time .strftime ("%H:%M:%S" ), set_color (
810
- "{} will be deprecated by version {}..." .format (
811
- function .__name__ , target_version
812
- ), level = 35
815
+ if connect :
816
+ print (
817
+ "[{} DEPRECATION] {}" .format (
818
+ time .strftime ("%H:%M:%S" ), set_color (
819
+ "{} will be deprecated by version {}..." .format (
820
+ method .__name__ , target_version
821
+ ), level = 35
822
+ )
813
823
)
814
824
)
815
- )
816
- return function (args , kwargs )
825
+ return method (args , kwargs )
826
+ else :
827
+ print (
828
+ "[{} DEPRECATION] {}" .format (
829
+ time .strftime ("%H:%M:%S" ), set_color (
830
+ "{} has been deprecated and will no longer work, "
831
+ "this attack type will be completely removed by v{}..." .format (
832
+ method .__name__ , target_version
833
+ ), level = 35
834
+ )
835
+ )
836
+ )
837
+ shutdown ()
817
838
818
839
819
840
def run_attacks (url , ** kwargs ):
@@ -822,7 +843,7 @@ def run_attacks(url, **kwargs):
822
843
"""
823
844
nmap = kwargs .get ("nmap" , False )
824
845
sqlmap = kwargs .get ("sqlmap" , False )
825
- intel = kwargs .get ("intel" , False )
846
+ intel = kwargs .get ("intel" , False ) # TODO:/ completely remove
826
847
xss = kwargs .get ("xss" , False )
827
848
admin = kwargs .get ("admin" , False )
828
849
verbose = kwargs .get ("verbose" , False )
@@ -831,7 +852,7 @@ def run_attacks(url, **kwargs):
831
852
auto_start = kwargs .get ("auto_start" , False )
832
853
sqlmap_arguments = kwargs .get ("sqlmap_args" , None )
833
854
nmap_arguments = kwargs .get ("nmap_args" , None )
834
- run_ip_address = kwargs .get ("run_ip" , False )
855
+ run_ip_address = kwargs .get ("run_ip" , False ) # TODO:/ completely remove
835
856
show_all = kwargs .get ("show_all" , False )
836
857
do_threading = kwargs .get ("do_threading" , False )
837
858
batch = kwargs .get ("batch" , False )
@@ -846,7 +867,7 @@ def run_attacks(url, **kwargs):
846
867
"port" : nmap ,
847
868
"xss" : xss ,
848
869
"admin" : admin ,
849
- "intel" : intel ,
870
+ "intel" : intel , # TODO:/ completely remove
850
871
"whois" : whois ,
851
872
"clickjacking" : clickjacking
852
873
}
@@ -865,12 +886,15 @@ def run_attacks(url, **kwargs):
865
886
))
866
887
shutdown ()
867
888
889
+ question_msg = "would you like to process found URL: '{}'" .format (url )
868
890
if not batch :
869
891
question = prompt (
870
- "would you like to process found URL: '{}'" . format ( url ) , opts = [ "y" , "N" ]
892
+ question_msg , opts = "yN"
871
893
)
872
894
else :
873
- question = "y"
895
+ question = prompt (
896
+ question_msg , opts = "yN" , default = "y"
897
+ )
874
898
875
899
if question .lower ().startswith ("y" ):
876
900
if sqlmap :
@@ -883,12 +907,9 @@ def run_attacks(url, **kwargs):
883
907
url_ip_address , verbose = verbose ,
884
908
opts = create_arguments (nmap = True , nmap_args = nmap_arguments )
885
909
)
886
- elif intel :
887
- url = get_true_url (url )
910
+ elif intel : # TODO:/ completely remove
888
911
return deprecation (
889
- "1.2" , intel_me .main_intel_amt , url ,
890
- verbose = verbose , proxy = proxy ,
891
- do_ip = run_ip_address
912
+ "1.3" , intel_me .main_intel_amt , connect = False
892
913
)
893
914
elif admin :
894
915
main (
0 commit comments