script-arg-file.ini
This commit is contained in:
		
							
								
								
									
										12
									
								
								config.php
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								config.php
									
									
									
									
									
								
							| @ -1,10 +1,11 @@ | |||||||
| <?php | <?php | ||||||
|  |  | ||||||
| $port     = (($_SERVER['REQUEST_SCHEME'] == "http" && $_SERVER['SERVER_PORT'] == 80) || ($_SERVER['REQUEST_SCHEME'] == "https" && $_SERVER['SERVER_PORT'] == 443)) ? "" : ":{$_SERVER['SERVER_PORT']}"; | $port       = (($_SERVER['REQUEST_SCHEME'] == "http" && $_SERVER['SERVER_PORT'] == 80) || ($_SERVER['REQUEST_SCHEME'] == "https" && $_SERVER['SERVER_PORT'] == 443)) ? "" : ":{$_SERVER['SERVER_PORT']}"; | ||||||
| $BASEDIR  = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}$port" . dirname($_SERVER['SCRIPT_NAME']); | $BASEDIR    = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}$port" . dirname($_SERVER['SCRIPT_NAME']); | ||||||
| $SCANSDIR = 'scans'; | $SCANSDIR   = 'scans'; | ||||||
| $NMAPDIR  = dirname(`which nmap`) . "/../share/nmap"; | $NMAPDIR    = dirname(`which nmap`) . "/../share/nmap"; | ||||||
| $DATADIR  = "datadir"; | $DATADIR    = "datadir"; | ||||||
|  | $SCRIPTARGS = "script-arg-file.ini"; | ||||||
|  |  | ||||||
| $presets = [ | $presets = [ | ||||||
|     "default" => [ |     "default" => [ | ||||||
| @ -21,7 +22,6 @@ $presets = [ | |||||||
|         '-sV'                => true, |         '-sV'                => true, | ||||||
|         '-T'                 => 5, |         '-T'                 => 5, | ||||||
|         '--script'           => "http-info,smb-shares-size", |         '--script'           => "http-info,smb-shares-size", | ||||||
|         '--script-args-file' => "smb-authentication.ini", |  | ||||||
|         '--stylesheet'       => "$BASEDIR/templates/hostScan.xsl", |         '--stylesheet'       => "$BASEDIR/templates/hostScan.xsl", | ||||||
|         'refreshPeriod'      => 60, |         'refreshPeriod'      => 60, | ||||||
|         'sudo'               => true, |         'sudo'               => true, | ||||||
|  | |||||||
							
								
								
									
										3
									
								
								datadir/script-arg-file.ini
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								datadir/script-arg-file.ini
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | |||||||
|  | smbdomain   =  | ||||||
|  | smbuser     =  | ||||||
|  | smbpassword =  | ||||||
| @ -1,3 +0,0 @@ | |||||||
| smbdomain   = auth.ad.e2.rie.gouv.fr |  | ||||||
| smbuser     = application.drieat |  | ||||||
| smbpassword = d+iFiWn4!cAzdr3KopiM>EA |  | ||||||
| @ -116,8 +116,6 @@ if ($preset && isset($presets[$preset])) { | |||||||
|   ], false) ?: $presets["default"]; |   ], false) ?: $presets["default"]; | ||||||
| } | } | ||||||
|  |  | ||||||
| $options["--datadir"] = $DATADIR; |  | ||||||
|  |  | ||||||
| /*echo "<!--"; | /*echo "<!--"; | ||||||
| var_dump($options); | var_dump($options); | ||||||
| echo "-->\n";*/ | echo "-->\n";*/ | ||||||
							
								
								
									
										3
									
								
								scan.php
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								scan.php
									
									
									
									
									
								
							| @ -3,6 +3,9 @@ | |||||||
| include_once 'config.php'; | include_once 'config.php'; | ||||||
| include_once 'filter_inputs.php'; | include_once 'filter_inputs.php'; | ||||||
|  |  | ||||||
|  | $options["--datadir"] = $DATADIR; | ||||||
|  | $options["--script-args-file"] = $SCRIPTARGS; | ||||||
|  |  | ||||||
| if (!file_exists($SCANSDIR)) mkdir($SCANSDIR); | if (!file_exists($SCANSDIR)) mkdir($SCANSDIR); | ||||||
|  |  | ||||||
| $command = ($options["sudo"]?? false ? "sudo " : "") . "nmap"; | $command = ($options["sudo"]?? false ? "sudo " : "") . "nmap"; | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user