PHPackages                             cbi/php-malware-checker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. cbi/php-malware-checker

AbandonedLibrary[Security](/categories/security)

cbi/php-malware-checker
=======================

This package checks if a hash or a file is registered as malware in Team Cymru database

1.0.5(8y ago)4171[1 issues](https://github.com/CBIConsulting/php-malware-checker/issues)MITPHP

Since Mar 23Pushed 8y ago9 watchersCompare

[ Source](https://github.com/CBIConsulting/php-malware-checker)[ Packagist](https://packagist.org/packages/cbi/php-malware-checker)[ RSS](/packages/cbi-php-malware-checker/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)Dependencies (1)Versions (4)Used By (0)

Malware Checker
===============

[](#malware-checker)

[![Build Status](https://camo.githubusercontent.com/02f133ef3e1ba777bae3c1157a31c37ea7610d19aaa4a79f119b68fb1a24b151/68747470733a2f2f7472617669732d63692e6f72672f434249436f6e73756c74696e672f7068702d6d616c776172652d636865636b65722e737667)](https://travis-ci.org/CBIConsulting/php-malware-checker)[![Packagist](https://camo.githubusercontent.com/3e0db85987981f0ae30ff32420311578eb9d2673a9942b337241242fb7b4058e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6362692f7068702d6d616c776172652d636865636b65722e737667)](https://packagist.org/packages/cbi/php-malware-checker)[![license](https://camo.githubusercontent.com/b0228d5089e97ca4335b43b9e1eb0bd54280d39fbcf46e26672be30471e67035/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f434249436f6e73756c74696e672f7068702d6d616c776172652d636865636b65722e737667)](https://github.com/CBIConsulting/php-malware-checker/blob/master/LICENSE)[![GitHub issues](https://camo.githubusercontent.com/7a7cdef49498ac700adedef06465c3de999866f9e11b1e8065fb05832dc0a57e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f434249436f6e73756c74696e672f7068702d6d616c776172652d636865636b65722e737667)](https://github.com/CBIConsulting/php-malware-checker/issues)

This package checks if a given hash or file is registered as malware in [Team Cymru](https://www.team-cymru.org/) database.

Installation
------------

[](#installation)

Install via composer:

```
composer require cbi/php-malware-checker

```

How to use it
-------------

[](#how-to-use-it)

If you don't have the hash you can generate it using a resouce or the uri to the file, by default it uses the `md5` algo:

```
// Generate a hash from a resource

MalwareChecker::makeHash($resouce); // fea80f2db003d4ebc4536023814aa885
MalwareChecker::makeHash($resouce, 'sha1'); // 38f00f8738e241daea6f37f6f55ae8414d7b0219

// Generate a hash from an uri

MalwareChecker::makeHash($uri); // fea80f2db003d4ebc4536023814aa885
MalwareChecker::makeHash($uri, 'sha1'); // 38f00f8738e241daea6f37f6f55ae8414d7b0219

// Generate multiple hashes from one file

MalwareChecker::makeHashes($uri, ['md5', 'sha1']) // ['fea80f2db003d4ebc4536023814aa885', '38f00f8738e241daea6f37f6f55ae8414d7b0219']
MalwareChecker::makeHashes($resouce, ['md5', 'sha1']) // ['fea80f2db003d4ebc4536023814aa885', '38f00f8738e241daea6f37f6f55ae8414d7b0219']
```

To check the generated hashes you can use two methods, `check` and `checkMany`, they use different protocols to avoid cluttering the database.

To check a single hash use the following function:

```
MalwareChecker::check($infectedHash);   // ['hash' => 'f58628917abcbcfb2b2258b6b46bf721', timestamp => '1511919759' detection_percentage => '68']
MalwareChecker::check($safeHash);       // false
```

To check multiple hashed use `checkMany` method, this method only returns the infected hashes among all the provided:

```
MalwareChecker::checkMany($hashes); // [ ... ['hash' => 'f58628917abcbcfb2b2258b6b46bf721', timestamp => '1511919759' detection_percentage => '68']]
```

Testing
-------

[](#testing)

Execute tests using `vendor/bin/phpunit` from the project root.

License
-------

[](#license)

MIT. Copyright (c) [CBI Consulting](https://cbiconsulting.es/).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

3

Last Release

2965d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/581965c92adfcdcb1706816f420a3fb9942e813e6edc3e667abd8f81ba50a0b1?d=identicon)[algm85](/maintainers/algm85)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cbi-php-malware-checker/health.svg)

```
[![Health](https://phpackages.com/badges/cbi-php-malware-checker/health.svg)](https://phpackages.com/packages/cbi-php-malware-checker)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
