File tree Expand file tree Collapse file tree 3 files changed +32
-4
lines changed
Expand file tree Collapse file tree 3 files changed +32
-4
lines changed Original file line number Diff line number Diff line change 77import time
88from threading import Thread
99from types import SimpleNamespace
10+ from pathlib import Path
1011
1112from flask import Flask , jsonify
1213from flask import request as flask_request
@@ -249,6 +250,15 @@ def new_scan():
249250 form_values = dict (flask_request .form )
250251 raw_report_path_filename = form_values .get ("report_path_filename" )
251252
253+ if form_values .get ("usernames" ) and Path (form_values .get ("usernames" )).is_file ():
254+ raw_username_filename = form_values .get ("usernames" )
255+ form_values ["usernames_list" ] = str (raw_username_filename )
256+ del form_values ["usernames" ]
257+ if form_values .get ("passwords" ) and Path (form_values .get ("passwords" )).is_file ():
258+ raw_password_filename = form_values .get ("passwords" )
259+ form_values ["passwords_list" ] = str (raw_password_filename )
260+ del form_values ["passwords" ]
261+
252262 # Sanitizing this doesn't make sense because this will not
253263 # always start from nettacker's root directory.
254264 enum_path = form_values .get ("custom_enum_file" )
Original file line number Diff line number Diff line change @@ -295,13 +295,22 @@ <h3>Socks Proxy</h3>
295295 < div class ="form-group col-md-6 ">
296296 < h3 > Usernames</ h3 >
297297 < textarea class ="input-mini form-control " rows ="8 " cols ="50 " id ="usernames "
298- data-role ="tagsinput " placeholder ="separate with commas or new line ">
299- </ textarea >
298+ placeholder ="separate with commas or new line "> </ textarea >
299+ < br >
300+ < div class ="input-group col-xs-5 ">
301+ < span class ="input-group-addon "> username file</ span >
302+ < input id ="username_file " type ="text " class ="form-control " placeholder ="Enter username file path ">
303+ </ div >
300304 </ div >
301305 < div class ="form-group col-md-6 ">
302306 < h3 > Passwords</ h3 >
303307 < textarea class ="form-control " rows ="8 " cols ="50 " id ="passwords "
304308 placeholder ="separate with commas or new line "> </ textarea >
309+ < br >
310+ < div class ="input-group col-xs-5 ">
311+ < span class ="input-group-addon "> password file</ span >
312+ < input id ="password_file " type ="text " class ="form-control " placeholder ="Enter password file path ">
313+ </ div >
305314 </ div >
306315 < br >
307316 </ div >
Original file line number Diff line number Diff line change @@ -376,6 +376,15 @@ $(document).ready(function () {
376376 graph_name = this . id ;
377377 } ) ;
378378
379+ // If the user enters a filepath, use that, else the normal texts
380+ var username_text = $ ( "#usernames" ) . val ( ) . trim ( ) ;
381+ var username_filepath = $ ( "#username_file" ) . val ( ) . trim ( ) ;
382+ var usernames_data = username_filepath !== "" ? username_filepath : username_text ;
383+
384+ var password_text = $ ( "#passwords" ) . val ( ) . trim ( ) ;
385+ var password_filepath = $ ( "#password_file" ) . val ( ) . trim ( ) ;
386+ var passwords_data = password_filepath !== "" ? password_filepath : password_text ;
387+
379388 // build post data
380389 var tmp_data = {
381390 targets : $ ( "#targets" ) . val ( ) ,
@@ -395,8 +404,8 @@ $(document).ready(function () {
395404 verbose_mode : $ ( "#verbose_mode" ) . val ( ) ,
396405 ports : $ ( "#ports" ) . val ( ) ,
397406 socks_proxy : $ ( "#socks_proxy" ) . val ( ) ,
398- usernames : $ ( "#usernames" ) . val ( ) ,
399- passwords : $ ( "#passwords" ) . val ( ) ,
407+ usernames : usernames_data ,
408+ passwords : passwords_data ,
400409 custom_enum_file : $ ( "#enum_file" ) . val ( ) ,
401410 } ;
402411
You can’t perform that action at this time.
0 commit comments