|
8 | 8 | * License: GNU/GPLv2 |
9 | 9 | * @see LICENSE.txt |
10 | 10 | * |
11 | | - * This file: Referrer spam module (last modified: 2026.03.18). |
| 11 | + * This file: Referrer spam module (last modified: 2026.08.16). |
12 | 12 | * |
13 | 13 | * False positive risk (an approximate, rough estimate only): « [ ]Low [x]Medium [ ]High » |
14 | 14 | */ |
|
202 | 202 | ], $this->BlockInfo['IPAddr']); |
203 | 203 | } // 2023.06.16 |
204 | 204 |
|
205 | | - if ($this->trigger(\preg_match('~//blog//wp-login\.php$~i', $this->BlockInfo['Referrer']), 'Hack attempt via referrer header injection detected')) { |
206 | | - $this->Reporter->report([10, 15, 21], ['Hack attempt via referrer header injection detected.'], $this->BlockInfo['IPAddr']); |
207 | | - } // 2025.07.24 |
| 205 | + if ($this->BlockInfo['rURI'] !== '' && ($PDPos = \strpos($this->BlockInfo['rURI'], '://')) !== false) { |
| 206 | + $SPos = \strpos(\substr($this->BlockInfo['rURI'], $PDPos + 3), '/'); |
| 207 | + $Auth = $SPos === false ? $this->BlockInfo['rURI'] : \substr($this->BlockInfo['rURI'], 0, $SPos + $PDPos + 3); |
| 208 | + $AuthLen = \strlen($Auth); |
| 209 | + if ($Auth !== \substr($this->BlockInfo['Referrer'], 0, $AuthLen)) { |
| 210 | + if ($this->trigger(\preg_match('~//wp-login\.php$~i', $this->BlockInfo['Referrer']), 'Hack attempt via referrer header injection detected')) { |
| 211 | + $this->Reporter->report([10, 15, 21], ['Hack attempt via referrer header injection detected.'], $this->BlockInfo['IPAddr']); |
| 212 | + } // 2025.07.24 mod 2026.08.16 |
| 213 | + } |
| 214 | + } |
208 | 215 |
|
209 | 216 | $this->trigger($RefLC === '(null)', 'Illegal referrer'); // 2018.03.13 |
210 | 217 | }; |
|
0 commit comments