2017 © Pedro Peláez
 

library php-malware-checker

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

image

cbi/php-malware-checker

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

  • Monday, April 2, 2018
  • by algm85
  • Repository
  • 5 Watchers
  • 5 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Malware Checker

Build Status Packagist license GitHub issues, (*1)

This package checks if a given hash or file is registered as malware in Team Cymru database., (*2)

Installation

Install via composer:, (*3)

composer require cbi/php-malware-checker

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:, (*4)

// 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., (*5)

To check a single hash use the following function:, (*6)

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:, (*7)

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

Testing

Execute tests using vendor/bin/phpunit from the project root., (*8)

License

MIT. Copyright (c) CBI Consulting., (*9)

The Versions

02/04 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Development Requires

by Asur Bernardo

02/04 2018

1.0.5

1.0.5.0

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

  Sources   Download

MIT

The Development Requires

by Asur Bernardo

02/04 2018

1.0.4

1.0.4.0

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

  Sources   Download

MIT

The Development Requires

by Asur Bernardo

23/03 2018

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Development Requires

by Asur Bernardo