stylesheets
This commit is contained in:
		
							
								
								
									
										39
									
								
								options.php
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								options.php
									
									
									
									
									
								
							@ -3,7 +3,7 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="fr">
 | 
			
		||||
 | 
			
		||||
  <head>
 | 
			
		||||
<head>
 | 
			
		||||
  <meta charset="utf-8" />
 | 
			
		||||
  <title>lanScan</title>
 | 
			
		||||
  <link rel="icon" href="favicon.ico" />
 | 
			
		||||
@ -15,9 +15,9 @@
 | 
			
		||||
  <script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.polyfills.min.js"></script>
 | 
			
		||||
  <link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.css" rel="stylesheet" type="text/css" />
 | 
			
		||||
  <link href="style.css" rel="stylesheet" type="text/css" />
 | 
			
		||||
  </head>
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
  <body class="inverted">
 | 
			
		||||
<body class="inverted">
 | 
			
		||||
  <nav class="ui inverted secondary menu">
 | 
			
		||||
    <a href="." class="ui header button item logo">lan<?php include 'logo.svg'; ?>can</a>
 | 
			
		||||
    <div class="right menu">
 | 
			
		||||
@ -33,7 +33,7 @@
 | 
			
		||||
    </div>
 | 
			
		||||
  </nav>
 | 
			
		||||
 | 
			
		||||
    <main class="ui main container">
 | 
			
		||||
  <main class="ui main text container">
 | 
			
		||||
 | 
			
		||||
    <h1 class="ui inverted header">Scanner un réseau</h1>
 | 
			
		||||
 | 
			
		||||
@ -552,29 +552,10 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
 | 
			
		||||
                <label for="fInput" title="-f">Fragmentation des paquets</label>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
              <div class="inverted field">
 | 
			
		||||
                <div class="ui toggle inverted checkbox">
 | 
			
		||||
                  <input id="badsumCheckbox" type="checkbox" name="--badsum">
 | 
			
		||||
                  <label for="badsumCheckbox" title="--badsum">Checksum incorrect</label>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="two inverted fields">
 | 
			
		||||
            <div class="inverted field">
 | 
			
		||||
              <label for="mtuInput" title="--mtu">Taille des paquets</label>
 | 
			
		||||
              <input id="mtuInput" type="number" name="--mtu" min="0">
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
              <div class="inverted field">
 | 
			
		||||
                <label for="dInput" title="-d">Délai entre les paquets</label>
 | 
			
		||||
                <input id="dInput" type="number" name="-d" min="0">
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="inverted field">
 | 
			
		||||
              <label for="dataLengthInput" title="--data-length">Longueur des données</label>
 | 
			
		||||
              <input id="dataLengthInput" type="number" name="--data-length" min="0">
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <div class="inverted field">
 | 
			
		||||
