reorg
This commit is contained in:
		| @ -3,14 +3,14 @@ | ||||
| $BASEDIR  = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}" . dirname($_SERVER['REQUEST_URI']); | ||||
| $SCANSDIR = 'scans'; | ||||
| $NMAPDIR  = dirname(`which nmap`) . "/../share/nmap"; | ||||
| $DATADIR = "."; | ||||
| $DATADIR  = "datadir"; | ||||
|  | ||||
| $presets = [ | ||||
|     "lan" => [ | ||||
|         '-PS'           => 'microsoft-ds', | ||||
|         '-F'            => true, | ||||
|         '-T5'           => true, | ||||
|         '--stylesheet' => "$BASEDIR/xslt/hostsTable.xsl", | ||||
|         '--stylesheet'  => "$BASEDIR/templates/hostsTable.xsl", | ||||
|         'refreshPeriod' => 60, | ||||
|         'sudo'          => false, | ||||
|     ], | ||||
| @ -19,8 +19,8 @@ $presets = [ | ||||
|         '-F'            => true, | ||||
|         '-sV'           => true, | ||||
|         '-T5'           => true, | ||||
|         '--datadir'     => "$DATADIR", | ||||
|         '--stylesheet'  => "$BASEDIR/xslt/servicesTable.xsl", | ||||
|         '--script'      => "http-info,smb-shares-size", | ||||
|         '--stylesheet'  => "$BASEDIR/templates/servicesTable.xsl", | ||||
|         'refreshPeriod' => 60, | ||||
|         'sudo'          => true, | ||||
|     ], | ||||
|  | ||||
| @ -117,5 +117,7 @@ if ($preset && isset($presets[$preset])) { | ||||
|     'compareWith'   => FILTER_VALIDATE_URL, | ||||
|     'refreshPeriod' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]], | ||||
|     'sudo'          => FILTER_VALIDATE_BOOLEAN, | ||||
|   ], false); | ||||
|   ], false) ?: $preset["lan"]; | ||||
| } | ||||
|  | ||||
| $options["--datadir"] = $DATADIR; | ||||
							
								
								
									
										11
									
								
								options.php
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								options.php
									
									
									
									
									
								
							| @ -473,16 +473,21 @@ foreach (scandir($SCANSDIR) as $filename) { | ||||
|  | ||||
|   <datalist id='servicesList'> | ||||
| <?php | ||||
| $nmap_services = file("$NMAPDIR/nmap-services"); | ||||
| $services = []; | ||||
| foreach ([$DATADIR, $NMAPDIR] as $dir) { | ||||
|   echo "<!-- $nmap_services -->\n"; | ||||
|   if (file_exists("$dir/nmap-services")) { | ||||
|     $nmap_services = file("$dir/nmap-services"); | ||||
|     foreach ($nmap_services as $service) { | ||||
|       if (0 !== strpos($service, '#')) { | ||||
|         [$name, $port] = explode("\t", $service); | ||||
|         $services[$name] = explode("/", $port); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| foreach ($services as $name => [$portid, $protocol]) { | ||||
|   echo "    <option value='$name'>$portid</option>\n"; | ||||
|   echo "    <option value='$name'></option>\n"; | ||||
| } | ||||
| ?> | ||||
|   </datalist> | ||||
| @ -514,7 +519,7 @@ foreach ($services as $name => [$portid, $protocol]) { | ||||
|     <option value="vuln"></option> | ||||
|     <!-- names --> | ||||
| <?php | ||||
| foreach ([$NMAPDIR, $DATADIR] as $dir) { | ||||
| foreach ([$DATADIR, $NMAPDIR] as $dir) { | ||||
|   foreach (scandir("$dir/scripts") as $filename) { | ||||
|     if (substr($filename, -4) === '.nse') { | ||||
|       $name = substr($filename, 0, -4); | ||||
|  | ||||
| @ -41,7 +41,7 @@ main { | ||||
|     margin-top: 0; | ||||
| } | ||||
|  | ||||
| .ui.header { | ||||
| .toast-container .ui.header { | ||||
|     text-transform: capitalize; | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -268,7 +268,7 @@ function hostScanning(link) { | ||||
|                         <xsl:with-param name="initHost" select="$initHost"/> | ||||
|                         <xsl:with-param name="currentHost" select="$currentHost"/> | ||||
|                         <xsl:with-param name="hostAddress" select="$hostAddress"/> | ||||
|                         <xsl:sort select="@portid" order="ascending"/> | ||||
|                         <xsl:sort select="number(@portid)" order="ascending"/> | ||||
|                     </xsl:apply-templates> | ||||
|                 </div> | ||||
|             </div> | ||||
| @ -272,7 +272,7 @@ function hostScanning(link) { | ||||
|                     <xsl:with-param name="initHost" select="$initHost"/> | ||||
|                     <xsl:with-param name="currentHost" select="$currentHost"/> | ||||
|                     <xsl:with-param name="hostAddress" select="$hostAddress"/> | ||||
|                     <xsl:sort select="@portid" order="ascending"/> | ||||
|                     <xsl:sort select="number(@portid)" order="ascending"/> | ||||
|                 </xsl:apply-templates> | ||||
|             </div> | ||||
|         </div> | ||||
| @ -283,11 +283,11 @@ function hostScanning(link) { | ||||
|                 <xsl:value-of select="address[@addrtype='mac']/@vendor"/> | ||||
|             </td> | ||||
|             <td> | ||||
|                 <xsl:apply-templates select="$currentHost/ports/port | $initHost/ports/port[not(@portid=$currentHost/ports/port/@portid)][not(state/@state='closed')]"> | ||||
|                 <xsl:apply-templates select="$initHost/ports/port[not(@portid=$currentHost/ports/port/@portid)][not(state/@state='closed')] | $currentHost/ports/port"> | ||||
|                     <xsl:with-param name="initHost" select="$initHost"/> | ||||
|                     <xsl:with-param name="currentHost" select="$currentHost"/> | ||||
|                     <xsl:with-param name="hostAddress" select="$hostAddress"/> | ||||
|                     <xsl:sort select="@portid" order="ascending"/> | ||||
|                     <xsl:sort select="number(@portid)" order="ascending"/> | ||||
|                 </xsl:apply-templates> | ||||
|             </td> | ||||
|             <td> | ||||
| @ -262,7 +262,7 @@ function hostScanning(link) { | ||||
|                     <xsl:with-param name="initHost" select="$initHost"/> | ||||
|                     <xsl:with-param name="currentHost" select="$currentHost"/> | ||||
|                     <xsl:with-param name="hostAddress" select="$hostAddress"/> | ||||
|                     <xsl:sort select="@portid" order="ascending"/> | ||||
|                     <xsl:sort select="number(@portid)" order="ascending"/> | ||||
|                 </xsl:apply-templates> | ||||
|             </tbody> | ||||
|         </table> | ||||
		Reference in New Issue
	
	Block a user