|
8 | 8 | * License: GNU/GPLv2 |
9 | 9 | * @see LICENSE.txt |
10 | 10 | * |
11 | | - * This file: Optional security extras module (last modified: 2025.08.29). |
| 11 | + * This file: Optional security extras module (last modified: 2025.09.03). |
12 | 12 | * |
13 | 13 | * False positive risk (an approximate, rough estimate only): « [ ]Low [x]Medium [ ]High » |
14 | 14 | */ |
|
449 | 449 | if ($Trigger(preg_match('~(?:^|[/?])wallet\.dat(?:$|[/?])~', $LCNrURI), 'Probing for exposed Bitcoin wallets')) { |
450 | 450 | $CIDRAM['Reporter']->report([15], ['Caught probing for exposed Bitcoin wallets.'], $CIDRAM['BlockInfo']['IPAddr']); |
451 | 451 | } // 2025.08.29 |
| 452 | + |
| 453 | + /** Malware spam redirection attempt. */ |
| 454 | + if ($Trigger(preg_match('~(?:^|[/?])(?:__media__/js|netsoltrademark\.php)(?:$|[/?])~', $LCNrURI), 'Malware spam redirection attempt detected')) { |
| 455 | + $CIDRAM['Reporter']->report([10, 20], ['Malware spam redirection attempt detected.'], $CIDRAM['BlockInfo']['IPAddr']); |
| 456 | + } // 2025.09.03 |
| 457 | + |
| 458 | + /** Probing for exposed etc/passwd file. */ |
| 459 | + if ($Trigger(preg_match('~(?:^|[/?])etc(?:/|%2f)passwd(?:$|[/?])~', $LCNrURI), 'Probing for exposed etc/passwd file')) { |
| 460 | + $CIDRAM['Reporter']->report([15], ['Caught probing for exposed etc/passwd file.'], $CIDRAM['BlockInfo']['IPAddr']); |
| 461 | + } // 2025.09.03 |
| 462 | + |
| 463 | + /** Probing for exposed etc/hosts file. */ |
| 464 | + if ($Trigger(preg_match('~(?:^|[/?])etc(?:/|%2f)hosts(?:$|[/?])~', $LCNrURI), 'Probing for exposed etc/hosts file')) { |
| 465 | + $CIDRAM['Reporter']->report([15], ['Caught probing for exposed etc/hosts file.'], $CIDRAM['BlockInfo']['IPAddr']); |
| 466 | + } // 2025.09.03 |
| 467 | + |
| 468 | + /** Probing for exposed etc/shadow file. */ |
| 469 | + if ($Trigger(preg_match('~(?:^|[/?])etc(?:/|%2f)shadow(?:$|[/?])~', $LCNrURI), 'Probing for exposed etc/shadow file')) { |
| 470 | + $CIDRAM['Reporter']->report([15], ['Caught probing for exposed etc/shadow file.'], $CIDRAM['BlockInfo']['IPAddr']); |
| 471 | + } // 2025.09.03 |
| 472 | + |
| 473 | + if ($Trigger(preg_match('~\?1+1&&|\)%7d%7d%2f~', $LCNrURI), 'SQLi attack')) { |
| 474 | + $CIDRAM['Reporter']->report([15, 16], ['SQL injection attack detected.'], $CIDRAM['BlockInfo']['IPAddr']); |
| 475 | + } // 2025.09.03 |
452 | 476 | } |
453 | 477 |
|
454 | 478 | /** |
|
559 | 583 | $Trigger(strpos($CIDRAM['BlockInfo']['Query'], ',0x') !== false, 'Bad query'); // 2017.02.25 |
560 | 584 | $Trigger(strpos($CIDRAM['BlockInfo']['Query'], ',\'\',') !== false, 'Bad query'); // 2017.02.25 |
561 | 585 |
|
562 | | - $Trigger(preg_match('/(?<![a-z])id=.*(?:benchmark\\(|id[xy]=|sleep\\()/', $QueryNoSpace), 'Query SQLi'); // 2017.03.01 mod 2023.11.10 |
563 | | - $Trigger(preg_match('~(?:from|union|where).*select|then.*else|(?:o[nr]|where).*isnull|(?:inner|left|outer|right)join~', $QueryNoSpace), 'Query SQLi'); // 2017.03.01 mod 2023.08.30 |
| 586 | + if ($Trigger(preg_match( |
| 587 | + '~(?<![a-z])id=.*(?:benchmark\\(|id[xy]=|sleep\\()|(?:from|union|where).*select|then.*else|(?:o[nr]|where).*isnull|(?:inner|left|outer|right)join~', |
| 588 | + $QueryNoSpace |
| 589 | + ), 'SQLi attack')) { |
| 590 | + $CIDRAM['Reporter']->report([15, 16], ['SQL injection attack detected.'], $CIDRAM['BlockInfo']['IPAddr']); |
| 591 | + } // 2017.03.01 mod 2025.09.03 |
564 | 592 |
|
565 | 593 | $Trigger(preg_match('/cpis_.*i0seclab@intermal\.com/', $QueryNoSpace), 'Hack attempt'); // 2018.02.20 |
566 | 594 | $Trigger(preg_match('/^(?:3x=3x|of=1&a=1)/i', $CIDRAM['BlockInfo']['Query']), 'Hack attempt'); // 2023.07.13 mod 2023.09.02 |
|
679 | 707 | $CIDRAM['Reporter']->report([15, 21], ['Plesk hack attempt detected.'], $CIDRAM['BlockInfo']['IPAddr']); |
680 | 708 | } elseif (strpos($CIDRAM['BlockInfo']['WhyReason'], 'Probe attempt') !== false) { |
681 | 709 | $CIDRAM['Reporter']->report([19], ['Probe detected.'], $CIDRAM['BlockInfo']['IPAddr']); |
682 | | - } elseif (strpos($CIDRAM['BlockInfo']['WhyReason'], 'Query SQLi') !== false) { |
683 | | - $CIDRAM['Reporter']->report([16], ['SQL injection attempt detected.'], $CIDRAM['BlockInfo']['IPAddr']); |
684 | 710 | } elseif (strpos($CIDRAM['BlockInfo']['WhyReason'], 'Query command injection') !== false) { |
685 | 711 | $CIDRAM['Reporter']->report([15], ['Query command injection attempt detected.'], $CIDRAM['BlockInfo']['IPAddr']); |
686 | 712 | } elseif (strpos($CIDRAM['BlockInfo']['WhyReason'], 'Query global variable hack') !== false) { |
|
0 commit comments