commit e93d37cacda0d9140f3a98572b9d6bba07278b4e Author: adrien Date: Mon Apr 3 22:43:26 2023 +0200 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..85aa2a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +scans/ diff --git a/first_scan.sh b/first_scan.sh new file mode 100644 index 0000000..61a45f9 --- /dev/null +++ b/first_scan.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +### +# +# Scan un réseau avec nmap pour créer un fichier de configuration +# +### + +echo "Nom du site ?" +read name +echo "Plage IP (xxx.xxx.xxx.xxx/xx) ?" +read network +nmap --script smb-enum-shares.nse -oX "scans/$name.xml" $network +xsltproc toyaml.xsl "scans/$name.xml" > "scans/$name.yaml" diff --git a/index.php b/index.php new file mode 100644 index 0000000..3a736f1 --- /dev/null +++ b/index.php @@ -0,0 +1,12 @@ + diff --git a/logo.svg b/logo.svg new file mode 100644 index 0000000..a5f8c6e --- /dev/null +++ b/logo.svg @@ -0,0 +1,53 @@ + \ No newline at end of file diff --git a/ls.php b/ls.php new file mode 100644 index 0000000..8696b1b --- /dev/null +++ b/ls.php @@ -0,0 +1,35 @@ + + + + + + lanScan + + + + + +
+ +
+
+
+$site\n"; + } +} ?> +
+
+ + \ No newline at end of file diff --git a/rdp.php b/rdp.php new file mode 100644 index 0000000..53d7b39 --- /dev/null +++ b/rdp.php @@ -0,0 +1,6 @@ + diff --git a/rescan_all.php b/rescan_all.php new file mode 100644 index 0000000..9ddb9d0 --- /dev/null +++ b/rescan_all.php @@ -0,0 +1,26 @@ + $hosts) { + foreach($hosts as $hostaddress => $servicesList) { + $targets[$hostaddress] = true; + foreach ($servicesList as $service) { + $services[$service] = true; + } + } + } + + $targets = array_keys($targets); + $services = array_keys($services); + + exec("nmap -v -Pn -p ".join($services, ",")." --script smb-enum-shares.nse -oX 'scans/$site.xml' ".join($targets, " ")); + } +}; + +?> diff --git a/results.php b/results.php new file mode 100644 index 0000000..b6738c5 --- /dev/null +++ b/results.php @@ -0,0 +1,124 @@ + + + + + + + lanScan - <?=$site?> + + + + + +
+ +
+
+
+

+ runstats->finished["summary"]?> +
+ $conf_hosts) { ?> +

+
+ $conf_services) { + echo " \n"; + $scan_host = $scan->xpath("host[hostnames/hostname/@name='$conf_address' or address/@addr='$conf_address']")[0]; + $short_name = preg_match("/^[\d\.]+$/", $conf_address) ? $conf_address : strtok($conf_address, ".")." (".$scan_host->address["addr"].")"; + $address = count($scan_host->xpath("hostnames/hostname/@name")) ? $scan_host->xpath("hostnames/hostname/@name")[0] : $scan_host->xpath("address/@addr")[0]; + if ($scan_host->status["state"] =="up") { +?> +
+
+
+
">
+xpath("ports/port[service/@name='$conf_service' or @portid='$conf_service']")[0]; + $state = $scan_service->state["state"] == "open" ? "text-bg-primary" : "text-bg-danger"; + switch($scan_service->service['name']) { + case "microsoft-ds": + case "netbios-ssn": + $shares = $scan_host->xpath("hostscript/script[@id='smb-enum-shares']/table[not(contains(@key, '$'))]"); + if (count($shares)) { +?> + + + service['name']?> + + service['name']?> + + service['name']?> + + service['name']?> + + service['name']?> + +
+
+
+ +
+
+
+
">
+
+
+
+ +
+ +
+ + diff --git a/toyaml.xsl b/toyaml.xsl new file mode 100644 index 0000000..7e70130 --- /dev/null +++ b/toyaml.xsl @@ -0,0 +1,28 @@ + + + + + +--- + +: + + + + + + + + +: [] + + + + +, + + + \ No newline at end of file