Hanno Böck commited on 2025-04-29 13:44:27
Zeige 1 geänderte Dateien mit 32 Einfügungen und 0 Löschungen.
... | ... |
@@ -0,0 +1,32 @@ |
1 |
+#!/usr/bin/php |
|
2 |
+<?php |
|
3 |
+ |
|
4 |
+/* |
|
5 |
+ |
|
6 |
+ SPDX-License-Identifier: 0BSD |
|
7 |
+ schokokeks.org Hosting, https://schokokeks.org/ |
|
8 |
+ |
|
9 |
+ Checks dyndns keys in database with filter_ssh_key() |
|
10 |
+*/ |
|
11 |
+ |
|
12 |
+if (PHP_SAPI !== 'cli') { |
|
13 |
+ die("cli only"); |
|
14 |
+} |
|
15 |
+ |
|
16 |
+require_once("config.php"); |
|
17 |
+require_once("inc/security.php"); |
|
18 |
+require_once("inc/theme.php"); |
|
19 |
+require_once("session/checkuser.php"); |
|
20 |
+ |
|
21 |
+$res = db_query("SELECT sshkey FROM dns.dyndns WHERE sshkey IS NOT NULL"); |
|
22 |
+ |
|
23 |
+while ($ob = $res->fetch()) { |
|
24 |
+ $key = $ob["sshkey"]; |
|
25 |
+ $fkey = filter_ssh_key($key, $hash); |
|
26 |
+ if ($key !== $fkey) { |
|
27 |
+ echo "Does not match:\n"; |
|
28 |
+ echo $key . "\n"; |
|
29 |
+ echo $fkey . "\n"; |
|
30 |
+ echo "Fingerprint: $hash"; |
|
31 |
+ } |
|
32 |
+} |
|
0 | 33 |