finished firewall options

This commit is contained in:
Adrien MALINGREY 2025-02-11 18:02:40 +01:00
parent 849c922d89
commit 009b2b3c2f
4 changed files with 1015 additions and 1016 deletions

File diff suppressed because it is too large Load Diff

View File

@ -97,7 +97,7 @@ if ($preset && isset($PRESETS[$preset])) {
'-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,
@ -114,7 +114,7 @@ if ($preset && isset($PRESETS[$preset])) {
$inputs = array_merge($COMMONOPTIONS, $inputs); $inputs = array_merge($COMMONOPTIONS, $inputs);
$inputs['--stylesheet'] = "$BASEDIR/$STYLESHEETSDIR/{$inputs['--stylesheet']}?"; $inputs['--stylesheet'] = "$BASEDIR/$STYLESHEETSDIR/{$inputs['--stylesheet']}?";
if($name) $inputs['--stylesheet'] .= "name=$name"; if ($name) $inputs['--stylesheet'] .= "name=$name";
$options = ""; $options = "";
foreach ($inputs as $option => $value) { foreach ($inputs as $option => $value) {

View File

@ -11,18 +11,14 @@
<xsl:output indent="yes" /> <xsl:output indent="yes" />
<xsl:strip-space elements='*' /> <xsl:strip-space elements='*' />
<xsl:variable name="stylesheetURL" <xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'), '?')" />
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'), '?')" />
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" /> <xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
<xsl:variable name="name" <xsl:variable name="name" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '&quot;')" />
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '&quot;')" />
<xsl:template match="nmaprun"> <xsl:template match="nmaprun">
<xsl:variable name="target" select="substring-after(@args, '-oX - ')" /> <xsl:variable name="target" select="substring-after(@args, '-oX - ')" />
<xsl:variable <xsl:variable name="current" select="." />
name="current" select="." /> <xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
<xsl:variable name="init"
select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
<html lang="fr"> <html lang="fr">
<xsl:apply-templates select="." mode="head"> <xsl:apply-templates select="." mode="head">
@ -38,415 +34,393 @@
</xsl:apply-templates> </xsl:apply-templates>
<main class="ui main container inverted segment"> <main class="ui main container inverted segment">
<xsl:apply-templates <xsl:apply-templates select="$current/host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
select="$current/host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
<xsl:with-param name="init" select="$init" /> <xsl:with-param name="init" select="$init" />
<xsl:with-param name="current" select="$current" /> <xsl:with-param name="current" select="$current" />
</xsl:apply-templates> </xsl:apply-templates>
</main> </main>
<footer class="ui footer inverted segment"> Résultat de la commande :<br /> <footer class="ui footer inverted segment"> Résultat de la commande :<br />
<code> <code>
<xsl:value-of select="@args" /> <xsl:value-of select="@args" />
</code> </code>
</footer> </footer>
<script src="script.js"></script> <script src="script.js"></script>
<script> <script>
$('.ui.tree.accordion').accordion() $('.ui.tree.accordion').accordion()
$('.ui.dropdown').dropdown() $('.ui.dropdown').dropdown()
</script> </script>
<xsl:apply-templates select="runstats"> <xsl:apply-templates select="runstats">
<xsl:with-param name="init" select="$init" /> <xsl:with-param name="init" select="$init" />
</xsl:apply-templates> </xsl:apply-templates>
</body> </body>
</html> </html>
</xsl:template> </xsl:template>
<xsl:template match="host"> <xsl:template match="host">
<xsl:param name="init" /> <xsl:param name="init" />
<xsl:param name="current" /> <xsl:param name="current" />
<xsl:variable name="addr" <xsl:variable name="addr" select="address/@addr" />
select="address/@addr" /> <xsl:variable name="initHost" select="$init/host[address/@addr=$addr]" />
<xsl:variable name="initHost" <xsl:variable name="currentHost" select="$current/host[address/@addr=$addr]" />
select="$init/host[address/@addr=$addr]" /> <xsl:variable name="hostAddress">
<xsl:variable name="currentHost" <xsl:choose>
select="$current/host[address/@addr=$addr]" /> <xsl:when test="hostnames/hostname/@name">
<xsl:variable name="hostAddress"> <xsl:value-of select="hostnames/hostname/@name" />
<xsl:choose> </xsl:when>
<xsl:when test="hostnames/hostname/@name"> <xsl:otherwise>
<xsl:value-of select="hostnames/hostname/@name" /> <xsl:value-of select="address/@addr" />
</xsl:when> </xsl:otherwise>
<xsl:otherwise> </xsl:choose>
<xsl:value-of select="address/@addr" /> </xsl:variable>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<h1 <h1 class="ui header">
class="ui header"> <div>
<div> <xsl:attribute name="class">
<xsl:attribute name="class"> <xsl:text>ui horizontal label </xsl:text>
<xsl:text>ui horizontal label </xsl:text> <xsl:choose>
<xsl:when test="$currentHost/status/@state='up'">green</xsl:when>
<xsl:otherwise>red</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="$currentHost/status/@state" />
</div>
<xsl:choose>
<xsl:when test="hostnames/hostname/@name">
<xsl:value-of select="hostnames/hostname/@name" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="address/@addr" />
</xsl:otherwise>
</xsl:choose>
</h1>
<table class="ui inverted table" style="width: max-content">
<thead>
<tr>
<xsl:if test="address[@addrtype='ipv4']/@addr">
<th>Adresse IPv4</th>
</xsl:if>
<xsl:if test="address[@addrtype='mac']/@addr">
<th>Adresse MAC</th>
</xsl:if>
<xsl:if test="address/@vendor">
<th>Constructeur</th>
</xsl:if>
<xsl:if test="os/osmatch/@name">
<th>OS</th>
</xsl:if>
<xsl:if test="distance/@value">
<th>Distance</th>
</xsl:if>
<xsl:if test="uptime/@lastboot">
<th>Dernier redémarrage</th>
</xsl:if>
</tr>
</thead>
<tbody>
<tr>
<xsl:if test="address[@addrtype='ipv4']/@addr">
<td>
<xsl:value-of select="address[@addrtype='ipv4']/@addr" />
</td>
</xsl:if>
<xsl:if test="address[@addrtype='mac']/@addr">
<td>
<xsl:value-of select="address[@addrtype='mac']/@addr" />
</td>
</xsl:if>
<xsl:if test="address/@vendor">
<td>
<xsl:value-of select="address/@vendor" />
</td>
</xsl:if>
<xsl:if test="os/osmatch/@name">
<td>
<abbr title="Confiance : {os/osmatch/@accuracy}%">
<xsl:value-of select="os/osmatch/@name" />
</abbr>
</td>
</xsl:if>
<xsl:if test="distance/@value">
<td>
<xsl:value-of select="distance/@value" />
<xsl:text> étape(s)</xsl:text>
</td>
</xsl:if>
<xsl:if test="uptime/@lastboot">
<td>
<xsl:value-of select="uptime/@lastboot" />
</td>
</xsl:if>
</tr>
</tbody>
</table>
<xsl:if test="hostscript/script">
<div class="ui inverted tree accordion">
<div class="title">
<i class="dropdown icon"></i> Informations supplémentaires </div>
<div class="content">
<xsl:apply-templates select="hostscript/script" />
</div>
</div>
</xsl:if>
<h2 class="ui header">Services</h2>
<div class="ui inverted two small cards">
<xsl:apply-templates select="$currentHost/ports/port[not(state/@state='closed')] | $initHost/ports/port[not(state/@state='closed')][not(@portid=$currentHost/ports/port/@portid)]">
<xsl:with-param name="initHost" select="$initHost" />
<xsl:with-param name="currentHost" select="$currentHost" />
<xsl:with-param name="hostAddress" select="$hostAddress" />
</xsl:apply-templates>
</div>
<xsl:apply-templates select="trace" />
</xsl:template>
<xsl:template match="port">
<xsl:param name="hostAddress" />
<xsl:param name="initHost" />
<xsl:param name="currentHost" />
<xsl:variable name="portid" select="@portid" />
<xsl:variable name="initPort" select="$initHost/ports/port[@portid=$portid]" />
<xsl:variable name="currentPort" select="$currentHost/ports/port[@portid=$portid]" />
<xsl:variable name="color">
<xsl:choose>
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=500">red</xsl:when>
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=400">orange</xsl:when>
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=200">green</xsl:when>
<xsl:when test="$currentPort/state/@state='open'">green</xsl:when>
<xsl:when test="$currentPort/state/@state='filtered'">orange</xsl:when>
<xsl:otherwise>red</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div class="ui card {$color}">
<div class="content">
<div class="header">
<div class="ui {$color} right floated label" title="{state/@state}">
<div class="detail" style="text-transform: uppercase">
<xsl:value-of select="@protocol" />
<xsl:text>:</xsl:text>
</div>
<xsl:value-of select="@portid" />
</div>
<xsl:value-of select="service/@name" />
<xsl:if test="service/@tunnel">
<span>
<xsl:text>/</xsl:text>
<xsl:value-of select="service/@tunnel" />
</span>
</xsl:if>
</div>
<div class="meta">
<xsl:if test="service/@product">
<span>
<xsl:value-of select="service/@product" />
</span>
</xsl:if>
<xsl:if test="service/@version">
<span>
<xsl:text>v</xsl:text>
<xsl:value-of select="service/@version" />
</span>
</xsl:if>
<xsl:if test="service/@extrainfo">
<span>
<xsl:value-of select="service/@extrainfo" />
</span>
</xsl:if>
<div class="description">
<xsl:if test="script">
<div class="ui inverted tree accordion">
<div class="title">
<i class="dropdown icon"></i> Détails </div>
<div class="content">
<xsl:apply-templates select="script" />
</div>
</div>
</xsl:if>
</div>
</div>
</div>
<xsl:if test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https' or service/@name='ms-wbt-server'">
<a class="ui {$color} button" target="_blank">
<xsl:attribute name="href">
<xsl:choose> <xsl:choose>
<xsl:when test="$currentHost/status/@state='up'">green</xsl:when> <xsl:when test="service/@name='ms-wbt-server'">
<xsl:otherwise>red</xsl:otherwise> <xsl:text>rdp.php?v=</xsl:text>
<xsl:value-of select="$hostAddress" />
<xsl:text>&amp;p=</xsl:text>
<xsl:value-of select="@portid" />
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="service/@name='http' and service/@tunnel='ssl'">
<xsl:text>https</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="service/@name" />
</xsl:otherwise>
</xsl:choose>
<xsl:text>://</xsl:text>
<xsl:value-of select="$hostAddress" />
<xsl:text>:</xsl:text>
<xsl:value-of select="@portid" />
</xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="$currentHost/status/@state" /> <i class="external alternate icon"></i>
</div> <xsl:text>Ouvrir</xsl:text>
<xsl:choose> </a>
<xsl:when test="hostnames/hostname/@name"> </xsl:if>
<xsl:value-of select="hostnames/hostname/@name" /> <xsl:if test="$currentPort/script[@id='smb-shares-size']/table">
</xsl:when> <div class="ui {$color} center aligned dropdown share-size button">
<xsl:otherwise> <xsl:attribute name="style">
<xsl:value-of select="address/@addr" /> <xsl:for-each select="$currentPort/script[@id='smb-shares-size']/table">
</xsl:otherwise> <xsl:sort select="elem[@key='FreeSize'] div elem[@key='TotalSize']" order="ascending" />
</xsl:choose> <xsl:if test="position()=1">
</h1> <xsl:text>--free: </xsl:text>
<xsl:value-of select="elem[@key='FreeSize']" />
<table <xsl:text>; --total: </xsl:text>
class="ui inverted table" style="width: max-content"> <xsl:value-of select="elem[@key='TotalSize']" />
<thead> </xsl:if>
<tr> </xsl:for-each>
<xsl:if test="address[@addrtype='ipv4']/@addr"> </xsl:attribute>
<th>Adresse IPv4</th> <i class="external alternate icon"></i>
</xsl:if> <xsl:text>Ouvrir</xsl:text>
<xsl:if test="address[@addrtype='mac']/@addr"> <i class="dropdown icon"></i>
<th>Adresse MAC</th> <div class="menu">
</xsl:if> <xsl:apply-templates select="$currentPort/script[@id='smb-shares-size']/table">
<xsl:if test="address/@vendor"> <xsl:with-param name="hostAddress" select="$hostAddress" />
<th>Constructeur</th> </xsl:apply-templates>
</xsl:if>
<xsl:if test="os/osmatch/@name">
<th>OS</th>
</xsl:if>
<xsl:if test="distance/@value">
<th>Distance</th>
</xsl:if>
<xsl:if test="uptime/@lastboot">
<th>Dernier redémarrage</th>
</xsl:if>
</tr>
</thead>
<tbody>
<tr>
<xsl:if test="address[@addrtype='ipv4']/@addr">
<td>
<xsl:value-of select="address[@addrtype='ipv4']/@addr" />
</td>
</xsl:if>
<xsl:if test="address[@addrtype='mac']/@addr">
<td>
<xsl:value-of select="address[@addrtype='mac']/@addr" />
</td>
</xsl:if>
<xsl:if test="address/@vendor">
<td>
<xsl:value-of select="address/@vendor" />
</td>
</xsl:if>
<xsl:if test="os/osmatch/@name">
<td>
<abbr title="Confiance : {os/osmatch/@accuracy}%">
<xsl:value-of select="os/osmatch/@name" />
</abbr>
</td>
</xsl:if>
<xsl:if test="distance/@value">
<td>
<xsl:value-of select="distance/@value" />
<xsl:text> étape(s)</xsl:text>
</td>
</xsl:if>
<xsl:if test="uptime/@lastboot">
<td>
<xsl:value-of select="uptime/@lastboot" />
</td>
</xsl:if>
</tr>
</tbody>
</table>
<xsl:if
test="hostscript/script">
<div class="ui inverted tree accordion">
<div class="title">
<i class="dropdown icon"></i> Informations supplémentaires </div>
<div class="content">
<xsl:apply-templates select="hostscript/script" />
</div> </div>
</div> </div>
</xsl:if> </xsl:if>
</div>
<h2 </xsl:template>
class="ui header">Services</h2>
<div class="ui cards"> <xsl:template match="script">
<xsl:apply-templates <div class="ui inverted accordion">
select="$currentHost/ports/port[not(state/@state='closed')] | $initHost/ports/port[not(state/@state='closed')][not(@portid=$currentHost/ports/port/@portid)]"> <div class="title">
<xsl:with-param name="initHost" select="$initHost" /> <i class="dropdown icon"></i>
<xsl:with-param name="currentHost" select="$currentHost" /> <xsl:value-of select="@id" />
<xsl:with-param name="hostAddress" select="$hostAddress" />
</xsl:apply-templates>
</div> </div>
<div class="content">
<xsl:apply-templates
select="trace" />
</xsl:template>
<xsl:template match="port">
<xsl:param name="hostAddress" />
<xsl:param name="initHost" />
<xsl:param name="currentHost" />
<xsl:variable
name="portid" select="@portid" />
<xsl:variable name="initPort"
select="$initHost/ports/port[@portid=$portid]" />
<xsl:variable name="currentPort"
select="$currentHost/ports/port[@portid=$portid]" />
<xsl:variable name="color">
<xsl:choose> <xsl:choose>
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=500">red</xsl:when> <xsl:when test="elem or table">
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=400">orange</xsl:when> <xsl:if test="elem">
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=200">green</xsl:when> <table class="ui small compact inverted fixed definition table">
<xsl:when test="$currentPort/state/@state='open'">green</xsl:when> <tbody>
<xsl:when test="$currentPort/state/@state='filtered'">orange</xsl:when> <xsl:apply-templates select="elem" />
<xsl:otherwise>red</xsl:otherwise> </tbody>
</table>
</xsl:if>
<xsl:apply-templates select="table" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@output" />
</xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </div>
</div>
</xsl:template>
<div <xsl:template match="table">
class="ui inverted card {$color}"> <xsl:choose>
<div class="content"> <xsl:when test="@key">
<div class="header"> <div class="ui inverted accordion">
<div class="ui {$color} ribbon label" title="{state/@state}"> <div class="title">
<div class="detail" style="text-transform: uppercase">
<xsl:value-of select="@protocol" />
<xsl:text>:</xsl:text>
</div>
<xsl:value-of select="@portid" />
</div>
<xsl:value-of select="service/@name" />
<xsl:if test="service/@tunnel">
<span>
<xsl:text>/</xsl:text>
<xsl:value-of select="service/@tunnel" />
</span>
</xsl:if>
</div>
<div class="meta">
<xsl:if test="service/@product">
<span>
<xsl:value-of select="service/@product" />
</span>
</xsl:if>
<xsl:if test="service/@version">
<span>
<xsl:text>v</xsl:text>
<xsl:value-of select="service/@version" />
</span>
</xsl:if>
<xsl:if test="service/@extrainfo">
<span>
<xsl:value-of select="service/@extrainfo" />
</span>
</xsl:if>
<div class="description">
<xsl:if test="script">
<div class="ui inverted tree accordion">
<div class="title">
<i class="dropdown icon"></i> Détails </div>
<div class="content">
<xsl:apply-templates select="script" />
</div>
</div>
</xsl:if>
</div>
</div>
</div>
<xsl:if
test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https' or service/@name='ms-wbt-server'">
<a class="ui {$color} button" target="_blank">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="service/@name='ms-wbt-server'">
<xsl:text>rdp.php?v=</xsl:text>
<xsl:value-of select="$hostAddress" />
<xsl:text>&amp;p=</xsl:text>
<xsl:value-of
select="@portid" />
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="service/@name='http' and service/@tunnel='ssl'">
<xsl:text>https</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="service/@name" />
</xsl:otherwise>
</xsl:choose>
<xsl:text>://</xsl:text>
<xsl:value-of
select="$hostAddress" />
<xsl:text>:</xsl:text>
<xsl:value-of select="@portid" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<i class="external alternate icon"></i>
<xsl:text>Ouvrir</xsl:text>
</a>
</xsl:if>
<xsl:if test="$currentPort/script[@id='smb-shares-size']/table">
<div class="ui {$color} center aligned dropdown share-size button">
<xsl:attribute name="style">
<xsl:for-each select="$currentPort/script[@id='smb-shares-size']/table">
<xsl:sort select="elem[@key='FreeSize'] div elem[@key='TotalSize']" order="ascending" />
<xsl:if
test="position()=1">
<xsl:text>--free: </xsl:text>
<xsl:value-of select="elem[@key='FreeSize']" />
<xsl:text>; --total: </xsl:text>
<xsl:value-of
select="elem[@key='TotalSize']" />
</xsl:if>
</xsl:for-each>
</xsl:attribute>
<i class="external alternate icon"></i>
<xsl:text>Ouvrir</xsl:text>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu"> <xsl:value-of select="@key" />
<xsl:apply-templates select="$currentPort/script[@id='smb-shares-size']/table">
<xsl:with-param name="hostAddress" select="$hostAddress" />
</xsl:apply-templates>
</div>
</div> </div>
</xsl:if> <div class="content">
</div> <xsl:if test="elem">
<table class="ui small compact inverted fixed definition table">
</xsl:template> <tbody>
<xsl:apply-templates select="elem" />
<xsl:template match="script"> </tbody>
<div class="ui inverted accordion"> </table>
<div class="title"> </xsl:if>
<i class="dropdown icon"></i> <xsl:apply-templates select="table" />
<xsl:value-of select="@id" />
</div>
<div class="content">
<xsl:choose>
<xsl:when test="elem or table">
<xsl:if test="elem">
<table class="ui small compact inverted fixed definition table">
<tbody>
<xsl:apply-templates select="elem" />
</tbody>
</table>
</xsl:if>
<xsl:apply-templates
select="table" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@output" />
</xsl:otherwise>
</xsl:choose>
</div>
</div>
</xsl:template>
<xsl:template match="table">
<xsl:choose>
<xsl:when test="@key">
<div class="ui inverted accordion">
<div class="title">
<i class="dropdown icon"></i>
<xsl:value-of select="@key" />
</div>
<div class="content">
<xsl:if test="elem">
<table class="ui small compact inverted fixed definition table">
<tbody>
<xsl:apply-templates select="elem" />
</tbody>
</table>
</xsl:if>
<xsl:apply-templates select="table" />
</div>
</div> </div>
</xsl:when> </div>
<xsl:when test="elem"> </xsl:when>
<table class="ui small compact inverted fixed definition table"> <xsl:when test="elem">
<tbody> <table class="ui small compact inverted fixed definition table">
<xsl:apply-templates select="elem" /> <tbody>
</tbody> <xsl:apply-templates select="elem" />
</table> </tbody>
</xsl:when> </table>
</xsl:choose> </xsl:when>
</xsl:template> </xsl:choose>
</xsl:template>
<xsl:template match="elem"> <xsl:template match="elem">
<tr> <tr>
<td style="width: min-content"> <td style="width: min-content">
<xsl:value-of select="@key" />
</td>
<td>
<xsl:value-of select="." />
</td>
</tr>
</xsl:template>
<xsl:template match="table">
<xsl:param name="hostAddress" />
<a class="item share-size"
href="file://///{$hostAddress}/{@key}" target="_blank" rel="noopener noreferrer"
style="--free: {elem[@key='FreeSize']}; --total: {elem[@key='TotalSize']}">
<xsl:value-of select="@key" /> <xsl:value-of select="@key" />
</a> </td>
</xsl:template> <td>
<xsl:value-of select="." />
</td>
</tr>
</xsl:template>
<xsl:template match="table">
<xsl:param name="hostAddress" />
<a class="item share-size" href="file://///{$hostAddress}/{@key}" target="_blank" rel="noopener noreferrer" style="--free: {elem[@key='FreeSize']}; --total: {elem[@key='TotalSize']}">
<xsl:value-of select="@key" />
</a>
</xsl:template>
<xsl:template match="trace"> <xsl:template match="trace">
<h2 class="ui header">Traceroute</h2> <h2 class="ui header">Traceroute</h2>
<table class="ui inverted table"> <table class="ui inverted table">
<thead> <thead>
<tr> <tr>
<th>Étape</th> <th>Étape</th>
<th>Adresse</th> <th>Adresse</th>
<th>Temps</th> <th>Temps</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<xsl:apply-templates select="hop" /> <xsl:apply-templates select="hop" />
</tbody> </tbody>
</table> </table>
</xsl:template> </xsl:template>
<xsl:template match="hop"> <xsl:template match="hop">
<tr> <tr>
<td> <td>
<xsl:value-of select="@ttl" /> <xsl:value-of select="@ttl" />
</td> </td>
<td> <td>
<xsl:choose> <xsl:choose>
<xsl:when test="@host"> <xsl:when test="@host">
<xsl:value-of select="@host" /> <xsl:value-of select="@host" />
<xsl:text> (</xsl:text> <xsl:text> (</xsl:text>
<xsl:value-of select="@ipaddr" /> <xsl:value-of select="@ipaddr" />
<xsl:text>)</xsl:text> <xsl:text>)</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="@ipaddr" /> <xsl:value-of select="@ipaddr" />
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</td> </td>
<td> <td>
<xsl:value-of select="@rtt" /> <xsl:value-of select="@rtt" />
<xsl:text> ms</xsl:text> <xsl:text> ms</xsl:text>
</td> </td>
</tr> </tr>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -55,14 +55,14 @@
class="ui sortable small compact stuck striped table"> class="ui sortable small compact stuck striped table">
<thead> <thead>
<tr> <tr>
<th style="width: min-width">État</th> <th style="width: min-content">État</th>
<th>Adresse IP</th> <th>Adresse IP</th>
<th>Nom</th> <th>Nom</th>
<xsl:if test="host/address[@addrtype='mac']/@vendor"> <xsl:if test="host/address[@addrtype='mac']/@vendor">
<th>Constructeur</th> <th>Constructeur</th>
</xsl:if> </xsl:if>
<th class="six wide">Services</th> <th class="six wide">Services</th>
<th style="width: min-width" title="Scan intensif"> <th style="width: min-content" title="Scan intensif">
<i class="search plus icon"></i> <i class="search plus icon"></i>
</th> </th>
</tr> </tr>
@ -197,7 +197,7 @@ $('.ui.dropdown').dropdown()
<xsl:sort select="number(@portid)" order="ascending" /> <xsl:sort select="number(@portid)" order="ascending" />
</xsl:apply-templates> </xsl:apply-templates>
</td> </td>
<td> <td style="width: min-content">
<a class="ui mini icon teal icon button" target="_blank" title="Scan intensif"> <a class="ui mini icon teal icon button" target="_blank" title="Scan intensif">
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:text>scan.php?target=</xsl:text> <xsl:text>scan.php?target=</xsl:text>