• Stars
    star
    6
  • Rank 2,539,965 (Top 51 %)
  • Language
    Go
  • License
    MIT License
  • Created over 5 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Finds smelly php code pieces

Build Go Report Card Maintainability Test Coverage

License Go Version Release Downloads

phpunisher

Finds code pieces, that looks like viruses/trojans inside php source code.

Tested on following public malware collections:

features

  • powered by great php-parser library
  • selected scanners run in parrallel
  • no signatures
  • fully customized detection rules

installation

usage

~# cd /to/your/php/code
~# phpunisher -report                  # to see report
~# phpunisher | xargs -d "\n" -n 1 rm  # to remove suspicios

or

~# phpunisher -dump-conf > my_rules.yaml
~# $EDITOR my_rules.yaml # edit to suit your needs
~# cd /to/your/php/code
~# phpunisher -conf /path/to/my_rules.yaml -report

flags

-conf string
    load scanners config from file
-dump-conf
    dump default scanners config to stdout
-mask string
    scan masks, use ';' as separator (default "*.php*")
-report
    show report for found suspects
-score float
    minimal score to threat file as suspect
-version
    show version
-workers int
    workers count (scan parallelism) (default 2)

scanners

  • array-call finds function calls from array elements
  • array-ops notifies if array operations amount is over 20% of all operations
  • escapes notifies if string literal has more than two escaped symbols
  • evals scans for eval expression
  • funcs scans againts 'bad function' list (based on this article)
  • include notifies if whole file is single include instruction
  • long-str notifies if string literal rather long (>64 chars) and does not contains any spaces (encoded blobs)