Compare commits
3 Commits
705904fbfa
...
a7c67292ed
Author | SHA1 | Date | |
---|---|---|---|
a7c67292ed | |||
dfd89a5add | |||
c6b8005958 |
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
include_once "config.php";
|
include_once "config.php";
|
||||||
|
|
||||||
$targetsListRegex = "/^[\da-zA-Z-. \/]+$/";
|
$targetsListRegex = '/^[\da-zA-Z-. \/]+$/';
|
||||||
$hostsListRegex = "/^[\da-zA-Z-.,:\/]+$/";
|
$hostsListRegex = '/^[\da-zA-Z-.,:\/]+$/';
|
||||||
$protocolePortsListRegex = "/^(([TU]:)?[0-9\-]+|[a-z\-]+)(,([TU]:)?[0-9\-]+|,[a-z\-]+)*$/";
|
$protocolePortsListRegex = '/^(([TU]:)?[0-9\-]+|[a-z\-]+)(,([TU]:)?[0-9\-]+|,[a-z\-]+)*$/';
|
||||||
$portsListRegex = "/^([0-9\-]+|[a-z\-]+)(,[0-9\-]+|,[a-z\-]+)*$/";
|
$portsListRegex = '/^([0-9\-]+|[a-z\-]+)(,[0-9\-]+|,[a-z\-]+)*$/';
|
||||||
$tempoRegex = "/^\d+[smh]?$/";
|
$tempoRegex = '/^\d+[smh]?$/';
|
||||||
$fileNameRegex = '/^[^<>:"\/|?]+$/';
|
$fileNameRegex = '/^[^<>:"\/|?]+$/';
|
||||||
|
|
||||||
$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||||
@ -46,8 +46,8 @@ if ($preset && isset($presets[$preset])) {
|
|||||||
'-sN' => FILTER_VALIDATE_BOOLEAN,
|
'-sN' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sX' => FILTER_VALIDATE_BOOLEAN,
|
'-sX' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sU' => FILTER_VALIDATE_BOOLEAN,
|
'-sU' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--scanflags' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => "/^(URG|ACK|PSH|RST|SYN|FIN|,)+|[1-9]?[0-9]|[1-2][0-9][0-9]$/"]],
|
'--scanflags' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^(URG|ACK|PSH|RST|SYN|FIN|,)+|[1-9]?[0-9]|[1-2][0-9][0-9]$/']],
|
||||||
'-sI' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => "/^[a-zA-Z\d:.-]+(:\d+)?$/"]],
|
'-sI' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-zA-Z\d:.-]+(:\d+)?$/']],
|
||||||
'-sO' => FILTER_VALIDATE_BOOLEAN,
|
'-sO' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-b' => FILTER_VALIDATE_URL,
|
'-b' => FILTER_VALIDATE_URL,
|
||||||
'--traceroute' => FILTER_VALIDATE_BOOLEAN,
|
'--traceroute' => FILTER_VALIDATE_BOOLEAN,
|
||||||
@ -66,7 +66,8 @@ if ($preset && isset($presets[$preset])) {
|
|||||||
'--version-trace' => FILTER_VALIDATE_BOOLEAN,
|
'--version-trace' => FILTER_VALIDATE_BOOLEAN,
|
||||||
// SCRIPT SCAN:
|
// SCRIPT SCAN:
|
||||||
'-sC' => FILTER_VALIDATE_BOOLEAN,
|
'-sC' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--script' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => "/^[a-z][a-z0-9,\-\.\/]*$/"]],
|
'--script' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-z][a-z0-9,\-\.\/]*$/']],
|
||||||
|
'--script-args' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^([a-zA-Z][a-zA-Z0-9\-_]*=[^"]+(,[a-zA-Z][a-zA-Z0-9\-_]*=[^"]+)?)$/']],
|
||||||
// OS DETECTION:
|
// OS DETECTION:
|
||||||
'-O' => FILTER_VALIDATE_BOOLEAN,
|
'-O' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--osscan-limit' => FILTER_VALIDATE_BOOLEAN,
|
'--osscan-limit' => FILTER_VALIDATE_BOOLEAN,
|
||||||
@ -90,11 +91,11 @@ if ($preset && isset($presets[$preset])) {
|
|||||||
'--mtu' => FILTER_VALIDATE_INT,
|
'--mtu' => FILTER_VALIDATE_INT,
|
||||||
'-D' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
'-D' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
||||||
'-S' => ['filter' => FILTER_VALIDATE_IP],
|
'-S' => ['filter' => FILTER_VALIDATE_IP],
|
||||||
'-e' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => "/^[a-z\d]+$/"]],
|
'-e' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-z\d]+$/']],
|
||||||
'-g' => FILTER_VALIDATE_INT,
|
'-g' => FILTER_VALIDATE_INT,
|
||||||
'--source-port' => FILTER_VALIDATE_INT,
|
'--source-port' => FILTER_VALIDATE_INT,
|
||||||
'--data-length' => FILTER_VALIDATE_INT,
|
'--data-length' => FILTER_VALIDATE_INT,
|
||||||
'--ip-options' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => "/^\"(R|T|U|L [\da-zA-Z-.: ]+|S [\da-zA-Z-.: ]+|\\\\x[\da-fA-F]{1,2}(\*[\d]+)?|\\\\[0-2]?[\d]{1,2}(\*[\d]+)?)\"$/"]],
|
'--ip-options' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^\"(R|T|U|L [\da-zA-Z-.: ]+|S [\da-zA-Z-.: ]+|\\\\x[\da-fA-F]{1,2}(\*[\d]+)?|\\\\[0-2]?[\d]{1,2}(\*[\d]+)?)\"$/']],
|
||||||
'--ttl' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 255]],
|
'--ttl' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 255]],
|
||||||
'--spoof-mac' => FILTER_VALIDATE_MAC,
|
'--spoof-mac' => FILTER_VALIDATE_MAC,
|
||||||
'--badsum' => FILTER_VALIDATE_BOOLEAN,
|
'--badsum' => FILTER_VALIDATE_BOOLEAN,
|
||||||
|
12
index.php
12
index.php
@ -349,6 +349,13 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
title="<catégories|répertoire|nom|all>" list="scripts" pattern="[a-z][a-z0-9\-\.\/]*"
|
title="<catégories|répertoire|nom|all>" list="scripts" pattern="[a-z][a-z0-9\-\.\/]*"
|
||||||
value="<?= htmlentities($options["--script"] ?? "", ENT_QUOTES); ?>">
|
value="<?= htmlentities($options["--script"] ?? "", ENT_QUOTES); ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<label for="scriptArgsInput" title="--script-args">Arguments des scripts</label>
|
||||||
|
<input type="text" id="scriptArgsInput" name="--script-args" placeholder="nom=valeur"
|
||||||
|
pattern='[a-zA-Z][a-zA-Z0-9\-_]*=[^"]+(,[a-zA-Z][a-zA-Z0-9\-_]*=[^"]+)?' value="<?= $options['--script-args'] ?? "" ?>"
|
||||||
|
title="<n1=v1,[n2=v2,...]>">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="title"><i class="icon dropdown"></i>Détection du système d'exploitation</div>
|
<div class="title"><i class="icon dropdown"></i>Détection du système d'exploitation</div>
|
||||||
@ -557,8 +564,8 @@ foreach ([$DATADIR, $NMAPDIR] as $dir) {
|
|||||||
<script>
|
<script>
|
||||||
class TagsInput extends Tagify {
|
class TagsInput extends Tagify {
|
||||||
constructor(input, options={}, delim = ",") {
|
constructor(input, options={}, delim = ",") {
|
||||||
options.delimiters = " |,"
|
if (!options.delimiters) options.delimiters = " |,"
|
||||||
options.originalInputValueFormat = tags => tags.map(tag => tag.value).join(delim)
|
if (!options.originalInputValueFormat) options.originalInputValueFormat = tags => tags.map(tag => tag.value).join(delim)
|
||||||
if (input.list) options.whitelist = Array.from(input.list.options).map(option => option.value)
|
if (input.list) options.whitelist = Array.from(input.list.options).map(option => option.value)
|
||||||
super(input, options)
|
super(input, options)
|
||||||
}
|
}
|
||||||
@ -585,6 +592,7 @@ foreach ([$DATADIR, $NMAPDIR] as $dir) {
|
|||||||
new TagsInput(dnsServersInput)
|
new TagsInput(dnsServersInput)
|
||||||
new TagsInput(scanflagsInput)
|
new TagsInput(scanflagsInput)
|
||||||
new TagsInput(scriptInput, {enforceWhitelist: true})
|
new TagsInput(scriptInput, {enforceWhitelist: true})
|
||||||
|
new TagsInput(scriptArgsInput, {delimiters: ','})
|
||||||
|
|
||||||
newScanForm.onsubmit = function(event) {
|
newScanForm.onsubmit = function(event) {
|
||||||
if (this.checkValidity()) {
|
if (this.checkValidity()) {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
version="1.1">
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:import href="parseCommand.xsl"/>
|
||||||
|
|
||||||
<xsl:output method="html" encoding="UTF-8"/>
|
<xsl:output method="html" encoding="UTF-8"/>
|
||||||
<xsl:output indent="yes"/>
|
<xsl:output indent="yes"/>
|
||||||
<xsl:strip-space elements='*'/>
|
<xsl:strip-space elements='*'/>
|
||||||
@ -40,7 +42,7 @@
|
|||||||
<xsl:text>/scan.php?targets=</xsl:text>
|
<xsl:text>/scan.php?targets=</xsl:text>
|
||||||
<xsl:value-of select="$targets"/>
|
<xsl:value-of select="$targets"/>
|
||||||
<xsl:text>&</xsl:text>
|
<xsl:text>&</xsl:text>
|
||||||
<xsl:call-template name="optionsList">
|
<xsl:call-template name="parseCommand">
|
||||||
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
||||||
<xsl:with-param name="asURL" select="true()"/>
|
<xsl:with-param name="asURL" select="true()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@ -79,7 +81,7 @@
|
|||||||
<xsl:text>can</xsl:text>
|
<xsl:text>can</xsl:text>
|
||||||
</a>
|
</a>
|
||||||
<form id="lanScanForm" class="right menu">
|
<form id="lanScanForm" class="right menu">
|
||||||
<xsl:call-template name="optionsList">
|
<xsl:call-template name="parseCommand">
|
||||||
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
||||||
<xsl:with-param name="asURL" select="false()"/>
|
<xsl:with-param name="asURL" select="false()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@ -371,92 +373,4 @@ function hostScanning(link) {
|
|||||||
</a>
|
</a>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="optionsList">
|
|
||||||
<xsl:param name="argList" select=""/>
|
|
||||||
<xsl:param name="asURL" select="false()"/>
|
|
||||||
<xsl:variable name="nextArgs" select="substring-after($argList, ' -')"/>
|
|
||||||
<xsl:variable name="argAndValue">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$nextArgs">
|
|
||||||
<xsl:value-of select="substring-before($argList, ' -')"/>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise><xsl:value-of select="$argList"/></xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="starts-with($argAndValue, '-')">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="contains($argAndValue, ' ')">
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring-before($argAndValue, ' ')"/>
|
|
||||||
<xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="$argAndValue"/>
|
|
||||||
<xsl:with-param name="value" select="on"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="starts-with($argAndValue, 'P') or starts-with($argAndValue, 's') or starts-with($argAndValue, 'o')">
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring($argAndValue, 1, 2)"/>
|
|
||||||
<xsl:with-param name="value" select="substring($argAndValue, 3)"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring($argAndValue, 1, 1)"/>
|
|
||||||
<xsl:with-param name="value" select="substring($argAndValue, 2)"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
|
|
||||||
<xsl:if test="$nextArgs">
|
|
||||||
<xsl:call-template name="optionsList">
|
|
||||||
<xsl:with-param name="argList" select="$nextArgs"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="input">
|
|
||||||
<xsl:param name="name"/>
|
|
||||||
<xsl:param name="value" select=""/>
|
|
||||||
<xsl:param name="asURL" select="false()"/>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$asURL">
|
|
||||||
<xsl:text>-</xsl:text>
|
|
||||||
<xsl:value-of select="$name"/>
|
|
||||||
<xsl:text>=</xsl:text>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>
|
|
||||||
<xsl:otherwise>on</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:text>&</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<input type="hidden" name="-{$name}">
|
|
||||||
<xsl:attribute name="value">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>
|
|
||||||
<xsl:otherwise>on</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:attribute>
|
|
||||||
</input>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
@ -4,6 +4,8 @@
|
|||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
version="1.1">
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:import href="parseCommand.xsl"/>
|
||||||
|
|
||||||
<xsl:output method="html" encoding="UTF-8"/>
|
<xsl:output method="html" encoding="UTF-8"/>
|
||||||
<xsl:output indent="yes"/>
|
<xsl:output indent="yes"/>
|
||||||
<xsl:strip-space elements='*'/>
|
<xsl:strip-space elements='*'/>
|
||||||
@ -40,7 +42,7 @@
|
|||||||
<xsl:text>/scan.php?targets=</xsl:text>
|
<xsl:text>/scan.php?targets=</xsl:text>
|
||||||
<xsl:value-of select="$targets"/>
|
<xsl:value-of select="$targets"/>
|
||||||
<xsl:text>&</xsl:text>
|
<xsl:text>&</xsl:text>
|
||||||
<xsl:call-template name="optionsList">
|
<xsl:call-template name="parseCommand">
|
||||||
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
||||||
<xsl:with-param name="asURL" select="true()"/>
|
<xsl:with-param name="asURL" select="true()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@ -93,7 +95,7 @@
|
|||||||
<xsl:text>can</xsl:text>
|
<xsl:text>can</xsl:text>
|
||||||
</a>
|
</a>
|
||||||
<form id="lanScanForm" class="right menu">
|
<form id="lanScanForm" class="right menu">
|
||||||
<xsl:call-template name="optionsList">
|
<xsl:call-template name="parseCommand">
|
||||||
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
||||||
<xsl:with-param name="asURL" select="false()"/>
|
<xsl:with-param name="asURL" select="false()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@ -358,92 +360,4 @@ function hostScanning(link) {
|
|||||||
</a>
|
</a>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="optionsList">
|
|
||||||
<xsl:param name="argList" select=""/>
|
|
||||||
<xsl:param name="asURL" select="false()"/>
|
|
||||||
<xsl:variable name="nextArgs" select="substring-after($argList, ' -')"/>
|
|
||||||
<xsl:variable name="argAndValue">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$nextArgs">
|
|
||||||
<xsl:value-of select="substring-before($argList, ' -')"/>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise><xsl:value-of select="$argList"/></xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="starts-with($argAndValue, '-')">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="contains($argAndValue, ' ')">
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring-before($argAndValue, ' ')"/>
|
|
||||||
<xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="$argAndValue"/>
|
|
||||||
<xsl:with-param name="value" select="on"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="starts-with($argAndValue, 'P') or starts-with($argAndValue, 's') or starts-with($argAndValue, 'o')">
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring($argAndValue, 1, 2)"/>
|
|
||||||
<xsl:with-param name="value" select="substring($argAndValue, 3)"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring($argAndValue, 1, 1)"/>
|
|
||||||
<xsl:with-param name="value" select="substring($argAndValue, 2)"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
|
|
||||||
<xsl:if test="$nextArgs">
|
|
||||||
<xsl:call-template name="optionsList">
|
|
||||||
<xsl:with-param name="argList" select="$nextArgs"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="input">
|
|
||||||
<xsl:param name="name"/>
|
|
||||||
<xsl:param name="value" select=""/>
|
|
||||||
<xsl:param name="asURL" select="false()"/>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$asURL">
|
|
||||||
<xsl:text>-</xsl:text>
|
|
||||||
<xsl:value-of select="$name"/>
|
|
||||||
<xsl:text>=</xsl:text>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>
|
|
||||||
<xsl:otherwise>on</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:text>&</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<input type="hidden" name="-{$name}">
|
|
||||||
<xsl:attribute name="value">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>
|
|
||||||
<xsl:otherwise>on</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:attribute>
|
|
||||||
</input>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
@ -4,6 +4,8 @@
|
|||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
version="1.1">
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:import href="parseCommand.xsl"/>
|
||||||
|
|
||||||
<xsl:output method="html" encoding="UTF-8"/>
|
<xsl:output method="html" encoding="UTF-8"/>
|
||||||
<xsl:output indent="yes"/>
|
<xsl:output indent="yes"/>
|
||||||
<xsl:strip-space elements='*'/>
|
<xsl:strip-space elements='*'/>
|
||||||
@ -40,7 +42,7 @@
|
|||||||
<xsl:text>/scan.php?targets=</xsl:text>
|
<xsl:text>/scan.php?targets=</xsl:text>
|
||||||
<xsl:value-of select="$targets"/>
|
<xsl:value-of select="$targets"/>
|
||||||
<xsl:text>&</xsl:text>
|
<xsl:text>&</xsl:text>
|
||||||
<xsl:call-template name="optionsList">
|
<xsl:call-template name="parseCommand">
|
||||||
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
||||||
<xsl:with-param name="asURL" select="true()"/>
|
<xsl:with-param name="asURL" select="true()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@ -79,7 +81,7 @@
|
|||||||
<xsl:text>can</xsl:text>
|
<xsl:text>can</xsl:text>
|
||||||
</a>
|
</a>
|
||||||
<form id="lanScanForm" class="right menu">
|
<form id="lanScanForm" class="right menu">
|
||||||
<xsl:call-template name="optionsList">
|
<xsl:call-template name="parseCommand">
|
||||||
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
||||||
<xsl:with-param name="asURL" select="false()"/>
|
<xsl:with-param name="asURL" select="false()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@ -402,92 +404,4 @@ function hostScanning(link) {
|
|||||||
</a>
|
</a>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="optionsList">
|
|
||||||
<xsl:param name="argList" select=""/>
|
|
||||||
<xsl:param name="asURL" select="false()"/>
|
|
||||||
<xsl:variable name="nextArgs" select="substring-after($argList, ' -')"/>
|
|
||||||
<xsl:variable name="argAndValue">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$nextArgs">
|
|
||||||
<xsl:value-of select="substring-before($argList, ' -')"/>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise><xsl:value-of select="$argList"/></xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="starts-with($argAndValue, '-')">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="contains($argAndValue, ' ')">
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring-before($argAndValue, ' ')"/>
|
|
||||||
<xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="$argAndValue"/>
|
|
||||||
<xsl:with-param name="value" select="on"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="starts-with($argAndValue, 'P') or starts-with($argAndValue, 's') or starts-with($argAndValue, 'o')">
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring($argAndValue, 1, 2)"/>
|
|
||||||
<xsl:with-param name="value" select="substring($argAndValue, 3)"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring($argAndValue, 1, 1)"/>
|
|
||||||
<xsl:with-param name="value" select="substring($argAndValue, 2)"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
|
|
||||||
<xsl:if test="$nextArgs">
|
|
||||||
<xsl:call-template name="optionsList">
|
|
||||||
<xsl:with-param name="argList" select="$nextArgs"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="input">
|
|
||||||
<xsl:param name="name"/>
|
|
||||||
<xsl:param name="value" select=""/>
|
|
||||||
<xsl:param name="asURL" select="false()"/>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$asURL">
|
|
||||||
<xsl:text>-</xsl:text>
|
|
||||||
<xsl:value-of select="$name"/>
|
|
||||||
<xsl:text>=</xsl:text>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>
|
|
||||||
<xsl:otherwise>on</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:text>&</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<input type="hidden" name="-{$name}">
|
|
||||||
<xsl:attribute name="value">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>
|
|
||||||
<xsl:otherwise>on</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:attribute>
|
|
||||||
</input>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
105
templates/parseCommand.xsl
Normal file
105
templates/parseCommand.xsl
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xsl:stylesheet
|
||||||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:template name="parseCommand">
|
||||||
|
<xsl:param name="argList" select=""/>
|
||||||
|
<xsl:param name="asURL" select="false()"/>
|
||||||
|
<xsl:variable name="nextArgs" select="substring-after($argList, ' -')"/>
|
||||||
|
<xsl:variable name="argAndValue">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$nextArgs">
|
||||||
|
<xsl:value-of select="substring-before($argList, ' -')"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise><xsl:value-of select="$argList"/></xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="starts-with($argAndValue, '-')">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="contains($argAndValue, ' ')">
|
||||||
|
<xsl:call-template name="input">
|
||||||
|
<xsl:with-param name="name" select="substring-before($argAndValue, ' ')"/>
|
||||||
|
<xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/>
|
||||||
|
<xsl:with-param name="asURL" select="$asURL"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:call-template name="input">
|
||||||
|
<xsl:with-param name="name" select="$argAndValue"/>
|
||||||
|
<xsl:with-param name="value" select="on"/>
|
||||||
|
<xsl:with-param name="asURL" select="$asURL"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="starts-with($argAndValue, 'P') or starts-with($argAndValue, 's') or starts-with($argAndValue, 'o')">
|
||||||
|
<xsl:call-template name="input">
|
||||||
|
<xsl:with-param name="name" select="substring($argAndValue, 1, 2)"/>
|
||||||
|
<xsl:with-param name="value" select="substring($argAndValue, 3)"/>
|
||||||
|
<xsl:with-param name="asURL" select="$asURL"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:call-template name="input">
|
||||||
|
<xsl:with-param name="name" select="substring($argAndValue, 1, 1)"/>
|
||||||
|
<xsl:with-param name="value" select="substring($argAndValue, 2)"/>
|
||||||
|
<xsl:with-param name="asURL" select="$asURL"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
|
||||||
|
<xsl:if test="$nextArgs">
|
||||||
|
<xsl:call-template name="parseCommand">
|
||||||
|
<xsl:with-param name="argList" select="$nextArgs"/>
|
||||||
|
<xsl:with-param name="asURL" select="$asURL"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template name="input">
|
||||||
|
<xsl:param name="name"/>
|
||||||
|
<xsl:param name="value" select=""/>
|
||||||
|
<xsl:param name="asURL" select="false()"/>
|
||||||
|
<xsl:variable name="valueWithoutQuotes">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="substring-after($value, '"')">
|
||||||
|
<xsl:value-of select="substring-before(substring-after($value, '"'), '"')"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="$value"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$asURL">
|
||||||
|
<xsl:text>-</xsl:text>
|
||||||
|
<xsl:value-of select="$name"/>
|
||||||
|
<xsl:text>=</xsl:text>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$valueWithoutQuotes"><xsl:value-of select="$valueWithoutQuotes"/></xsl:when>
|
||||||
|
<xsl:otherwise>on</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:text>&</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<input type="hidden" name="-{$name}">
|
||||||
|
<xsl:attribute name="value">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$valueWithoutQuotes"><xsl:value-of select="$valueWithoutQuotes"/></xsl:when>
|
||||||
|
<xsl:otherwise>on</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:attribute>
|
||||||
|
</input>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
@ -4,6 +4,8 @@
|
|||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
version="1.1">
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:import href="parseCommand.xsl"/>
|
||||||
|
|
||||||
<xsl:output method="html" encoding="UTF-8"/>
|
<xsl:output method="html" encoding="UTF-8"/>
|
||||||
<xsl:output indent="yes"/>
|
<xsl:output indent="yes"/>
|
||||||
<xsl:strip-space elements='*'/>
|
<xsl:strip-space elements='*'/>
|
||||||
@ -40,7 +42,7 @@
|
|||||||
<xsl:text>/scan.php?targets=</xsl:text>
|
<xsl:text>/scan.php?targets=</xsl:text>
|
||||||
<xsl:value-of select="$targets"/>
|
<xsl:value-of select="$targets"/>
|
||||||
<xsl:text>&</xsl:text>
|
<xsl:text>&</xsl:text>
|
||||||
<xsl:call-template name="optionsList">
|
<xsl:call-template name="parseCommand">
|
||||||
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
||||||
<xsl:with-param name="asURL" select="true()"/>
|
<xsl:with-param name="asURL" select="true()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@ -79,7 +81,7 @@
|
|||||||
<xsl:text>can</xsl:text>
|
<xsl:text>can</xsl:text>
|
||||||
</a>
|
</a>
|
||||||
<form id="lanScanForm" class="right menu" onsubmit="targetsInputDiv.classList.add('loading')">
|
<form id="lanScanForm" class="right menu" onsubmit="targetsInputDiv.classList.add('loading')">
|
||||||
<xsl:call-template name="optionsList">
|
<xsl:call-template name="parseCommand">
|
||||||
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
|
||||||
<xsl:with-param name="asURL" select="false()"/>
|
<xsl:with-param name="asURL" select="false()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@ -362,92 +364,4 @@ function hostScanning(link) {
|
|||||||
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="optionsList">
|
|
||||||
<xsl:param name="argList" select=""/>
|
|
||||||
<xsl:param name="asURL" select="false()"/>
|
|
||||||
<xsl:variable name="nextArgs" select="substring-after($argList, ' -')"/>
|
|
||||||
<xsl:variable name="argAndValue">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$nextArgs">
|
|
||||||
<xsl:value-of select="substring-before($argList, ' -')"/>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise><xsl:value-of select="$argList"/></xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="starts-with($argAndValue, '-')">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="contains($argAndValue, ' ')">
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring-before($argAndValue, ' ')"/>
|
|
||||||
<xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="$argAndValue"/>
|
|
||||||
<xsl:with-param name="value" select="on"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="starts-with($argAndValue, 'P') or starts-with($argAndValue, 's') or starts-with($argAndValue, 'o')">
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring($argAndValue, 1, 2)"/>
|
|
||||||
<xsl:with-param name="value" select="substring($argAndValue, 3)"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="input">
|
|
||||||
<xsl:with-param name="name" select="substring($argAndValue, 1, 1)"/>
|
|
||||||
<xsl:with-param name="value" select="substring($argAndValue, 2)"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
|
|
||||||
<xsl:if test="$nextArgs">
|
|
||||||
<xsl:call-template name="optionsList">
|
|
||||||
<xsl:with-param name="argList" select="$nextArgs"/>
|
|
||||||
<xsl:with-param name="asURL" select="$asURL"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="input">
|
|
||||||
<xsl:param name="name"/>
|
|
||||||
<xsl:param name="value" select=""/>
|
|
||||||
<xsl:param name="asURL" select="false()"/>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$asURL">
|
|
||||||
<xsl:text>-</xsl:text>
|
|
||||||
<xsl:value-of select="$name"/>
|
|
||||||
<xsl:text>=</xsl:text>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>
|
|
||||||
<xsl:otherwise>on</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:text>&</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<input type="hidden" name="-{$name}">
|
|
||||||
<xsl:attribute name="value">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>
|
|
||||||
<xsl:otherwise>on</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:attribute>
|
|
||||||
</input>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
Reference in New Issue
Block a user