@ -594,13 +575,13 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <div class="inverted field">
 | 
			
		||||
              <label for="ttlInput" title="--ttl">Valeur TTL</label>
 | 
			
		||||
              <input id="ttlInput" type="number" name="--ttl" min="0" max="255">
 | 
			
		||||
            <label for="dataLengthInput" title="--data-length">Longueur des données</label>
 | 
			
		||||
            <input id="dataLengthInput" type="number" name="--data-length" min="0">
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <div class="inverted field">
 | 
			
		||||
              <label for="scanDelayInput" title="--scan-delay">Délai entre les scans</label>
 | 
			
		||||
              <input id="scanDelayInput" type="number" name="--scan-delay" min="0">
 | 
			
		||||
            <label for="ttlInput" title="--ttl">Valeur TTL</label>
 | 
			
		||||
            <input id="ttlInput" type="number" name="--ttl" min="0" max="255">
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
@ -741,7 +722,7 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
 | 
			
		||||
    })
 | 
			
		||||
    new TagsInput(DInput)
 | 
			
		||||
 | 
			
		||||
      newScanForm.onsubmit = function (event) {
 | 
			
		||||
    newScanForm.onsubmit = function(event) {
 | 
			
		||||
      if (this.checkValidity()) {
 | 
			
		||||
        newScanForm.classList.add("loading")
 | 
			
		||||
        $.toast({
 | 
			
		||||
@ -760,6 +741,6 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  </script>
 | 
			
		||||
  </body>
 | 
			
		||||
</body>
 | 
			
		||||
 | 
			
		||||
</html>
 | 
			
		||||
@ -11,14 +11,18 @@
 | 
			
		||||
  <xsl:output indent="yes" />
 | 
			
		||||
  <xsl:strip-space elements='*' />
 | 
			
		||||
 | 
			
		||||
  <xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '?')" />
 | 
			
		||||
  <xsl:variable name="stylesheetURL"
 | 
			
		||||
    select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '?')" />
 | 
			
		||||
  <xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
 | 
			
		||||
  <xsl:variable name="name" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '"')" />
 | 
			
		||||
  <xsl:variable name="name"
 | 
			
		||||
    select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '"')" />
 | 
			
		||||
 | 
			
		||||
  <xsl:template match="nmaprun">
 | 
			
		||||
    <xsl:variable name="target" select="substring-after(@args, '-oX - ')" />
 | 
			
		||||
    <xsl:variable name="current" select="." />
 | 
			
		||||
    <xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
 | 
			
		||||
    <xsl:variable
 | 
			
		||||
      name="current" select="." />
 | 
			
		||||
    <xsl:variable name="init"
 | 
			
		||||
      select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
 | 
			
		||||
 | 
			
		||||
    <html lang="fr">
 | 
			
		||||
      <xsl:apply-templates select="." mode="head">
 | 
			
		||||
@ -34,15 +38,17 @@
 | 
			
		||||
        </xsl:apply-templates>
 | 
			
		||||
 | 
			
		||||
        <main class="ui main container inverted segment">
 | 
			
		||||
          <xsl:apply-templates select="$current/host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
 | 
			
		||||
          <xsl:apply-templates
 | 
			
		||||
            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="current" select="$current" />
 | 
			
		||||
          </xsl:apply-templates>
 | 
			
		||||
        </main>
 | 
			
		||||
 | 
			
		||||
        <footer class="ui footer inverted segment">
 | 
			
		||||
            Résultat de la commande :<br/>
 | 
			
		||||
            <code><xsl:value-of select="@args"/></code>
 | 
			
		||||
        <footer class="ui footer inverted segment"> Résultat de la commande :<br />
 | 
			
		||||
            <code>
 | 
			
		||||
            <xsl:value-of select="@args" />
 | 
			
		||||
          </code>
 | 
			
		||||
        </footer>
 | 
			
		||||
 | 
			
		||||
        <script src="script.js"></script>
 | 
			
		||||
@ -62,9 +68,12 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
  <xsl:template match="host">
 | 
			
		||||
    <xsl:param name="init" />
 | 
			
		||||
    <xsl:param name="current" />
 | 
			
		||||
    <xsl:variable name="addr" select="address/@addr" />
 | 
			
		||||
    <xsl:variable name="initHost" select="$init/host[address/@addr=$addr]" />
 | 
			
		||||
    <xsl:variable name="currentHost" select="$current/host[address/@addr=$addr]" />
 | 
			
		||||
    <xsl:variable name="addr"
 | 
			
		||||
      select="address/@addr" />
 | 
			
		||||
    <xsl:variable name="initHost"
 | 
			
		||||
      select="$init/host[address/@addr=$addr]" />
 | 
			
		||||
    <xsl:variable name="currentHost"
 | 
			
		||||
      select="$current/host[address/@addr=$addr]" />
 | 
			
		||||
    <xsl:variable name="hostAddress">
 | 
			
		||||
      <xsl:choose>
 | 
			
		||||
        <xsl:when test="hostnames/hostname/@name">
 | 
			
		||||
@ -76,7 +85,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
      </xsl:choose>
 | 
			
		||||
    </xsl:variable>
 | 
			
		||||
 | 
			
		||||
    <h1 class="ui header">
 | 
			
		||||
    <h1
 | 
			
		||||
      class="ui header">
 | 
			
		||||
      <div>
 | 
			
		||||
        <xsl:attribute name="class">
 | 
			
		||||
          <xsl:text>ui horizontal label </xsl:text>
 | 
			
		||||
@ -97,7 +107,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
      </xsl:choose>
 | 
			
		||||
    </h1>
 | 
			
		||||
 | 
			
		||||
    <table class="ui inverted table" style="width: max-content">
 | 
			
		||||
    <table
 | 
			
		||||
      class="ui inverted table" style="width: max-content">
 | 
			
		||||
      <thead>
 | 
			
		||||
        <tr>
 | 
			
		||||
          <xsl:if test="address[@addrtype='ipv4']/@addr">
 | 
			
		||||
@ -159,7 +170,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
      </tbody>
 | 
			
		||||
    </table>
 | 
			
		||||
 | 
			
		||||
    <xsl:if test="hostscript/script">
 | 
			
		||||
    <xsl:if
 | 
			
		||||
      test="hostscript/script">
 | 
			
		||||
      <div class="ui inverted tree accordion">
 | 
			
		||||
        <div class="title">
 | 
			
		||||
          <i class="dropdown icon"></i> Informations supplémentaires </div>
 | 
			
		||||
@ -169,26 +181,32 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
      </div>
 | 
			
		||||
    </xsl:if>
 | 
			
		||||
 | 
			
		||||
    <h2 class="ui header">Services</h2>
 | 
			
		||||
    <h2
 | 
			
		||||
      class="ui header">Services</h2>
 | 
			
		||||
 | 
			
		||||
    <div class="ui cards">
 | 
			
		||||
      <xsl:apply-templates select="$currentHost/ports/port | $initHost/ports/port[not(@portid=$currentHost/ports/port/@portid)][not(state/@state='closed')]">
 | 
			
		||||
      <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: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="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>
 | 
			
		||||
@ -200,7 +218,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
      </xsl:choose>
 | 
			
		||||
    </xsl:variable>
 | 
			
		||||
 | 
			
		||||
    <div class="ui inverted card {$color}">
 | 
			
		||||
    <div
 | 
			
		||||
      class="ui inverted card {$color}">
 | 
			
		||||
      <div class="content">
 | 
			
		||||
        <div class="header">
 | 
			
		||||
          <div class="ui {$color} ribbon label">
 | 
			
		||||
@ -248,7 +267,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
          </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'">
 | 
			
		||||
      <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>
 | 
			
		||||
@ -256,7 +276,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
                <xsl:text>rdp.php?v=</xsl:text>
 | 
			
		||||
                <xsl:value-of select="$hostAddress" />
 | 
			
		||||
                <xsl:text>&p=</xsl:text>
 | 
			
		||||
                <xsl:value-of select="@portid" />
 | 
			
		||||
                <xsl:value-of
 | 
			
		||||
                  select="@portid" />
 | 
			
		||||
              </xsl:when>
 | 
			
		||||
              <xsl:otherwise>
 | 
			
		||||
                <xsl:choose>
 | 
			
		||||
@ -268,7 +289,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
                  </xsl:otherwise>
 | 
			
		||||
                </xsl:choose>
 | 
			
		||||
                <xsl:text>://</xsl:text>
 | 
			
		||||
                <xsl:value-of select="$hostAddress" />
 | 
			
		||||
                <xsl:value-of
 | 
			
		||||
                  select="$hostAddress" />
 | 
			
		||||
                <xsl:text>:</xsl:text>
 | 
			
		||||
                <xsl:value-of select="@portid" />
 | 
			
		||||
              </xsl:otherwise>
 | 
			
		||||
@ -283,11 +305,13 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
          <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: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:value-of
 | 
			
		||||
                  select="elem[@key='TotalSize']" />
 | 
			
		||||
              </xsl:if>
 | 
			
		||||
            </xsl:for-each>
 | 
			
		||||
          </xsl:attribute>
 | 
			
		||||
@ -321,7 +345,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
                </tbody>
 | 
			
		||||
              </table>
 | 
			
		||||
            </xsl:if>
 | 
			
		||||
            <xsl:apply-templates select="table" />
 | 
			
		||||
            <xsl:apply-templates
 | 
			
		||||
              select="table" />
 | 
			
		||||
          </xsl:when>
 | 
			
		||||
          <xsl:otherwise>
 | 
			
		||||
            <xsl:value-of select="@output" />
 | 
			
		||||
@ -374,7 +399,9 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
 | 
			
		||||
  <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']}">
 | 
			
		||||
    <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>
 | 
			
		||||
 | 
			
		||||
@ -4,20 +4,23 @@
 | 
			
		||||
 | 
			
		||||
  <xsl:import href="lib/head.xsl" />
 | 
			
		||||
  <xsl:import href="lib/nav.xsl" />
 | 
			
		||||
  <xsl:import href="lib/services.xsl" />
 | 
			
		||||
  <xsl:import href="lib/toast.xsl" />
 | 
			
		||||
 | 
			
		||||
  <xsl:output method="html" encoding="UTF-8" indent="yes" />
 | 
			
		||||
  <xsl:strip-space elements='*' />
 | 
			
		||||
 | 
			
		||||
  <xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '?')" />
 | 
			
		||||
  <xsl:variable name="stylesheetURL"
 | 
			
		||||
    select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '?')" />
 | 
			
		||||
  <xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
 | 
			
		||||
  <xsl:variable name="name" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '"')" />
 | 
			
		||||
  <xsl:variable name="name"
 | 
			
		||||
    select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '"')" />
 | 
			
		||||
 | 
			
		||||
  <xsl:template match="nmaprun">
 | 
			
		||||
    <xsl:variable name="target" select="substring-after(@args, '-oX - ')" />
 | 
			
		||||
    <xsl:variable name="current" select="." />
 | 
			
		||||
    <xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
 | 
			
		||||
    <xsl:variable
 | 
			
		||||
      name="current" select="." />
 | 
			
		||||
    <xsl:variable name="init"
 | 
			
		||||
      select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
 | 
			
		||||
 | 
			
		||||
    <html lang="fr">
 | 
			
		||||
      <xsl:apply-templates select="." mode="head">
 | 
			
		||||
@ -48,7 +51,8 @@
 | 
			
		||||
            </xsl:choose>
 | 
			
		||||
          </h1>
 | 
			
		||||
 | 
			
		||||
          <table id="scanResultsTable" style="width:100%" role="grid" class="ui sortable small compact stuck striped table">
 | 
			
		||||
          <table id="scanResultsTable" style="width:100%" role="grid"
 | 
			
		||||
            class="ui sortable small compact stuck striped table">
 | 
			
		||||
            <thead>
 | 
			
		||||
              <tr>
 | 
			
		||||
                <th style="width: min-width">État</th>
 | 
			
		||||
@ -64,7 +68,8 @@
 | 
			
		||||
              </tr>
 | 
			
		||||
            </thead>
 | 
			
		||||
            <tbody>
 | 
			
		||||
              <xsl:apply-templates select="host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
 | 
			
		||||
              <xsl:apply-templates
 | 
			
		||||
                select="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="current" select="$current" />
 | 
			
		||||
              </xsl:apply-templates>
 | 
			
		||||
@ -72,9 +77,10 @@
 | 
			
		||||
          </table>
 | 
			
		||||
        </main>
 | 
			
		||||
 | 
			
		||||
        <footer class="ui footer inverted segment">
 | 
			
		||||
            Résultat de la commande :<br/>
 | 
			
		||||
            <code><xsl:value-of select="@args"/></code>
 | 
			
		||||
        <footer class="ui footer inverted segment">Résultat de la commande :<br />
 | 
			
		||||
            <code>
 | 
			
		||||
            <xsl:value-of select="@args" />
 | 
			
		||||
          </code>
 | 
			
		||||
        </footer>
 | 
			
		||||
 | 
			
		||||
        <script src="script.js"></script>
 | 
			
		||||
