id); $fields = array( 'URL' => $hit->URL, 'Timestamp' => date('r', $hit->ctime), 'IP' => wfUtils::inet_ntop($hit->IP), 'Status Code' => $hit->statusCode, 'User Agent' => $hit->UA, 'Referer' => $hit->referer, ); if (isset($hitData->fullRequest)) { $requestString = base64_decode($hitData->fullRequest); $request = wfWAFRequest::parseString($requestString); } else { $request = new wfWAFRequest(); $request->setAuth(array()); $request->setBody(array()); $request->setCookies(array()); $request->setFileNames(array()); $request->setFiles(array()); $request->setHeaders(array()); $request->setHost(''); $request->setIp(''); $request->setMethod('GET'); $request->setPath(''); $request->setProtocol('http'); $request->setQueryString(array()); $request->setTimestamp(''); $request->setUri(''); $headers = array(); $urlPieces = parse_url($hit->URL); if ($urlPieces) { if (array_key_exists('scheme', $urlPieces)) { $request->setProtocol($urlPieces['scheme']); } if (array_key_exists('host', $urlPieces)) { $request->setHost($urlPieces['host']); $headers['Host'] = $urlPieces['host']; } $uri = '/'; if (array_key_exists('path', $urlPieces)) { $request->setPath($urlPieces['path']); $uri = $urlPieces['path']; } if (array_key_exists('query', $urlPieces)) { $uri .= '?' . $urlPieces['query']; parse_str($urlPieces['query'], $query); $request->setQueryString($query); } $request->setUri($uri); } $headers['User-Agent'] = $hit->UA; $headers['Referer'] = $hit->referer; $request->setHeaders($headers); preg_match('/request\.([a-z]+)(?:\[(.*?)\](.*?))?/i', $hitData->paramKey, $matches); if ($matches) { switch ($matches[1]) { case 'body': $request->setMethod('POST'); parse_str("$matches[2]$matches[3]", $body); $request->setBody($body); break; } } } $request->setIP(wfUtils::inet_ntop($hit->IP)); $request->setTimestamp($hit->ctime); $waf = wfWAF::getInstance(); $waf->setRequest($request); $result = 'Passed'; $failedRules = array(); try { $waf->runRules(); } catch (wfWAFAllowException $e) { $result = 'Allowlisted'; } catch (wfWAFBlockException $e) { $result = 'Blocked'; $failedRules = $waf->getFailedRules(); } catch (wfWAFBlockSQLiException $e) { $result = 'Blocked For SQLi'; $failedRules = $waf->getFailedRules(); } catch (wfWAFBlockXSSException $e) { $result = 'Blocked For XSS'; $failedRules = $waf->getFailedRules(); } ?>
Request Details | |
---|---|
: |
WFWAF_DEBUG
is enabled.
'', "[/$paramKey]" => '', "[$matchKey]" => '', "[/$matchKey]" => '', ); $highlightParamFormat = "[$paramKey]%s[/$paramKey]"; $highlightMatchFormat = "[$matchKey]%s[/$matchKey]"; $requestOut = esc_html($request->highlightFailedParams($failedRules, $highlightParamFormat, $highlightMatchFormat)); echo str_replace(array_keys($template), $template, $requestOut) ?>
ID | Category |
---|---|
%d | %s |