index
This commit is contained in:
		
							
								
								
									
										60
									
								
								index.php
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										60
									
								
								index.php
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,60 @@ | |||||||
|  | <?php | ||||||
|  | include_once 'config.php'; | ||||||
|  |  | ||||||
|  | $targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, [ | ||||||
|  |   'flags' => FILTER_NULL_ON_FAILURE, | ||||||
|  |   'options' => ['regexp' => '/^[\da-zA-Z.:\/_ -]+$/'], | ||||||
|  | ]); | ||||||
|  | ?> | ||||||
|  | <!DOCTYPE html> | ||||||
|  | <html lang="fr"> | ||||||
|  |  | ||||||
|  |   <head> | ||||||
|  |     <meta charset="utf-8" /> | ||||||
|  |     <title>lanScan</title> | ||||||
|  |     <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script> | ||||||
|  |     <script src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.js"></script> | ||||||
|  |     <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css" /> | ||||||
|  |     <script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify"></script> | ||||||
|  |     <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> | ||||||
|  |  | ||||||
|  |   <body> | ||||||
|  |     <nav class="ui inverted teal fixed menu"> | ||||||
|  |       <a class="header item" href="."> | ||||||
|  |         lan<?php include 'logo.svg'; ?>can | ||||||
|  |       </a> | ||||||
|  |       <div class="right menu"> | ||||||
|  |           <iconsearch class="ui right aligned search category item"> | ||||||
|  |               <div class="ui icon input"> | ||||||
|  |                   <form id="newScanForm" class="ui form" method="get" action="scan.php"> | ||||||
|  |                       <input class="prompt" type="text" name="targets" placeholder="Scanner un réseau..." required="" autocomplete="off" title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc. | ||||||
|  | Exemple: scanme.nmap.org microsoft.com/24 192.168.0.1 10.0-255.0-255.1-254" pattern="[a-zA-Z0-9._\/ \-]+" value="<?=$targets; ?>" /> | ||||||
|  |                   </form> | ||||||
|  |                   <i class="satellite dish icon"></i> | ||||||
|  |               </div> | ||||||
|  |               <div class="results"></div> | ||||||
|  |           </iconsearch> | ||||||
|  |       </div> | ||||||
|  |     </nav> | ||||||
|  |  | ||||||
|  |     <main class="ui main container"> | ||||||
|  |       <h1 class="ui header">Scans</h1> | ||||||
|  |         <ul class="ui large relaxed link list"> | ||||||
|  | <?php | ||||||
|  | if (!file_exists($SCANS_DIR)) { | ||||||
|  |     mkdir($SCANS_DIR); | ||||||
|  | } | ||||||
|  | foreach (scandir($SCANS_DIR) as $scan) { | ||||||
|  |     if (substr($scan, -9) == '_init.xml') { | ||||||
|  |         echo "<li><a class='item' href='$SCANS_DIR/$scan'>".str_replace('!', '/', substr_replace($scan, '', -9))."</a></li>\n"; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | ?> | ||||||
|  |       </ul> | ||||||
|  |     </main> | ||||||
|  |   </body> | ||||||
|  |  | ||||||
|  | </html> | ||||||
| @ -35,11 +35,12 @@ if (!$targets) { | |||||||
|     </nav> |     </nav> | ||||||
|  |  | ||||||
|     <main class="ui main container"> |     <main class="ui main container"> | ||||||
|  |     <div class="ui segment"> | ||||||
|         <form id="newScanForm" class="ui form" method="get" action="scan.php"> |         <form id="newScanForm" class="ui form" method="get" action="scan.php"> | ||||||
|           <h1 class="header">Nouveau scan</h1> |           <h1 class="header">Nouveau scan</h1> | ||||||
|             <div class="field"> |             <div class="field"> | ||||||
|               <label for="nameInput">Nom</label> |               <label for="nameInput">Nom</label> | ||||||
|               <input id="nameInput" type="text" name="name" placeholder="Réseau local" pattern='[^<>:"\\\/\|@?]+' required="" |               <input id="nameInput" type="text" name="name" placeholder="Réseau local" pattern='[^<>:"\\\/\|@?]+' | ||||||
|                 title='Nom de fichier valide (ne contenant pas les caractères <>:"\/|@?)' |                 title='Nom de fichier valide (ne contenant pas les caractères <>:"\/|@?)' | ||||||
|                 value="<?= htmlspecialchars($name); ?>"> |                 value="<?= htmlspecialchars($name); ?>"> | ||||||
|             </div> |             </div> | ||||||
| @ -52,6 +53,7 @@ if (!$targets) { | |||||||
|             </div> |             </div> | ||||||
|             <button id="newScanSubmitButton" type="submit" class="ui fluid large teal submit button">Démarrer</button> |             <button id="newScanSubmitButton" type="submit" class="ui fluid large teal submit button">Démarrer</button> | ||||||
|         </form> |         </form> | ||||||
|  |       </div> | ||||||
|     </main> |     </main> | ||||||
|       <script> |       <script> | ||||||
|         tagify = new Tagify(targetsInput, { |         tagify = new Tagify(targetsInput, { | ||||||
|  | |||||||
							
								
								
									
										31
									
								
								scan.php
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								scan.php
									
									
									
									
									
								
							| @ -2,15 +2,6 @@ | |||||||
|  |  | ||||||
| include_once 'config.php'; | include_once 'config.php'; | ||||||
|  |  | ||||||
| $name = filter_input(INPUT_GET, 'name', FILTER_VALIDATE_REGEXP, [ |  | ||||||
|     'flags' => FILTER_NULL_ON_FAILURE, |  | ||||||
|     'options' => ['regexp' => '/^[^@<>:"\/|?]+$/'], |  | ||||||
| ]); |  | ||||||
| if (!$name) { |  | ||||||
|     http_response_code(400); |  | ||||||
|     exit('Paramètre name manquant.'); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| $targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, [ | $targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, [ | ||||||
|     'flags' => FILTER_NULL_ON_FAILURE, |     'flags' => FILTER_NULL_ON_FAILURE, | ||||||
|     'options' => ['regexp' => "/^[\da-zA-Z.:\/_ -]+$/"], |     'options' => ['regexp' => "/^[\da-zA-Z.:\/_ -]+$/"], | ||||||
| @ -20,15 +11,15 @@ if (!$targets) { | |||||||
|     exit('Paramètre targets manquant.'); |     exit('Paramètre targets manquant.'); | ||||||
| } | } | ||||||
|  |  | ||||||
| $basedir = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['REQUEST_URI']); | $basedir = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}".dirname($_SERVER['REQUEST_URI']); | ||||||
|  |  | ||||||
| $dir = $SCANS_DIR; | $dir = $SCANS_DIR; | ||||||
| if (!file_exists($dir)) { | if (!file_exists($SCANS_DIR)) { | ||||||
|     mkdir($dir); |     mkdir($SCANS_DIR); | ||||||
| } | } | ||||||
| $firstPath = ("$dir/${name}.xml"); | $firstPath = "$SCANS_DIR/".str_replace('/', '!', $targets).'_init.xml'; | ||||||
| if (file_exists($firstPath)) { | if (file_exists($firstPath)) { | ||||||
|     $path = ("$dir/${name}@".date('YmdHis').'.xml'); |     $path = ("$SCANS_DIR/".str_replace('/', '!', $targets).'_current.xml'); | ||||||
| } else { | } else { | ||||||
|     $path = $firstPath; |     $path = $firstPath; | ||||||
|     $firstPath = ''; |     $firstPath = ''; | ||||||
| @ -36,15 +27,11 @@ if (file_exists($firstPath)) { | |||||||
|  |  | ||||||
| $stylesheetUrl = "$basedir/stylesheet.xsl"; | $stylesheetUrl = "$basedir/stylesheet.xsl"; | ||||||
|  |  | ||||||
| $command = 'NMAPDIR=./nmap nmap'; | $command = "NMAPDIR=./nmap nmap $NMAP_OPTIONS -oX ".escapeshellarg($path)." --stylesheet $basedir/stylesheet.xsl $targets"; | ||||||
| $command .= " $NMAP_OPTIONS"; |  | ||||||
| $command .= ' -oX '.escapeshellarg($path); |  | ||||||
| $command .= ' --stylesheet '.escapeshellarg($stylesheetUrl); |  | ||||||
| $command .= " $targets"; |  | ||||||
|  |  | ||||||
| exec($command, $output, $retval); | exec($command, $output, $retval); | ||||||
|  |  | ||||||
| if (!file_exists(__DIR__."/$path")) { | if (!file_exists($path)) { | ||||||
|     http_response_code(500); |     http_response_code(500); | ||||||
|     exit(implode("<br/>\n", $output)); |     exit(implode("<br/>\n", $output)); | ||||||
| } | } | ||||||
| @ -52,13 +39,11 @@ if (!file_exists(__DIR__."/$path")) { | |||||||
| // Add params | // Add params | ||||||
| $xml = new DOMDocument(); | $xml = new DOMDocument(); | ||||||
| $xml->load($path); | $xml->load($path); | ||||||
| $processingInstruction = $xml->createProcessingInstruction('xslt-param', "name='name' value='$name'"); |  | ||||||
| $xml->insertBefore($processingInstruction, $xml->documentElement); |  | ||||||
| $processingInstruction = $xml->createProcessingInstruction('xslt-param', "name='targets' value='$targets'"); | $processingInstruction = $xml->createProcessingInstruction('xslt-param', "name='targets' value='$targets'"); | ||||||
| $xml->insertBefore($processingInstruction, $xml->documentElement); | $xml->insertBefore($processingInstruction, $xml->documentElement); | ||||||
| $processingInstruction = $xml->createProcessingInstruction('xslt-param', "name='basedir' value='$basedir'"); | $processingInstruction = $xml->createProcessingInstruction('xslt-param', "name='basedir' value='$basedir'"); | ||||||
| $xml->insertBefore($processingInstruction, $xml->documentElement); | $xml->insertBefore($processingInstruction, $xml->documentElement); | ||||||
| $processingInstruction = $xml->createProcessingInstruction('xslt-param', "name='compareWith' value='$basedir/$firstPath'"); | $processingInstruction = $xml->createProcessingInstruction('xslt-param', "name='compareWith' value='$firstPath'"); | ||||||
| $xml->insertBefore($processingInstruction, $xml->documentElement); | $xml->insertBefore($processingInstruction, $xml->documentElement); | ||||||
| $xml->save($path); | $xml->save($path); | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,2 +0,0 @@ | |||||||
| <?php |  | ||||||
| var_dump($_SERVER); |  | ||||||
							
								
								
									
										116
									
								
								stylesheet.xsl
									
									
									
									
									
								
							
							
						
						
									
										116
									
								
								stylesheet.xsl
									
									
									
									
									
								
							| @ -4,18 +4,18 @@ | |||||||
|     <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='*' /> | ||||||
|     <xsl:param name="name"/> |  | ||||||
|     <xsl:param name="basedir" /> |     <xsl:param name="basedir" /> | ||||||
|     <xsl:param name="targets" /> |     <xsl:param name="targets" /> | ||||||
|     <xsl:param name="compareWith" /> |     <xsl:param name="compareWith" /> | ||||||
|     <xsl:variable name="current" select="./nmaprun" /> |     <xsl:variable name="current" select="./nmaprun" /> | ||||||
|     <xsl:variable name="previous" select="document(string($compareWith))/nmaprun"/> |     <xsl:variable name="init" select="document(string($compareWith))/nmaprun" /> | ||||||
|  |  | ||||||
|     <xsl:template match="nmaprun"> |     <xsl:template match="nmaprun"> | ||||||
|         <html lang="fr"> |         <html lang="fr"> | ||||||
|             <head> |             <head> | ||||||
|                 <meta charset="utf-8" /> |                 <meta charset="utf-8" /> | ||||||
|                 <title>lanScan - <xsl:value-of select="$name"/></title> |                 <title>lanScan - <xsl:value-of select="$targets" /> | ||||||
|  |                 </title> | ||||||
|                 <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css" /> |                 <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css" /> | ||||||
|                 <link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.css" rel="stylesheet" type="text/css" /> |                 <link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.css" rel="stylesheet" type="text/css" /> | ||||||
|                 <link href="https://cdn.datatables.net/v/dt/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/fh-4.0.1/r-3.0.3/datatables.css" rel="stylesheet" /> |                 <link href="https://cdn.datatables.net/v/dt/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/fh-4.0.1/r-3.0.3/datatables.css" rel="stylesheet" /> | ||||||
| @ -33,18 +33,67 @@ | |||||||
|                 <nav class="ui inverted teal fixed menu"> |                 <nav class="ui inverted teal fixed menu"> | ||||||
|                     <a class="header item" href="{$basedir}"> |                     <a class="header item" href="{$basedir}"> | ||||||
|                         <xsl:text>lan</xsl:text> |                         <xsl:text>lan</xsl:text> | ||||||
|                         <svg class="logo" version="1.1" id="Layer_1" x="0px" y="0px" |                         <svg class="logo" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 24 24" xml:space="preserve" width="40" height="40" | ||||||
|                         viewBox="0 0 24 24" xml:space="preserve" width="40" height="40" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"><defs id="defs206" /><g id="g998" transform="matrix(0,0.04687491,-0.04687491,0,24,2.2682373e-5)"><g id="g147"><g id="g145"><path |                             xmlns="http://www.w3.org/2000/svg" | ||||||
|                                 d="m 322.065,92.046 c -46.24,0 -83.851,37.619 -83.851,83.857 v 168.712 c 0,25.224 -21.148,45.745 -46.372,45.745 -25.224,0 -46.372,-20.521 -46.372,-45.745 V 199.464 h -38.114 v 145.151 c 0,46.24 38.246,83.859 84.486,83.859 46.24,0 84.486,-37.619 84.486,-83.859 V 175.903 c 0,-25.223 20.514,-45.743 45.737,-45.743 25.223,0 45.737,20.521 45.737,45.743 v 134.092 h 38.114 V 175.903 c 0,-46.239 -37.611,-83.857 -83.851,-83.857 z" |                             xmlns:svg="http://www.w3.org/2000/svg"> | ||||||
|                                 id="path143" /></g></g><g id="g153"><g id="g151"><path |                             <defs id="defs206" /> | ||||||
|                                 d="M 144.198,0 H 108.625 C 98.101,0 89.568,8.746 89.568,19.271 c 0,1.157 0.121,2.328 0.318,3.598 h 73.052 c 0.197,-1.27 0.318,-2.441 0.318,-3.598 C 163.256,8.746 154.723,0 144.198,0 Z" |                             <g id="g998" transform="matrix(0,0.04687491,-0.04687491,0,24,2.2682373e-5)"> | ||||||
|                                 id="path149" /></g></g><g id="g159"><g id="g157"><path |                                 <g id="g147"> | ||||||
|                                 d="m 420.183,486.591 h -71.731 c -0.626,2.541 -0.978,4.077 -0.978,6.176 0,10.525 8.532,19.234 19.057,19.234 h 35.573 c 10.525,0 19.057,-8.709 19.057,-19.234 0,-2.098 -0.352,-3.635 -0.978,-6.176 z" |                                     <g id="g145"> | ||||||
|                                 id="path155" /></g></g><g id="g165"><g id="g163"><rect x="87.027" y="41.925999" width="80.040001" height="138.481" id="rect161" /></g></g><g id="g171"><g id="g169"><rect x="344.93301" y="329.052" width="80.040001" height="138.481" id="rect167" /></g></g><g id="g173"></g><g id="g175"></g><g id="g177"></g><g id="g179"></g><g id="g181"></g><g id="g183"></g><g id="g185"></g><g id="g187"></g><g id="g189"></g><g id="g191"></g><g id="g193"></g><g id="g195"></g><g id="g197"></g><g id="g199"></g><g id="g201"></g></g></svg> |                                         <path d="m 322.065,92.046 c -46.24,0 -83.851,37.619 -83.851,83.857 v 168.712 c 0,25.224 -21.148,45.745 -46.372,45.745 -25.224,0 -46.372,-20.521 -46.372,-45.745 V 199.464 h -38.114 v 145.151 c 0,46.24 38.246,83.859 84.486,83.859 46.24,0 84.486,-37.619 84.486,-83.859 V 175.903 c 0,-25.223 20.514,-45.743 45.737,-45.743 25.223,0 45.737,20.521 45.737,45.743 v 134.092 h 38.114 V 175.903 c 0,-46.239 -37.611,-83.857 -83.851,-83.857 z" id="path143" /> | ||||||
|  |                                     </g> | ||||||
|  |                                 </g> | ||||||
|  |                                 <g id="g153"> | ||||||
|  |                                     <g id="g151"> | ||||||
|  |                                         <path d="M 144.198,0 H 108.625 C 98.101,0 89.568,8.746 89.568,19.271 c 0,1.157 0.121,2.328 0.318,3.598 h 73.052 c 0.197,-1.27 0.318,-2.441 0.318,-3.598 C 163.256,8.746 154.723,0 144.198,0 Z" id="path149" /> | ||||||
|  |                                     </g> | ||||||
|  |                                 </g> | ||||||
|  |                                 <g id="g159"> | ||||||
|  |                                     <g id="g157"> | ||||||
|  |                                         <path d="m 420.183,486.591 h -71.731 c -0.626,2.541 -0.978,4.077 -0.978,6.176 0,10.525 8.532,19.234 19.057,19.234 h 35.573 c 10.525,0 19.057,-8.709 19.057,-19.234 0,-2.098 -0.352,-3.635 -0.978,-6.176 z" id="path155" /> | ||||||
|  |                                     </g> | ||||||
|  |                                 </g> | ||||||
|  |                                 <g id="g165"> | ||||||
|  |                                     <g id="g163"> | ||||||
|  |                                         <rect x="87.027" y="41.925999" width="80.040001" height="138.481" id="rect161" /> | ||||||
|  |                                     </g> | ||||||
|  |                                 </g> | ||||||
|  |                                 <g id="g171"> | ||||||
|  |                                     <g id="g169"> | ||||||
|  |                                         <rect x="344.93301" y="329.052" width="80.040001" height="138.481" id="rect167" /> | ||||||
|  |                                     </g> | ||||||
|  |                                 </g> | ||||||
|  |                                 <g id="g173"></g> | ||||||
|  |                                 <g id="g175"></g> | ||||||
|  |                                 <g id="g177"></g> | ||||||
|  |                                 <g id="g179"></g> | ||||||
|  |                                 <g id="g181"></g> | ||||||
|  |                                 <g id="g183"></g> | ||||||
|  |                                 <g id="g185"></g> | ||||||
|  |                                 <g id="g187"></g> | ||||||
|  |                                 <g id="g189"></g> | ||||||
|  |                                 <g id="g191"></g> | ||||||
|  |                                 <g id="g193"></g> | ||||||
|  |                                 <g id="g195"></g> | ||||||
|  |                                 <g id="g197"></g> | ||||||
|  |                                 <g id="g199"></g> | ||||||
|  |                                 <g id="g201"></g> | ||||||
|  |                             </g> | ||||||
|  |                         </svg> | ||||||
|                         <xsl:text>can</xsl:text> |                         <xsl:text>can</xsl:text> | ||||||
|                     </a> |                     </a> | ||||||
|  |  | ||||||
|                     <div class="right menu"> |                     <div class="right menu"> | ||||||
|                         <a class="item" href="{$basedir}/new-scan.php?name={$name}&targets={$targets}"><i class="satellite dish icon"></i>Nouveau scan</a> |                         <iconsearch class="ui right aligned search category item"> | ||||||
|  |                             <div class="ui icon input"> | ||||||
|  |                                 <form id="newScanForm" class="ui form" method="get" action="{$basedir}/scan.php"> | ||||||
|  |                                     <input class="prompt" type="text" name="targets" placeholder="Scanner un réseau..." required="" autocomplete="off" title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc. | ||||||
|  | Exemple: scanme.nmap.org microsoft.com/24 192.168.0.1 10.0-255.0-255.1-254" pattern="[a-zA-Z0-9._\/ \-]+" value="{$targets}" /> | ||||||
|  |                                 </form> | ||||||
|  |                                 <i class="satellite dish icon"></i> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="results"></div> | ||||||
|  |                         </iconsearch> | ||||||
|                     </div> |                     </div> | ||||||
|                 </nav> |                 </nav> | ||||||
|  |  | ||||||
| @ -53,21 +102,24 @@ | |||||||
|                         <div class="ui negative icon message"> |                         <div class="ui negative icon message"> | ||||||
|                             <i class="exclamation triangle icon"></i> |                             <i class="exclamation triangle icon"></i> | ||||||
|                             <div class="content"> |                             <div class="content"> | ||||||
|                                 <div class="header" style="text-transform: capitalize"><xsl:value-of select="runstats/finished/@exit"/></div> |                                 <div class="header" style="text-transform: capitalize"> | ||||||
|                                 <p><xsl:value-of select="runstats/finished/@errormsg"/></p> |                                     <xsl:value-of select="runstats/finished/@exit" /> | ||||||
|  |                                 </div> | ||||||
|  |                                 <p> | ||||||
|  |                                     <xsl:value-of select="runstats/finished/@errormsg" /> | ||||||
|  |                                 </p> | ||||||
|                             </div> |                             </div> | ||||||
|                         </div> |                         </div> | ||||||
|                     </xsl:if> |                     </xsl:if> | ||||||
|  |  | ||||||
|                     <h1 class="ui header"> |                     <h1 class="ui header"> | ||||||
|                         <xsl:value-of select="$name"/> |                         <xsl:value-of select="$targets" /> | ||||||
|                         <div class="sub header"><xsl:value-of select="$targets"/></div> |  | ||||||
|                     </h1> |                     </h1> | ||||||
|  |  | ||||||
|                     <xsl:if test="$previous"> |                     <xsl:if test="$init"> | ||||||
|                         <div class="ui info message"> |                         <div class="ui info message"> | ||||||
|                             <xsl:text>Comparaison avec le scan de </xsl:text> |                             <xsl:text>Comparaison avec le scan de </xsl:text> | ||||||
|                             <xsl:value-of select="$previous/runstats/finished/@timestr"/> |                             <xsl:value-of select="$init/runstats/finished/@timestr" /> | ||||||
|                         </div> |                         </div> | ||||||
|                     </xsl:if> |                     </xsl:if> | ||||||
|  |  | ||||||
| @ -81,9 +133,11 @@ | |||||||
|                             </tr> |                             </tr> | ||||||
|                         </thead> |                         </thead> | ||||||
|                         <tbody> |                         <tbody> | ||||||
|                             <xsl:apply-templates select="host | $previous/host[not(address/@addr = $current/host/address/@addr)]"/> |                             <xsl:apply-templates select="host | $init/host[not(address/@addr = $current/host/address/@addr)]" /> | ||||||
|                         </tbody> |                         </tbody> | ||||||
|                         <caption><xsl:value-of select="runstats/finished/@summary"/></caption> |                         <caption> | ||||||
|  |                             <xsl:value-of select="runstats/finished/@summary" /> | ||||||
|  |                         </caption> | ||||||
|                     </table> |                     </table> | ||||||
|                 </main> |                 </main> | ||||||
|                 <script> |                 <script> | ||||||
| @ -117,7 +171,7 @@ | |||||||
|  |  | ||||||
|     <xsl:template match="host"> |     <xsl:template match="host"> | ||||||
|         <xsl:variable name="addr" select="address/@addr" /> |         <xsl:variable name="addr" select="address/@addr" /> | ||||||
|         <xsl:variable name="previousHost" select="$previous/host[address/@addr=$addr]"/> |         <xsl:variable name="initHost" select="$init/host[address/@addr=$addr]" /> | ||||||
|         <xsl:variable name="currentHost" select="$current/host[address/@addr=$addr]" /> |         <xsl:variable name="currentHost" select="$current/host[address/@addr=$addr]" /> | ||||||
|         <tr> |         <tr> | ||||||
|             <xsl:attribute name="class"> |             <xsl:attribute name="class"> | ||||||
| @ -138,10 +192,12 @@ | |||||||
|                 <xsl:value-of select="address/@addr" /> |                 <xsl:value-of select="address/@addr" /> | ||||||
|             </td> |             </td> | ||||||
|             <td> |             <td> | ||||||
|                 <b><xsl:value-of select="hostnames/hostname/@name"/></b> |                 <b> | ||||||
|  |                     <xsl:value-of select="hostnames/hostname/@name" /> | ||||||
|  |                 </b> | ||||||
|             </td> |             </td> | ||||||
|             <td> |             <td> | ||||||
|                 <xsl:apply-templates select="$currentHost/ports/port | $previousHost/ports/port[not(@portid=$currentHost/ports/port/@portid)]"> |                 <xsl:apply-templates select="$currentHost/ports/port | $initHost/ports/port[not(@portid=$currentHost/ports/port/@portid)]"> | ||||||
|                     <xsl:with-param name="hostAddress"> |                     <xsl:with-param name="hostAddress"> | ||||||
|                         <xsl:choose> |                         <xsl:choose> | ||||||
|                             <xsl:when test="hostnames/hostname/@name"> |                             <xsl:when test="hostnames/hostname/@name"> | ||||||
| @ -152,7 +208,7 @@ | |||||||
|                             </xsl:otherwise> |                             </xsl:otherwise> | ||||||
|                         </xsl:choose> |                         </xsl:choose> | ||||||
|                     </xsl:with-param> |                     </xsl:with-param> | ||||||
|                     <xsl:with-param name="previousHost" select="$previousHost"/> |                     <xsl:with-param name="initHost" select="$initHost" /> | ||||||
|                     <xsl:with-param name="currentHost" select="$currentHost" /> |                     <xsl:with-param name="currentHost" select="$currentHost" /> | ||||||
|                     <xsl:sort select="@portid" order="ascending" /> |                     <xsl:sort select="@portid" order="ascending" /> | ||||||
|                 </xsl:apply-templates> |                 </xsl:apply-templates> | ||||||
| @ -162,10 +218,10 @@ | |||||||
|  |  | ||||||
|     <xsl:template match="port"> |     <xsl:template match="port"> | ||||||
|         <xsl:param name="hostAddress" /> |         <xsl:param name="hostAddress" /> | ||||||
|         <xsl:param name="previousHost"/> |         <xsl:param name="initHost" /> | ||||||
|         <xsl:param name="currentHost" /> |         <xsl:param name="currentHost" /> | ||||||
|         <xsl:variable name="portid" select="@portid" /> |         <xsl:variable name="portid" select="@portid" /> | ||||||
|         <xsl:variable name="previousPort" select="$previousHost/ports/port[@portid=$portid]"/> |         <xsl:variable name="initPort" select="$initHost/ports/port[@portid=$portid]" /> | ||||||
|         <xsl:variable name="currentPort" select="$currentHost/ports/port[@portid=$portid]" /> |         <xsl:variable name="currentPort" select="$currentHost/ports/port[@portid=$portid]" /> | ||||||
|  |  | ||||||
|         <a class="ui label" target="_blank"> |         <a class="ui label" target="_blank"> | ||||||
| @ -186,12 +242,16 @@ | |||||||
|             </xsl:attribute> |             </xsl:attribute> | ||||||
|             <xsl:if test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https'"> |             <xsl:if test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https'"> | ||||||
|                 <xsl:attribute name="href"> |                 <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:attribute> | ||||||
|             </xsl:if> |             </xsl:if> | ||||||
|             <xsl:if test="service/@name='ms-wbt-server'"> |             <xsl:if test="service/@name='ms-wbt-server'"> | ||||||
|                 <xsl:attribute name="href"> |                 <xsl:attribute name="href"> | ||||||
|                     <xsl:value-of select="$basedir"/>/rdp.php?v=<xsl:value-of select="$hostAddress"/>:<xsl:value-of select="@portid"/> |                     <xsl:value-of select="$basedir" /> | ||||||
|  | /rdp.php?v=<xsl:value-of select="$hostAddress" /> | ||||||
|  | :                <xsl:value-of select="@portid" /> | ||||||
|             </xsl:attribute> |             </xsl:attribute> | ||||||
|         </xsl:if> |         </xsl:if> | ||||||
|         <xsl:if test="(service/@name='microsoft-ds' or service/@name='netbios-ssn') and ../../hostscript/script[@id='smb-shares-size']/table"> |         <xsl:if test="(service/@name='microsoft-ds' or service/@name='netbios-ssn') and ../../hostscript/script[@id='smb-shares-size']/table"> | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user