@ -121,9 +127,12 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
  <xsl:template match="host">
 | 
			
		||||
    <xsl:param name="init" />
 | 
			
		||||
    <xsl:param name="current" />
 | 
			
		||||
    <xsl:variable name="addr" select="address/@addr" />
 | 
			
		||||
    <xsl:variable name="initHost" select="$init/host[address/@addr=$addr]" />
 | 
			
		||||
    <xsl:variable name="currentHost" select="$current/host[address/@addr=$addr]" />
 | 
			
		||||
    <xsl:variable name="addr"
 | 
			
		||||
      select="address/@addr" />
 | 
			
		||||
    <xsl:variable name="initHost"
 | 
			
		||||
      select="$init/host[address/@addr=$addr]" />
 | 
			
		||||
    <xsl:variable name="currentHost"
 | 
			
		||||
      select="$current/host[address/@addr=$addr]" />
 | 
			
		||||
    <xsl:variable name="hostAddress">
 | 
			
		||||
      <xsl:choose>
 | 
			
		||||
        <xsl:when test="hostnames/hostname/@name">
 | 
			
		||||
@ -170,7 +179,8 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
        <xsl:if test="substring-after(hostnames/hostname/@name, '.')">
 | 
			
		||||
          <wbr />
 | 
			
		||||
          <xsl:text>.</xsl:text>
 | 
			
		||||
          <xsl:value-of select="substring-after(hostnames/hostname/@name, '.')" />
 | 
			
		||||
          <xsl:value-of
 | 
			
		||||
            select="substring-after(hostnames/hostname/@name, '.')" />
 | 
			
		||||
        </xsl:if>
 | 
			
		||||
      </td>
 | 
			
		||||
      <xsl:if test="../host/address[@addrtype='mac']/@vendor">
 | 
			
		||||
