Skip to content

shell-detector looks like the malware it says it's scanning #24

Description

@anarcat

this code is problematic, to say the least:

    if (file_exists('shelldetect.db')) {
      $context = stream_context_create(array('http' => array('timeout' => 30)));
      $this->fingerprints = unserialize(base64_decode(file_get_contents('shelldetect.db', 0, $context)));
    }
    if ($this->remotefingerprint) {
      $this->fingerprints = unserialize(base64_decode(file_get_contents('https://raw.github.com/emposha/PHP-Shell-Detector/master/shelldetect.db')));
    }
  }

now not only does this look like the malware it's suppose to stop, it's actually vulnerable to remote code execution (if file_get_contents('https://...) can be broken, which I wouldn't be surprised - yay sslstrip) as unserialize will happily execute code it uncompresses: http://ca1.php.net/manual/en/function.unserialize.php#refsect1-function.unserialize-notes

seriously, why is this DB stored that way anyways? it's just a huge array... why not store it in a non-executable code format?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions