remove basedir

This commit is contained in:
Adrien MALINGREY 2024-10-07 16:28:29 +02:00
parent 6dd728ce0d
commit 6319d411c5
4 changed files with 8 additions and 16 deletions

View File

@ -1,4 +1,4 @@
<?php
$NMAP_OPTIONS = '-Pn -F -T5';
$NMAP_OPTIONS = '-PSssh,http,https,msrpc,microsoft-ds -F -T5';
$SCANS_DIR = 'scans';
?>

View File

@ -1,9 +1,4 @@
<?php
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
include_once 'config.php';
$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, [
@ -28,7 +23,9 @@ if (file_exists($initPath)) {
$initPath = '';
}
$result = `nmap $NMAP_OPTIONS --stylesheet stylesheet.xsl -oX - $targets`;
$basedir = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}".dirname($_SERVER['REQUEST_URI']);
$result = `nmap $NMAP_OPTIONS --stylesheet $basedir/stylesheet.xsl -oX - $targets`;
if ($result) {
$xml = new DOMDocument();

View File

@ -1,5 +1,5 @@
.header svg {
margin: -.5em -.4em -.5em -.4em;
margin: -.3em -.5em -.5em -.4em;
fill: currentColor;
}

View File

@ -242,16 +242,11 @@ Exemple: scanme.nmap.org microsoft.com/24 192.168.0.1 10.0-255.0-255.1-254" patt
</xsl:attribute>
<xsl:if test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https'">
<xsl:attribute name="href">
<xsl:value-of select="service/@name" />
:// <xsl:value-of select="$hostAddress" />
: <xsl:value-of select="@portid" />
<xsl:value-of select="service/@name" />://<xsl:value-of select="$hostAddress" />:<xsl:value-of select="@portid" />
</xsl:attribute>
</xsl:if>
<xsl:if test="service/@name='ms-wbt-server'">
<xsl:attribute name="href">
<xsl:value-of select="$basedir" />
/rdp.php?v=<xsl:value-of select="$hostAddress" />
: <xsl:value-of select="@portid" />
<xsl:attribute name="href">rdp.php?v=<xsl:value-of select="$hostAddress" />:<xsl:value-of select="@portid" />
</xsl:attribute>
</xsl:if>
<xsl:if test="(service/@name='microsoft-ds' or service/@name='netbios-ssn') and ../../hostscript/script[@id='smb-shares-size']/table">