@ -179,22 +189,129 @@ $('.ui.dropdown').dropdown()
 | 
			
		||||
        </td>
 | 
			
		||||
      </xsl:if>
 | 
			
		||||
      <td>
 | 
			
		||||
        <xsl:apply-templates select="ports/port | $initHost/ports/port[not(state/@state='closed')][not(@portid=$currentHost/ports/port/@portid)]" mode="service">
 | 
			
		||||
        <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:with-param name="class" select="'ui mini label'" />
 | 
			
		||||
          <xsl:sort select="number(@portid)" order="ascending" />
 | 
			
		||||
        </xsl:apply-templates>
 | 
			
		||||
      </td>
 | 
			
		||||
      <td>
 | 
			
		||||
        <a class="ui mini icon teal icon button" target="_blank" title="Scan intensif">
 | 
			
		||||
          <xsl:attribute name="href">scan.php?target=<xsl:value-of select="$hostAddress" />
 | 
			
		||||
&preset=host</xsl:attribute>
 | 
			
		||||
          <xsl:attribute name="href">
 | 
			
		||||
            <xsl:text>scan.php?target=</xsl:text>
 | 
			
		||||
            <xsl:value-of select="$hostAddress" />
 | 
			
		||||
            <xsl:text>&preset=host</xsl:text>
 | 
			
		||||
          </xsl:attribute>
 | 
			
		||||
          <i class="search plus icon"></i>
 | 
			
		||||
        </a>
 | 
			
		||||
      </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
  </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]" />
 | 
			
		||||
 | 
			
		||||
        <a
 | 
			
		||||
      target="_blank">
 | 
			
		||||
      <xsl:attribute name="class">
 | 
			
		||||
        <xsl:text>ui mini label </xsl:text>
 | 
			
		||||
                <xsl:if
 | 
			
		||||
          test="$currentPort/script[@id='smb-shares-size']/table">dropdown button share-size </xsl:if>
 | 
			
		||||
                <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:attribute>
 | 
			
		||||
      <xsl:if test="$currentPort/script[@id='smb-shares-size']/table">
 | 
			
		||||
        <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>
 | 
			
		||||
      </xsl:if>
 | 
			
		||||
      <xsl:if
 | 
			
		||||
        test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https'">
 | 
			
		||||
        <xsl:attribute name="href">
 | 
			
		||||
          <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:attribute>
 | 
			
		||||
      </xsl:if>
 | 
			
		||||
      <xsl:if test="service/@name='ms-wbt-server'">
 | 
			
		||||
        <xsl:attribute name="href">
 | 
			
		||||
          <xsl:text>rdp.php?v=</xsl:text>
 | 
			
		||||
                    <xsl:value-of select="$hostAddress" />
 | 
			
		||||
                    <xsl:text>&p=</xsl:text>
 | 
			
		||||
                    <xsl:value-of
 | 
			
		||||
            select="@portid" />
 | 
			
		||||
        </xsl:attribute>
 | 
			
		||||
      </xsl:if>
 | 
			
		||||
      <xsl:attribute name="title">
 | 
			
		||||
        <xsl:value-of select="@protocol" />:<xsl:value-of select="@portid" />
 | 
			
		||||
      </xsl:attribute>
 | 
			
		||||
      <xsl:choose>
 | 
			
		||||
        <xsl:when test="service/@name='unknown'">
 | 
			
		||||
          <xsl:choose>
 | 
			
		||||
            <xsl:when test="@protocol='tcp'">:</xsl:when>
 | 
			
		||||
            <xsl:otherwise><xsl:value-of select="substring(@protocol, 1, 1)" />:</xsl:otherwise>
 | 
			
		||||
          </xsl:choose>
 | 
			
		||||
                    <xsl:value-of
 | 
			
		||||
            select="@portid" />
 | 
			
		||||
        </xsl:when>
 | 
			
		||||
        <xsl:otherwise>
 | 
			
		||||
          <xsl:value-of select="service/@name" />
 | 
			
		||||
        </xsl:otherwise>
 | 
			
		||||
      </xsl:choose>
 | 
			
		||||
      <xsl:if test="$currentPort/script[@id='smb-shares-size']/table">
 | 
			
		||||
        <i class="dropdown icon"></i>
 | 
			
		||||
                <div class="menu">
 | 
			
		||||
          <xsl:apply-templates select="$currentPort/script[@id='smb-shares-size']/table">
 | 
			
		||||
            <xsl:with-param name="hostAddress" select="$hostAddress" />
 | 
			
		||||
          </xsl:apply-templates>
 | 
			
		||||
        </div>
 | 
			
		||||
      </xsl:if>
 | 
			
		||||
    </a>
 | 
			
		||||
  </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:stylesheet>
 | 
			
		||||
		Reference in New Issue
	
	Block a user