@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | // Open proxy, open relay, or Tor exit node. |
| 80 | 80 | ['openproxy' , '9', 'Open Proxy', true], |
| 81 | 81 | |
| 82 | - // Comment/forum spam, HTTP referer spam, or other CMS spam. |
|
| 83 | - ['webspam' , '10', 'Web Spam', true], |
|
| 82 | + // Comment/forum spam, HTTP referer spam, or other CMS spam. |
|
| 83 | + ['webspam' , '10', 'Web Spam', true], |
|
| 84 | 84 | |
| 85 | 85 | // Spam email content, infected attachments, and phishing emails. Note: Limit comments to only relevent |
| 86 | 86 | // information (instead of log dumps) and be sure to remove PII if you want to remain anonymous. |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | if ($cat[0] === $categoryName) { |
| 160 | 160 | return $cat; |
| 161 | 161 | } |
| 162 | - } |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | 164 | // not found |
| 165 | 165 | return false; |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | public static function getCategoryNameById(string $categoryId) |
| 178 | 178 | { |
| 179 | 179 | foreach (self::$aipdbApiCategories as $cat){ |
| 180 | - if ($cat[1] === $categoryId) { |
|
| 181 | - return $cat; |
|
| 182 | - } |
|
| 180 | + if ($cat[1] === $categoryId) { |
|
| 181 | + return $cat; |
|
| 182 | + } |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | // not found |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | return $i; |
| 205 | 205 | } |
| 206 | 206 | $i++; |
| 207 | - } |
|
| 207 | + } |
|
| 208 | 208 | |
| 209 | 209 | // not found |
| 210 | 210 | return false; |
@@ -53,82 +53,82 @@ discard block |
||
| 53 | 53 | protected static $aipdbApiCategories = [ |
| 54 | 54 | |
| 55 | 55 | // Altering DNS records resulting in improper redirection. |
| 56 | - ['dns-c' , '1', 'DNS Compromise', true], |
|
| 56 | + [ 'dns-c', '1', 'DNS Compromise', true ], |
|
| 57 | 57 | |
| 58 | 58 | // Falsifying domain server cache (cache poisoning). |
| 59 | - ['dns-p' , '2', 'DNS Poisoning', true], |
|
| 59 | + [ 'dns-p', '2', 'DNS Poisoning', true ], |
|
| 60 | 60 | |
| 61 | 61 | // Fraudulent orders. |
| 62 | - ['fraud-orders' , '3', 'Fraud Orders', true], |
|
| 62 | + [ 'fraud-orders', '3', 'Fraud Orders', true ], |
|
| 63 | 63 | |
| 64 | 64 | // Participating in distributed denial-of-service (usually part of botnet). |
| 65 | - ['ddos' , '4', 'DDoS Attack', true], |
|
| 65 | + [ 'ddos', '4', 'DDoS Attack', true ], |
|
| 66 | 66 | |
| 67 | 67 | // |
| 68 | - ['ftp-bf' , '5', 'FTP Brute-Force', true], |
|
| 68 | + [ 'ftp-bf', '5', 'FTP Brute-Force', true ], |
|
| 69 | 69 | |
| 70 | 70 | // Oversized IP packet. |
| 71 | - ['pingdeath' , '6', 'Ping of Death', true], |
|
| 71 | + [ 'pingdeath', '6', 'Ping of Death', true ], |
|
| 72 | 72 | |
| 73 | 73 | // Phishing websites and/or email. |
| 74 | - ['phishing' , '7', 'Phishing', true], |
|
| 74 | + [ 'phishing', '7', 'Phishing', true ], |
|
| 75 | 75 | |
| 76 | 76 | // |
| 77 | - ['fraudvoip' , '8', 'Fraud VoIP', true], |
|
| 77 | + [ 'fraudvoip', '8', 'Fraud VoIP', true ], |
|
| 78 | 78 | |
| 79 | 79 | // Open proxy, open relay, or Tor exit node. |
| 80 | - ['openproxy' , '9', 'Open Proxy', true], |
|
| 80 | + [ 'openproxy', '9', 'Open Proxy', true ], |
|
| 81 | 81 | |
| 82 | 82 | // Comment/forum spam, HTTP referer spam, or other CMS spam. |
| 83 | - ['webspam' , '10', 'Web Spam', true], |
|
| 83 | + [ 'webspam', '10', 'Web Spam', true ], |
|
| 84 | 84 | |
| 85 | 85 | // Spam email content, infected attachments, and phishing emails. Note: Limit comments to only relevent |
| 86 | 86 | // information (instead of log dumps) and be sure to remove PII if you want to remain anonymous. |
| 87 | - ['emailspam' , '11', 'Email Spam', true], |
|
| 87 | + [ 'emailspam', '11', 'Email Spam', true ], |
|
| 88 | 88 | |
| 89 | 89 | // CMS blog comment spam. |
| 90 | - ['blogspam' , '12', 'Blog Spam', true], |
|
| 90 | + [ 'blogspam', '12', 'Blog Spam', true ], |
|
| 91 | 91 | |
| 92 | 92 | // Conjunctive category. |
| 93 | - ['vpnip' , '13', 'VPN IP', false], // to check alone ?? |
|
| 93 | + [ 'vpnip', '13', 'VPN IP', false ], // to check alone ?? |
|
| 94 | 94 | |
| 95 | 95 | // Scanning for open ports and vulnerable services. |
| 96 | - ['scan' , '14', 'Port Scan', true], |
|
| 96 | + [ 'scan', '14', 'Port Scan', true ], |
|
| 97 | 97 | |
| 98 | 98 | // |
| 99 | - ['hack' , '15', 'Hacking', true], |
|
| 99 | + [ 'hack', '15', 'Hacking', true ], |
|
| 100 | 100 | |
| 101 | 101 | // Attempts at SQL injection. |
| 102 | - ['sql' , '16', 'SQL Injection', true], |
|
| 102 | + [ 'sql', '16', 'SQL Injection', true ], |
|
| 103 | 103 | |
| 104 | 104 | // Email sender spoofing. |
| 105 | - ['spoof' , '17', 'Spoofing', true], |
|
| 105 | + [ 'spoof', '17', 'Spoofing', true ], |
|
| 106 | 106 | |
| 107 | 107 | // Credential brute-force attacks on webpage logins and services like SSH, FTP, SIP, SMTP, RDP, etc. |
| 108 | 108 | // This category is seperate from DDoS attacks. |
| 109 | - ['brute' , '18', 'Brute-Force', true], |
|
| 109 | + [ 'brute', '18', 'Brute-Force', true ], |
|
| 110 | 110 | |
| 111 | 111 | // Webpage scraping (for email addresses, content, etc) and crawlers that do not honor robots.txt. |
| 112 | 112 | // Excessive requests and user agent spoofing can also be reported here. |
| 113 | - ['badbot' , '19', 'Bad Web Bot', true], |
|
| 113 | + [ 'badbot', '19', 'Bad Web Bot', true ], |
|
| 114 | 114 | |
| 115 | 115 | // Host is likely infected with malware and being used for other attacks or to host malicious content. |
| 116 | 116 | // The host owner may not be aware of the compromise. This category is often used in combination |
| 117 | 117 | // with other attack categories. |
| 118 | - ['explhost' , '20', 'Exploited Host', true], |
|
| 118 | + [ 'explhost', '20', 'Exploited Host', true ], |
|
| 119 | 119 | |
| 120 | 120 | // Attempts to probe for or exploit installed web applications such as a CMS |
| 121 | 121 | // like WordPress/Drupal, e-commerce solutions, forum software, phpMyAdmin and |
| 122 | 122 | // various other software plugins/solutions. |
| 123 | - ['webattack' , '21', 'Web App Attack', true ], |
|
| 123 | + [ 'webattack', '21', 'Web App Attack', true ], |
|
| 124 | 124 | |
| 125 | 125 | // Secure Shell (SSH) abuse. Use this category in combination |
| 126 | 126 | // with more specific categories. |
| 127 | - ['ssh' , '22', 'SSH', false], |
|
| 127 | + [ 'ssh', '22', 'SSH', false ], |
|
| 128 | 128 | |
| 129 | 129 | // Abuse was targeted at an "Internet of Things" type device. Include |
| 130 | 130 | // information about what type of device was targeted in the comments. |
| 131 | - ['oit' , '23', 'IoT Targeted', true], |
|
| 131 | + [ 'oit', '23', 'IoT Targeted', true ], |
|
| 132 | 132 | ]; |
| 133 | 133 | |
| 134 | 134 | /** |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public static function getCategoryIdbyName(string $categoryName) |
| 157 | 157 | { |
| 158 | - foreach (self::$aipdbApiCategories as $cat){ |
|
| 159 | - if ($cat[0] === $categoryName) { |
|
| 158 | + foreach (self::$aipdbApiCategories as $cat) { |
|
| 159 | + if ($cat[ 0 ] === $categoryName) { |
|
| 160 | 160 | return $cat; |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public static function getCategoryNameById(string $categoryId) |
| 178 | 178 | { |
| 179 | - foreach (self::$aipdbApiCategories as $cat){ |
|
| 180 | - if ($cat[1] === $categoryId) { |
|
| 179 | + foreach (self::$aipdbApiCategories as $cat) { |
|
| 180 | + if ($cat[ 1 ] === $categoryId) { |
|
| 181 | 181 | return $cat; |
| 182 | 182 | } |
| 183 | 183 | } |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | protected static function getCategoryIndex(string $value, int $index) |
| 200 | 200 | { |
| 201 | 201 | $i = 0; |
| 202 | - foreach (self::$aipdbApiCategories as $cat){ |
|
| 203 | - if ($cat[$index] === $value) { |
|
| 202 | + foreach (self::$aipdbApiCategories as $cat) { |
|
| 203 | + if ($cat[ $index ] === $value) { |
|
| 204 | 204 | return $i; |
| 205 | 205 | } |
| 206 | 206 | $i++; |
@@ -234,21 +234,21 @@ discard block |
||
| 234 | 234 | foreach ($cats as $cat) { |
| 235 | 235 | |
| 236 | 236 | // get index on our array of categories |
| 237 | - $catIndex = is_numeric($cat) ? self::getCategoryIndex($cat, 1) : self::getCategoryIndex($cat, 0); |
|
| 237 | + $catIndex = is_numeric($cat) ? self::getCategoryIndex($cat, 1) : self::getCategoryIndex($cat, 0); |
|
| 238 | 238 | |
| 239 | 239 | // check if found |
| 240 | - if ($catIndex === false ){ |
|
| 240 | + if ($catIndex === false) { |
|
| 241 | 241 | throw new \InvalidArgumentException('Invalid report category was given.'); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // get Id |
| 245 | - $catId = self::$aipdbApiCategories[$catIndex][1]; |
|
| 245 | + $catId = self::$aipdbApiCategories[ $catIndex ][ 1 ]; |
|
| 246 | 246 | |
| 247 | 247 | // need another ? |
| 248 | - if ($needAnother !== false){ |
|
| 248 | + if ($needAnother !== false) { |
|
| 249 | 249 | |
| 250 | 250 | // is a standalone cat ? |
| 251 | - if (self::$aipdbApiCategories[$catIndex][3] === false) { |
|
| 251 | + if (self::$aipdbApiCategories[ $catIndex ][ 3 ] === false) { |
|
| 252 | 252 | $needAnother = true; |
| 253 | 253 | |
| 254 | 254 | } else { |
@@ -259,10 +259,10 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | // set or add to cats list |
| 262 | - $catsString = ($catsString === '') ? $catId : $catsString .','.$catId; |
|
| 262 | + $catsString = ($catsString === '') ? $catId : $catsString . ',' . $catId; |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - if ($needAnother !== false){ |
|
| 265 | + if ($needAnother !== false) { |
|
| 266 | 266 | throw new \InvalidArgumentException('Invalid report category parameter given: this category can\'t be used alone.'); |
| 267 | 267 | } |
| 268 | 268 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | public function report(string $ip, string $categories, string $message): ApiResponse |
| 43 | 43 | { |
| 44 | 44 | try { |
| 45 | - return parent::report($ip,$categories,$message); |
|
| 45 | + return parent::report($ip, $categories, $message); |
|
| 46 | 46 | } catch (\Exception $e) { |
| 47 | 47 | return ApiResponse::createErrorResponse($e->getMessage()); |
| 48 | 48 | } |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | */ |
| 111 | 111 | public function errors(): array |
| 112 | 112 | { |
| 113 | - return ($this->decodedResponse && $this->decodedResponse->errors) ? $this->decodedResponse->errors : []; |
|
| 113 | + return ($this->decodedResponse && $this->decodedResponse->errors) ? $this->decodedResponse->errors : [ ]; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |