164 Commits

Author SHA1 Message Date
adrien 13f42cad36 undo URL 2025-02-04 10:05:12 +01:00
adrien eeba9d613b fix scan select 2025-02-04 09:08:10 +01:00
adrien dba34f39eb small changes 2025-02-04 03:44:37 +01:00
adrien 0e24595170 more infos 2025-02-04 03:29:44 +01:00
adrien efed32d11d url 2025-02-04 03:18:53 +01:00
adrien ae0abc39cf split nav 2025-02-04 03:13:55 +01:00
adrien a981059c73 service link 2025-02-04 03:08:45 +01:00
adrien c2d2a2455d slit head 2025-02-04 02:48:35 +01:00
adrien dd16294e8d host scan 2025-02-04 02:42:17 +01:00
adrien 6f0cc6e9bd lan scan 2025-02-03 20:25:46 +01:00
adrien b4016685a0 WIP 2025-02-03 18:22:49 +01:00
adrien f39c328d06 WIP 2025-02-03 10:20:20 +01:00
adrien cbbf09677e WIP 2025-01-31 17:57:55 +01:00
adrien 2b1fd671da init v4 2025-01-30 16:20:16 +01:00
adrien b445d08ce1 outch 2025-01-27 18:47:38 +01:00
adrien e2c1c6604e WIP 2025-01-24 17:38:33 +01:00
adrien a593148c38 add --defeat-rst-ratelimit 2024-12-04 16:26:58 +01:00
adrien d45b05941f putain de point virgule 2024-11-26 15:18:01 +01:00
adrien e423273752 save if name only 2024-11-26 15:15:12 +01:00
adrien 0c72ceb620 system 2024-11-25 18:02:54 +01:00
adrien dc8fa57c0f fix ' in message 2024-11-25 15:17:12 +01:00
adrien 53679e2098 fixed navbar 2024-11-25 11:25:40 +01:00
adrien 8cd0ba066f rrr 2024-10-23 19:39:19 +02:00
adrien 602c1fc7f3 rename script-arg-file 2024-10-23 19:39:00 +02:00
adrien 06eb33187b ignore script-args-file.ini 2024-10-23 19:19:28 +02:00
adrien 43d2df7850 script-args-file.ini 2024-10-23 19:18:59 +02:00
adrien 9d7f526080 use shortport.http 2024-10-23 19:10:56 +02:00
adrien 80dc329353 https 2024-10-23 19:02:13 +02:00
adrien 81652e25c9 ignore password 2024-10-23 15:48:28 +02:00
adrien 4e14da1860 script-arg-file.ini 2024-10-23 15:46:59 +02:00
adrien 8e5f010da0 rename saveAs to name 2024-10-23 15:17:03 +02:00
adrien df4648e12a f*cking css 2024-10-23 14:02:05 +02:00
adrien 154d731e55 use service template 2024-10-22 23:24:08 +02:00
adrien 2ef0421078 unfixed menu 2024-10-22 17:57:11 +02:00
adrien f2acc56ef7 smb-shares-size template 2024-10-22 17:55:31 +02:00
adrien 1d5bb5446d move script arg file 2024-10-22 16:38:01 +02:00
adrien 7790369ac1 return to bin.pack 2024-10-22 15:50:19 +02:00
adrien bfb7788df0 rawurlencode on $thisURL 2024-10-22 02:09:59 +02:00
adrien c174b3a142 fix renaming 2024-10-22 01:52:34 +02:00
adrien 1a0bb6abf5 clearable 2024-10-22 01:50:37 +02:00
adrien c01cfb631b renaming 2024-10-22 01:26:34 +02:00
adrien f1bb88abec rename compareWith to original 2024-10-22 01:07:08 +02:00
adrien f2af893303 more options 2024-10-22 00:35:00 +02:00
adrien 8865da906d hostgroup 2024-10-21 23:56:32 +02:00
adrien f05edd0fc7 RTTDuration 2024-10-21 22:59:52 +02:00
adrien 2eda5ca9c9 change options icon 2024-10-21 22:31:28 +02:00
adrien 68a98fb5a5 more options 2024-10-21 01:14:22 +02:00
adrien 7bddbd3e10 fix nav 2024-10-20 17:58:53 +02:00
adrien 0b59c94f52 export nav 2024-10-20 17:35:37 +02:00
adrien bd8e988444 export head 2024-10-20 15:03:45 +02:00
adrien cadcd37408 export toast 2024-10-20 13:49:04 +02:00
adrien d8bc7d99fb update cards 2024-10-20 13:46:35 +02:00
adrien 458c04afa1 remove htmlentities 2024-10-20 13:44:55 +02:00
adrien f001e1b61d fix url 2024-10-20 13:41:51 +02:00
adrien db6643b8bb split service label 2024-10-20 12:43:51 +02:00
adrien a7c67292ed --script-args 2024-10-20 12:33:50 +02:00
adrien dfd89a5add remove quotes on value 2024-10-20 12:30:09 +02:00
adrien c6b8005958 split command parsing 2024-10-20 12:22:24 +02:00
adrien 705904fbfa update scripts 2024-10-20 02:36:26 +02:00
adrien af6dc0a76b portrule 2024-10-20 02:18:46 +02:00
adrien 321935e7a8 align 2024-10-20 02:18:38 +02:00
adrien baef7123b8 option -T 2024-10-20 01:56:33 +02:00
adrien f14062fda5 rename var 2024-10-20 01:32:54 +02:00
adrien b55df2e880 not wide 2024-10-20 00:49:57 +02:00
adrien 5882baf8ae script filter 2024-10-20 00:49:52 +02:00
adrien dba9e2e9b7 dont include known port on url 2024-10-20 00:29:41 +02:00
adrien 4928b346b3 default 2024-10-18 18:41:15 +02:00
adrien 0c736158aa merge index and options 2024-10-18 16:14:52 +02:00
adrien 17a628cc11 split domain suffix 2024-10-18 15:20:59 +02:00
adrien b6900bc76a templates 2024-10-18 15:08:49 +02:00
adrien c3ed9f9fc2 reorg 2024-10-18 14:47:02 +02:00
adrien a773e8b8d9 datadir 2024-10-18 12:11:45 +02:00
adrien 54116d27d0 scripts 2024-10-18 02:04:55 +02:00
adrien 887e024f27 add http title 2024-10-18 01:31:04 +02:00
adrien 9f06bd0b66 add personnal scripts 2024-10-18 01:30:05 +02:00
adrien 63dbcb407f more options 2024-10-18 00:39:53 +02:00
adrien e7b462c033 style 2024-10-17 20:09:26 +02:00
adrien d39798ea4e title 2024-10-17 16:49:56 +02:00
adrien 88280ac41d update stylesheets 2024-10-17 15:56:32 +02:00
adrien 8c4dda99b5 add -sU 2024-10-17 14:52:20 +02:00
adrien 22de01a01b move nmap scripts to separate git projet nmap-scripts 2024-10-17 11:29:42 +02:00
adrien 1832864505 overflow 2024-10-17 09:00:12 +02:00
adrien 59d0695d1b no services 2024-10-17 08:45:25 +02:00
adrien 4b3634dc67 rename hostsTable 2024-10-17 08:41:50 +02:00
adrien b3b9db4aa7 compact stylesheet 2024-10-17 03:27:22 +02:00
adrien 3b90e7f6cc move stylesheets to subfolder 2024-10-17 02:19:21 +02:00
adrien 290932a421 rename stylesheet 2024-10-17 00:48:26 +02:00
adrien 9683dd2283 fix options with - 2024-10-17 00:45:59 +02:00
adrien df5c7e8497 layout 2024-10-16 23:44:47 +02:00
adrien 5e0985e7d6 undo footer 2024-10-16 23:41:46 +02:00
adrien ff18e2352c footer 2024-10-16 23:38:20 +02:00
adrien 7aeb817c4c footer 2024-10-16 23:32:25 +02:00
adrien 7c4d32c83f cards stylesheet 2024-10-16 23:31:02 +02:00
adrien 4ccd659d63 fix no name 2024-10-16 22:13:48 +02:00
adrien c2b40b5c71 fix no name 2024-10-16 22:11:04 +02:00
adrien 6fc85431af fix stylesheet value 2024-10-16 22:01:22 +02:00
adrien 18775fb8b1 rename host scan to services details 2024-10-16 21:50:44 +02:00
adrien 9f2826d522 inclure lanScan options in presets 2024-10-16 21:41:57 +02:00
adrien 653bb604f5 args name with "-" 2024-10-16 21:25:02 +02:00
adrien 6c33080785 presets 2024-10-16 20:55:43 +02:00
adrien a1aeefee47 rename $inputs to $args 2024-10-16 20:15:54 +02:00
adrien 5e76b92b96 targets no longer required 2024-10-16 20:08:49 +02:00
adrien ec917b4602 sudo in web options 2024-10-16 19:01:44 +02:00
adrien 260c8f073a config
Signed-off-by: Adrien MALINGREY <adrien@malingrey.fr>
2024-10-16 11:52:42 +02:00
adrien 570e8f2252 use sudo at will 2024-10-16 11:04:12 +02:00
adrien cd6f64679b include error message 2024-10-16 10:43:11 +02:00
adrien 6422830783 more options 2024-10-15 23:19:22 +02:00
adrien 7ef62104f0 don't spin all form 2024-10-15 22:34:36 +02:00
adrien 386d0fc65d use sudo on need 2024-10-15 16:24:07 +02:00
adrien 9a525b6ffe install sudo 2024-10-15 08:35:50 +02:00
adrien 6a3589b988 README 2024-10-15 08:34:00 +02:00
adrien 2c771c0766 split some options 2024-10-15 08:29:01 +02:00
adrien 1befb0017c more options 2024-10-15 02:55:42 +02:00
adrien 95d509e1b1 merge right menu items 2024-10-15 01:38:58 +02:00
adrien f8f1183fe7 refreshPeriod input 2024-10-14 23:37:57 +02:00
adrien 9cb008785c host options 2024-10-14 21:21:08 +02:00
adrien 2337fe1e60 little fixes 2024-10-14 15:40:50 +02:00
adrien 1f2ab88641 fix sudo 2024-10-14 14:43:55 +02:00
adrien 641f214899 basedir o logo 2024-10-14 12:48:32 +02:00
adrien 89a7613f9e encode url 2024-10-14 05:00:51 +02:00
adrien fdf15e5a7d datatable import 2024-10-14 04:54:49 +02:00
adrien 47c0bbdb4c mac vendor 2024-10-14 04:41:18 +02:00
adrien db216baf46 reorder options 2024-10-14 04:12:56 +02:00
adrien cf5dcf24a7 small fixes 2024-10-14 03:36:07 +02:00
adrien 2f7eebdaf1 host scan stylesheet 2024-10-14 02:50:36 +02:00
adrien ad79495608 saveAs and compareWith as URL 2024-10-14 00:49:19 +02:00
adrien 76e1832c28 use other stylesheets 2024-10-13 18:07:32 +02:00
adrien f7629028f6 footer 2024-10-13 15:36:46 +02:00
adrien f5a0cffc05 temp file 2024-10-13 15:04:58 +02:00
adrien bcf6ddff0d default values 2024-10-13 14:20:20 +02:00
adrien df6f5154e2 refresh to scan.php 2024-10-13 14:16:52 +02:00
adrien efff220fe3 pass inputs with recursive template 2024-10-13 07:29:16 +02:00
adrien cb0a4d94a5 dont serve stdout if ok 2024-10-13 07:29:00 +02:00
adrien 48113dc7cc fix names 2024-10-13 07:28:11 +02:00
adrien b197af448a quote in name, params on index link 2024-10-13 04:37:49 +02:00
adrien 97a4c5801b lot of stuff 2024-10-12 19:10:50 +02:00
adrien 8a9b822cf6 fix 2024-10-10 18:08:42 +02:00
adrien f413212db9 fix scan args 2024-10-10 18:07:44 +02:00
adrien 01f8ee3ea0 circular label on status 2024-10-10 09:03:27 +02:00
adrien 664bee1249 options 2024-10-10 02:10:06 +02:00
adrien bcb63b3d0f remove - 2024-10-10 02:07:00 +02:00
adrien 3c9978569b toast 2024-10-10 02:05:32 +02:00
adrien eae12a8e4e get query 2024-10-09 03:08:41 +02:00
adrien ce4f8dda1a get default args 2024-10-09 03:08:20 +02:00
adrien b3cffaed35 default args 2024-10-09 03:07:56 +02:00
adrien a6ba7c4b23 oops 2024-10-09 01:46:44 +02:00
adrien 865a8efb62 filter inputs 2024-10-09 01:36:51 +02:00
adrien 3a594acb48 index list 2024-10-08 18:30:24 +02:00
adrien b4f75a5984 more fields 2024-10-08 18:08:39 +02:00
adrien 4e9dd60477 input with checkbox 2024-10-08 12:21:55 +02:00
adrien 20e6b22d0d tag validation 2024-10-08 11:14:31 +02:00
adrien 3dd9e39f5c tag input 2024-10-08 05:26:09 +02:00
adrien 7062b94aaa scan options draft 2024-10-08 05:13:40 +02:00
adrien d5dd51921c new scan menu 2024-10-07 20:42:16 +02:00
adrien b02c89973c filename 2024-10-07 20:34:38 +02:00
adrien 0d56163339 filter input 2024-10-07 20:33:03 +02:00
adrien 6319d411c5 remove basedir 2024-10-07 16:28:29 +02:00
adrien 6dd728ce0d save only first scan 2024-10-07 12:09:12 +02:00
adrien 1d8457d020 faivonc 2024-10-07 10:27:34 +02:00
adrien 85fab8e41b variable rename 2024-10-07 03:38:29 +02:00
adrien bef547fae0 true example 2024-10-07 03:38:10 +02:00
adrien 42e16d3ef8 index 2024-10-07 02:48:34 +02:00
adrien f44e1d8267 second draft 2024-10-07 01:16:44 +02:00
adrien 34a4058ba4 first draft 2024-10-04 18:04:25 +02:00
20 changed files with 2265 additions and 192 deletions
+3 -27
View File
@@ -1,27 +1,3 @@
# ---> CakePHP
# CakePHP 3
/vendor/*
/config/app.php
/tmp/cache/models/*
!/tmp/cache/models/empty
/tmp/cache/persistent/*
!/tmp/cache/persistent/empty
/tmp/cache/views/*
!/tmp/cache/views/empty
/tmp/sessions/*
!/tmp/sessions/empty
/tmp/tests/*
!/tmp/tests/empty
/logs/*
!/logs/empty
# CakePHP 2
/app/tmp/*
/app/Config/core.php
/app/Config/database.php
/vendors/*
scans/
datadir/script-args.ini
test.php
-11
View File
@@ -1,11 +0,0 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
+18 -2
View File
@@ -1,3 +1,19 @@
# LanScan
# nmap-webui
A simple web interface for Nmap for network discovery and monitoring
Web UI for nmap
## Dependencies
As most of the `nmap` features requires to be `root`, you will have to run this command to avoid the need to specify the password when the interface will invocate `nmap`.
```bash
# Authorize nmap to run as root without password
echo "$USER ALL = NOPASSWD: $(which nmap)" | sudo tee -a /etc/sudoers.d/nmap
```
Allow web server to save scans:
```bash
mkdir scans
chown www-data scans
chmod 750 scans
```
+8
View File
@@ -0,0 +1,8 @@
<?php
$port = (($_SERVER['REQUEST_SCHEME'] == "http" && $_SERVER['SERVER_PORT'] == 80) || ($_SERVER['REQUEST_SCHEME'] == "https" && $_SERVER['SERVER_PORT'] == 443)) ? "" : ":{$_SERVER['SERVER_PORT']}";
$BASEDIR = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}$port" . dirname($_SERVER['SCRIPT_NAME']);
$SCANSDIR = "scans";
$STYLESHEETSDIR = "stylesheets";
$lanScanCmd = "sudo nmap -PSmicrosoft-ds -F -T5 -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl";
$hostScanCmd = "sudo nmap -A -T5 -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/hostScan.xsl";
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

+102
View File
@@ -0,0 +1,102 @@
<?php include_once "config.php"; ?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<title>lanScan</title>
<link rel="icon" href="favicon.ico" />
<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="style.css" />
<style>
body > .grid {
height: 100%;
}
.logo {
margin-right: 0 !important;
}
</style>
</head>
<body>
<div class="ui middle aligned center aligned grid inverted">
<div class="column" style="max-width: 450px;">
<h2 class="ui inverted teal fluid image header logo">
lan<?php include 'logo.svg'; ?>can
</h2>
<form id="scanForm" class="ui large form initial inverted" action="." method="get">
<div class="ui left aligned stacked segment inverted">
<h4 class="ui header">Découvrir ou superviser un réseau</h4>
<div class="inverted field">
<select id="lanSelect" name="lan" class="search clearable selection dropdown">
<option value=""><?= $_SERVER['REMOTE_ADDR']; ?>/24</option>
<?php
if (file_exists($SCANSDIR)) {
foreach (scandir($SCANSDIR) as $filename) {
if (substr($filename, -4) === '.xml') {
$name = substr($filename, 0, -4);
$name = str_replace("!", "/", $name);
echo " <option value='$name'>$name</option>\n";
}
}
}
?>
</select>
</div>
<div class="ui error message"></div>
<button type="submit" class="ui fluid large teal labeled icon submit button">
<i class="satellite dish icon"></i>Scanner
</button>
</div>
</form>
<div class="ui inverted segment">
<a href="options.php">Options avancées</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui/dist/semantic.min.js"></script>
<script>
$('#lanSelect').dropdown({allowAdditions: true, clearable: true})
$('#scanForm').form({
fields: {
lan: {
identifier: 'lanSelect',
rules: [{
type: 'regExp',
value: /[a-zA-Z0-9._\/ \-]+/,
prompt: "Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.<br/>Exemples : <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254"
}]
}
}
});
scanForm.onsubmit = function(event) {
if (this.checkValidity()) {
scanForm.classList.add("loading")
$.toast({
title : 'Scan en cours...',
message : 'Merci de patienter',
class : 'info',
showIcon : 'satellite dish',
displayTime: 0,
closeIcon : true,
position : 'bottom right',
})
return true
} else {
event.preventDefault()
this.reportValidity()
}
}
</script>
</body>
</html
+102
View File
@@ -0,0 +1,102 @@
<?php include_once "config.php"; ?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<title>lanScan</title>
<link rel="icon" href="favicon.ico" />
<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="style.css" />
<style>
body > .grid {
height: 100%;
}
.logo {
margin-right: 0 !important;
}
</style>
</head>
<body>
<div class="ui middle aligned center aligned grid inverted">
<div class="column" style="max-width: 450px;">
<h2 class="ui inverted teal fluid image header logo">
lan<?php include 'logo.svg'; ?>can
</h2>
<form id="scanForm" class="ui large form initial inverted" action="scan.php" method="get">
<div class="ui left aligned stacked segment inverted">
<h4 class="ui header">Découvrir ou superviser un réseau</h4>
<div class="inverted field">
<select id="lanSelect" name="lan" class="search clearable selection dropdown">
<option value=""><?= $_SERVER['REMOTE_ADDR']; ?>/24</option>
<?php
if (file_exists($SCANSDIR)) {
foreach (scandir($SCANSDIR) as $filename) {
if (substr($filename, -4) === '.xml') {
$name = substr($filename, 0, -4);
$name = str_replace("!", "/", $name);
echo " <option value='$name'>$name</option>\n";
}
}
}
?>
</select>
</div>
<div class="ui error message"></div>
<button type="submit" class="ui fluid large teal labeled icon submit button">
<i class="satellite dish icon"></i>Scanner
</button>
</div>
</form>
<div class="ui inverted segment">
<a href="options.php">Options avancées</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui/dist/semantic.min.js"></script>
<script>
$('#lanSelect').dropdown({allowAdditions: true, clearable: true})
$('#scanForm').form({
fields: {
lan: {
identifier: 'lanSelect',
rules: [{
type: 'regExp',
value: /[a-zA-Z0-9._\/ \-]+/,
prompt: "Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.<br/>Exemples : <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254"
}]
}
}
});
scanForm.onsubmit = function(event) {
if (this.checkValidity()) {
scanForm.classList.add("loading")
$.toast({
title : 'Scan en cours...',
message : 'Merci de patienter',
class : 'info',
showIcon : 'satellite dish',
displayTime: 0,
closeIcon : true,
position : 'bottom right',
})
return true
} else {
event.preventDefault()
this.reportValidity()
}
}
</script>
</body>
</html
Executable
+53
View File
@@ -0,0 +1,53 @@
<svg class="image logo" version="1.1" id="Layer_1" x="0px" y="0px"
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
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>

After

Width:  |  Height:  |  Size: 2.0 KiB

+15
View File
@@ -0,0 +1,15 @@
<?php
$host = filter_input(INPUT_GET, 'v', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) ?: filter_input(INPUT_GET, 'v', FILTER_VALIDATE_IP);
if (!$host) {
exit();
}
$port = filter_input(INPUT_GET, 'p', FILTER_VALIDATE_INT);
if ($port) {
$host = "$host:$port";
}
header("Content-Disposition: attachment; filename=$host.rdp");
header('Content-Type: application/rdp');
echo "full address:s:$host\n";
+37
View File
@@ -0,0 +1,37 @@
<?php
include_once 'config.php';
$lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[\da-zA-Z-. \/]+$/'], "flags" => FILTER_NULL_ON_FAILURE]);
if ($lan) {
$cmd = "$lanScanCmd $lan";
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
$filename = str_replace("/", "!", $lan);
$path = "$SCANSDIR/$filename.xml";
if (!file_exists($path)) $cmd .= " | tee '$path'";
header('Content-type: text/xml');
system("$cmd", $retcode);
exit();
}
$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[\da-zA-Z-. \/]+$/'], "flags" => FILTER_NULL_ON_FAILURE]);
if ($host) {
$cmd = "$hostScanCmd $host";
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
$filename = str_replace("/", "!", $host);
$path = "$SCANSDIR/$filename.xml";
if (!file_exists($path)) $cmd .= " | tee '$path'";
header('Content-type: text/xml');
system("$cmd", $retcode);
exit();
}
include "index.php";
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE nmaprun>
<?xml-stylesheet href="https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl" type="text/xsl"?>
<!-- Nmap 7.93 scan initiated Tue Feb 4 03:30:34 2025 as: nmap -PSmicrosoft-ds -F -T5 -oX - -&#45;stylesheet https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -PSmicrosoft-ds -F -T5 -oX - -&#45;stylesheet https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl scanme.nmap.org" start="1738636234" startstr="Tue Feb 4 03:30:34 2025" version="7.93" xmloutputversion="1.05">
<scaninfo type="syn" protocol="tcp" numservices="100" services="7,9,13,21-23,25-26,37,53,79-81,88,106,110-111,113,119,135,139,143-144,179,199,389,427,443-445,465,513-515,543-544,548,554,587,631,646,873,990,993,995,1025-1029,1110,1433,1720,1723,1755,1900,2000-2001,2049,2121,2717,3000,3128,3306,3389,3986,4899,5000,5009,5051,5060,5101,5190,5357,5432,5631,5666,5800,5900,6000-6001,6646,7070,8000,8008-8009,8080-8081,8443,8888,9100,9999-10000,32768,49152-49157"/>
<verbose level="0"/>
<debugging level="0"/>
<hosthint><status state="up" reason="unknown-response" reason_ttl="0"/>
<address addr="45.33.32.156" addrtype="ipv4"/>
<hostnames>
<hostname name="scanme.nmap.org" type="user"/>
</hostnames>
</hosthint>
<host starttime="1738636234" endtime="1738636234"><status state="up" reason="reset" reason_ttl="48"/>
<address addr="45.33.32.156" addrtype="ipv4"/>
<hostnames>
<hostname name="scanme.nmap.org" type="user"/>
<hostname name="scanme.nmap.org" type="PTR"/>
</hostnames>
<ports><extraports state="closed" count="98">
<extrareasons reason="reset" count="98" proto="tcp" ports="7,9,13,21,23,25-26,37,53,79,81,88,106,110-111,113,119,135,139,143-144,179,199,389,427,443-445,465,513-515,543-544,548,554,587,631,646,873,990,993,995,1025-1029,1110,1433,1720,1723,1755,1900,2000-2001,2049,2121,2717,3000,3128,3306,3389,3986,4899,5000,5009,5051,5060,5101,5190,5357,5432,5631,5666,5800,5900,6000-6001,6646,7070,8000,8008-8009,8080-8081,8443,8888,9100,9999-10000,32768,49152-49157"/>
</extraports>
<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="48"/><service name="ssh" method="table" conf="3"/></port>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="48"/><service name="http" method="table" conf="3"/></port>
</ports>
<times srtt="153298" rttvar="2254" to="162314"/>
</host>
<runstats><finished time="1738636234" timestr="Tue Feb 4 03:30:34 2025" summary="Nmap done at Tue Feb 4 03:30:34 2025; 1 IP address (1 host up) scanned in 1.05 seconds" elapsed="1.05" exit="success"/><hosts up="1" down="0" total="1"/>
</runstats>
</nmaprun>
+76
View File
@@ -0,0 +1,76 @@
body {
background-color: #1b1c1d;
}
.logo {
display: flex !important;
justify-content: center;
align-items: center;
width: fit-content;
}
.logo svg {
width: 2.5em;
height: 2.5em;
fill: currentColor;
margin: -0.4em !important;
}
.tagify {
width: 100%;
border-radius: 0.28571429rem;
--tags-focus-border-color: #85b7d9;
--placeholder-color: rgba(191, 191, 191, 0.87);
--placeholder-color-focus: rgba(115, 115, 115, 0.87);
}
.ui.table {
caption-side: bottom;
}
.ui.label {
margin: 0.14285714em;
}
.ui.label > .detail {
margin-left: 0.3em;
text-transform: capitalize;
}
.ui.form .fields > .field {
width: 100%;
}
.ui.ui.form .field .fields .field:not(:only-child) .ui.checkbox {
margin-top: 0;
}
.ui.dropdown.label {
min-width: auto;
}
.ui.dropdown.label > .remove.icon {
right: 2.3em;
}
.toast-container .ui.header {
text-transform: capitalize;
}
.share-size {
--free-ratio: calc(var(--free) / var(--total));
--used-percent: calc(100% - 100% * var(--free-ratio));
--color: hsl(calc(120 * var(--free-ratio)) 100% 50%);
background-image: linear-gradient(
to right,
var(--color) var(--used-percent),
transparent var(--used-percent),
transparent
) !important;
text-align: center !important;
font-size: .64285714rem !important;
}
.ui.card .table {
overflow-x: auto;
}
-152
View File
@@ -1,152 +0,0 @@
<?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="2.0">
<xsl:output method="html" encoding="UTF-8" />
<xsl:output indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="nmaprun">
<html lang="fr">
<head>
<meta charset="utf-8" />
<title><xsl:value-of select="./@args" /></title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
.btn {
margin: 2px;
padding: 2px 6px !important;
}
.badge {
margin: 0px;
padding: 2px 4px !important;
}
</style>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs5/jq-3.6.0/dt-1.12.1/b-2.2.3/b-html5-2.2.3/b-print-2.2.3/cr-1.5.6/fc-4.1.0/fh-3.2.3/r-2.3.0/rr-1.2.8/sc-2.0.6/datatables.min.css"/>
</head>
<body>
<table id="scanResults" class="table table-striped table-hover compact caption-top" style="width:100%">
<thead>
<tr>
<th>Adresse IP</th>
<th>Nom DNS</th>
<th>Services</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="host[status/@state='up']">
<tr>
<td>
<xsl:value-of select="address/@addr" />
</td>
<td>
<xsl:value-of select="hostnames/hostname/@name" />
</td>
<td>
<xsl:for-each select="ports/port[state/@state='open']">
<a target="_blank" style="text-transform:uppercase;" type="button" class="btn btn-success btn-sm">
<xsl:variable name="protocol">
<xsl:choose>
<xsl:when test="service/@name='http' or service/@name='https' or service/@name='http-alt' or @portid = 8006 or @portid = 9292 or @portid = 20618">
<xsl:choose>
<xsl:when test="service/@tunnel='ssl' or script[@id='ssl-cert'] or script[@id='ssl-date']">
<xsl:text>https://</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>http://</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="service/@name='ftp' or service/@name='ssh' or service/@name='telnet'">
<xsl:value-of select="service/@name" />
<xsl:text>://</xsl:text>
</xsl:when>
<xsl:when test="service/@name = 'microsoft-ds' or service/@name = 'netbios-ssn'">
<xsl:text>file://///</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$protocol != ''">
<xsl:attribute name="href">
<xsl:value-of select="$protocol" />
<xsl:choose>
<xsl:when test="count(../../hostnames/hostname) > 0">
<xsl:value-of select="../../hostnames/hostname/@name" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="../../address/@addr" />
</xsl:otherwise>
</xsl:choose>
<xsl:text>:</xsl:text>
<xsl:value-of select="@portid"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">
btn btn-success btn-sm disabled
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="title">
<xsl:for-each select="service/@*">
<xsl:value-of select="concat(name(), ': ', ., ', ')"/>
</xsl:for-each>
</xsl:attribute>
<span class="badge bg-secondary rounded-pill"><xsl:value-of select="@portid"/></span>
<xsl:value-of select="service/@name" />
</a>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</tbody>
<caption>
<pre class="mb-0" style="white-space:pre-wrap; word-wrap:break-word;">
<xsl:value-of select="/nmaprun/@args" />
</pre>
<time>
<xsl:value-of select="/nmaprun/@startstr" />
</time> - <time>
<xsl:value-of select="/nmaprun/runstats/finished/@timestr" />
</time><br />
<small>
<xsl:value-of select="/nmaprun/@scanner" /> v
<xsl:value-of select="/nmaprun/@version" />
</small>
</caption>
</table>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs5/jq-3.6.0/dt-1.12.1/b-2.2.3/b-html5-2.2.3/b-print-2.2.3/cr-1.5.6/fc-4.1.0/fh-3.2.3/r-2.3.0/rr-1.2.8/sc-2.0.6/datatables.min.js"></script>
<script>
$(document).ready( function() {
$('#scanResults').DataTable({
fixedHeader: true,
lengthMenu: [
[256, 512, 1024, 2048, -1],
[256, 512, 1024, 2048, "All"]
],
scrollCollapse: true,
paging: false,
responsive: true,
});
} );
</script>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
+41
View File
@@ -0,0 +1,41 @@
<?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 match="nmaprun" mode="head">
<xsl:param name="base" />
<xsl:param name="targets" />
<head>
<meta charset="utf-8" />
<meta http-equiv="refresh" content="300" />
<title>lanScan - <xsl:value-of select="$targets" />
</title>
<base href="{$base}" />
<link rel="icon" href="favicon.ico" />
<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.datatables.net/v/se/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/fc-5.0.3/fh-4.0.1/r-3.0.3/datatables.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js"></script>
<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>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/v/se/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/fc-5.0.3/fh-4.0.1/r-3.0.3/datatables.min.js"></script>
<script>
DataTable.ext.type.detect.unshift(function (d) {
return /[\d]+\.[\d]+\.[\d]+\.[\d]+/.test(d)
? 'ipv4-address'
: null;
});
DataTable.ext.type.order['ipv4-address-pre'] = function (ipAddress) {
[a, b, c, d] = ipAddress.split(".").map(Number)
return 16777216*a + 65536*b + 256*c + d;
};
</script>
</head>
</xsl:template>
</xsl:stylesheet>
+337
View File
@@ -0,0 +1,337 @@
<?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:import href="head.xsl" />
<xsl:import href="nav.xsl" />
<xsl:import href="services.xsl" />
<xsl:import href="toast.xsl" />
<xsl:output method="html" encoding="UTF-8" />
<xsl:output indent="yes" />
<xsl:strip-space elements='*' />
<xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'), '&quot;')" />
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
<xsl:template match="nmaprun">
<xsl:variable name="targets" select="substring-after(@args, '.xsl ')" />
<xsl:variable name="current" select="." />
<xsl:variable name="init" select="document(concat($base, 'scans/', translate($targets,'/', '!'), '.xml'))/nmaprun" />
<html lang="fr">
<xsl:apply-templates select="." mode="head">
<xsl:with-param name="base" select="$base" />
<xsl:with-param name="targets" select="$targets" />
</xsl:apply-templates>
<body>
<xsl:apply-templates select="." mode="nav">
</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:with-param name="init" select="$init" />
<xsl:with-param name="current" select="$current" />
</xsl:apply-templates>
</main>
<script>
$('.ui.tree.accordion').accordion()
$('.ui.dropdown').dropdown()
</script>
<xsl:apply-templates select="runstats">
<xsl:with-param name="init" select="$init" />
</xsl:apply-templates>
</body>
</html>
</xsl:template>
<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="hostAddress">
<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>
</xsl:variable>
<h1>
<xsl:attribute name="class">
<xsl:text>ui inverted header </xsl:text>
<xsl:choose>
<xsl:when test="$currentHost/status/@state='up'">green</xsl:when>
<xsl:otherwise>red</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<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>
<xsl:value-of select="os/osmatch/@name" />
</td>
</xsl:if>
<xsl:if test="distance/@value">
<td>
<xsl:value-of select="distance/@value" />
<xsl:text> rebonds</xsl:text>
</td>
</xsl:if>
<xsl:if test="uptime/@lastboot">
<td>
<xsl:value-of select="uptime/@lastboot" />
</td>
</xsl:if>
</tr>
</tbody>
</table>
<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>
<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: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: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 inverted card {$color}">
<div class="content">
<div class="header">
<div class="ui {$color} ribbon label" style="text-transform: uppercase">
<xsl:value-of select="@protocol" />
<xsl:text>:</xsl:text>
<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">
<xsl:attribute name="href" target="_blank">
<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>
Ouvrir
</a>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="script">
<div class="ui inverted accordion">
<div class="title">
<i class="dropdown icon"></i>
<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 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 inverted fixed definition table">
<tbody>
<xsl:apply-templates select="elem" />
</tbody>
</table>
</xsl:if>
<xsl:apply-templates select="table" />
</div>
</div>
</xsl:when>
<xsl:when test="elem">
<table class="ui small inverted fixed definition table">
<tbody>
<xsl:apply-templates select="elem" />
</tbody>
</table>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="elem">
<tr>
<td>
<xsl:value-of select="@key" />
</td>
<td>
<xsl:value-of select="." />
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
+167
View File
@@ -0,0 +1,167 @@
<?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:import href="head.xsl" />
<xsl:import href="nav.xsl" />
<xsl:import href="services.xsl" />
<xsl:import href="toast.xsl" />
<xsl:output method="html" encoding="UTF-8" />
<xsl:output indent="yes" />
<xsl:strip-space elements='*' />
<xsl:variable name="stylesheetURL"
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'), '&quot;')" />
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
<xsl:template match="nmaprun">
<xsl:variable name="targets" select="substring-after(@args, '.xsl ')" />
<xsl:variable
name="current" select="." />
<xsl:variable name="init"
select="document(concat($base, 'scans/', translate($targets,'/', '!'), '.xml'))/nmaprun" />
<html
lang="fr">
<xsl:apply-templates select="." mode="head">
<xsl:with-param name="base" select="$base" />
<xsl:with-param name="targets" select="$targets" />
</xsl:apply-templates>
<body>
<xsl:apply-templates select="." mode="nav">
</xsl:apply-templates>
<main class="ui main container inverted segment">
<h1>
<xsl:value-of select="$targets" />
</h1>
<table id="scanResultsTable" style="width:100%" role="grid"
class="ui sortable small stuck striped table">
<thead>
<tr>
<th style="width: min-width">Etat</th>
<th>Adresse IP</th>
<th>Nom</th>
<th>Constructeur</th>
<th class="six wide">Services</th>
<th style="width: min-width"></th>
</tr>
</thead>
<tbody>
<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>
</tbody>
</table>
</main>
<script>
var table = $('#scanResultsTable').DataTable({
buttons : ['copy', 'excel', 'pdf'],
fixedHeader: true,
lengthMenu : [
[256, 512, 1024, 2048, -1],
[256, 512, 1024, 2048, "All"]
],
responsive: true,
colReorder: true,
buttons : ['copy', 'excel', 'pdf']
})
table.order([1, 'asc']).draw()
$('.ui.dropdown').dropdown()
</script>
<xsl:apply-templates select="runstats">
<xsl:with-param name="init" select="$init" />
</xsl:apply-templates>
</body>
</html>
</xsl:template>
<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="hostAddress">
<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>
</xsl:variable>
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="$currentHost/status/@state='up'">positive</xsl:when>
<xsl:otherwise>negative</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td>
<xsl:choose>
<xsl:when test="$currentHost">
<div>
<xsl:attribute name="class">
<xsl:text>ui mini circular 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:when>
<xsl:otherwise><div class="ui red circular label">down</div></xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:value-of select="address/@addr" />
</td>
<td>
<b>
<xsl:value-of select="substring-before(hostnames/hostname/@name, '.')" />
</b>
<xsl:if test="substring-after(hostnames/hostname/@name, '.')">
<wbr />.<xsl:value-of select="substring-after(hostnames/hostname/@name, '.')" />
</xsl:if>
</td>
<td>
<xsl:value-of select="address[@addrtype='mac']/@vendor" />
</td>
<td>
<xsl:apply-templates
select="$initHost/ports/port[not(@portid=$currentHost/ports/port/@portid)][not(state/@state='closed')] | $currentHost/ports/port"
mode="service">
<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">
<xsl:attribute name="href">scan.php?host=<xsl:value-of select="$hostAddress" /></xsl:attribute>
<i class="search plus icon"></i>
</a>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
+61
View File
@@ -0,0 +1,61 @@
<?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 match="nmaprun" mode="nav">
<nav class="ui inverted secondary menu">
<h3>
<a href="." class="button item logo">lan<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"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs206"></defs>
<g id="g998" transform="matrix(0,0.04687491,-0.04687491,0,24,2.2682373e-5)">
<g id="g147">
<g id="g145">
<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"></path>
</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"></path>
</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"></path>
</g>
</g>
<g id="g165">
<g id="g163">
<rect x="87.027" y="41.925999" width="80.040001" height="138.481" id="rect161"></rect>
</g>
</g>
<g id="g171">
<g id="g169">
<rect x="344.93301" y="329.052" width="80.040001" height="138.481" id="rect167"></rect>
</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>
can</a>
</h3>
</nav>
</xsl:template>
</xsl:stylesheet>
+1071
View File
File diff suppressed because it is too large Load Diff
+99
View File
@@ -0,0 +1,99 @@
<?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 match="port" mode="service">
<xsl:param name="hostAddress"/>
<xsl:param name="initHost"/>
<xsl:param name="currentHost"/>
<xsl:param name="class"/>
<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:value-of select="$class"/>
<xsl:text> </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>&amp;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>
+44
View File
@@ -0,0 +1,44 @@
<?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 match="runstats">
<xsl:param name="init"/>
<script>
<xsl:if test="finished/@summary">
$.toast({
title : '<xsl:value-of select="finished/@exit"/>',
message : `<xsl:value-of select="finished/@summary"/>`,
showIcon : 'satellite dish',
displayTime: 0,
closeIcon : true,
position : 'bottom right',
})
</xsl:if>
<xsl:if test="finished/@errormsg">
$.toast({
title : '<xsl:value-of select="finished/@exit"/>',
message : `<xsl:value-of select="finished/@errormsg"/>`,
showIcon : 'exclamation triangle',
class : 'error',
displayTime: 0,
closeIcon : true,
position : 'bottom right',
})
</xsl:if>
<xsl:if test="$init/runstats/finished">
$.toast({
message : 'Comparaison avec les résultats du ' + new Date("<xsl:value-of select="$init/runstats/finished/@timestr"/>").toLocaleString(),
class : 'info',
showIcon : 'calendar',
displayTime: 0,
closeIcon : true,
position : 'bottom right',
})
</xsl:if>
</script>
</xsl:template>
</xsl:stylesheet>