@@ -56,13 +56,19 @@ def port_scaning_nmap(data_set: list) -> str:
5656def  server_scaning_wapiti (data_set : list ) ->  str :
5757    target  =  next (item [2 ] for  item  in  data_set  if  item [0 ] ==  'wapiti' )
5858    wapiti_action  =  next (item [2 ] for  item  in  data_set  if  item [0 ] ==  'verbosity' )
59+ 
5960    if  not  target .startswith (("http://" , "https://" )):
6061        target  =  "http://"  +  target 
62+ 
6163    command  =  ["wapiti" , f"-v={ wapiti_action }  , "-u" , target ]
6264
65+     # Set UTF-8 encoding 
66+     env  =  os .environ .copy ()
67+     env ["PYTHONUTF8" ] =  "1" 
68+ 
6369    try :
6470        print (command )
65-         result  =  subprocess .run (command , capture_output = True , text = True , check = True )
71+         result  =  subprocess .run (command , capture_output = True , text = True , check = True ,  env = env )
6672        print ("Command Output:" , result .stdout )
6773
6874        for  line  in  result .stdout .splitlines ():
@@ -76,7 +82,7 @@ def server_scaning_wapiti(data_set: list) -> str:
7682        security_report_dir  =  Path (ConfigModule .get_config_value ("sectionOne" , "test_case_folder" , temp_config )) /  'security_report'  /  'wapiti' 
7783        os .makedirs (security_report_dir , exist_ok = True )
7884        destination_path  =  security_report_dir  /  os .path .basename (report_path )
79-          # Move the report file to the new location 
85+ 
8086        shutil .move (report_path , destination_path )
8187        print (f"Report moved to { destination_path }  )
8288
@@ -101,7 +107,6 @@ def server_scaning_arachni(data_set: list) -> str:
101107        print ("***** Arachni setup failed. *****" )
102108        return  "zeuz_failed" 
103109
104- 
105110def  server_scaning_nikto (data_set : list ) ->  str :
106111    """ 
107112    Runs Nikto scan if Perl is installed, otherwise provides installation instructions based on the platform. 
0 commit comments