gwillem / magento-malware-scanner

Scanner, signatures and the largest collection of Magento malware
GNU General Public License v3.0
679 stars 153 forks source link

TypeError: decode() takes no keyword arguments #204

Closed 01i closed 6 years ago

01i commented 6 years ago

I've been having ongoing problems with mwscanner since the AWS update. I have a CentOS6 server.

Initially I was getting the "pkg_resources.DistributionNotFound: requests>=0.8.2" and I couldn't get past that until I finally found the comment in usage.md that says to run "easy_install --upgrade requests".

That finally resolved the error that's been holding me up, but the scan didn't get far before reporting a different error.

[*] Using Mwscan rules.
[*] Fetching mwscan.yar
[*] Starting new HTTPS connection (1): mwscan.s3.amazonaws.com
[*] https://mwscan.s3.amazonaws.com:443 "GET /mwscan.yar HTTP/1.1" 200 155458
Traceback (most recent call last):
  File "/usr/bin/mwscan", line 9, in <module>
    load_entry_point('mwscan==20180510.172121', 'console_scripts', 'mwscan')()
  File "/usr/lib/python2.6/site-packages/mwscan/scan.py", line 243, in main
    rules, whitelist = provider(args=args).get()
  File "/usr/lib/python2.6/site-packages/mwscan/ruleset.py", line 139, in get
    rawrules = self.get_rules()
  File "/usr/lib/python2.6/site-packages/mwscan/ruleset.py", line 48, in get_rules
    rawrules = self._recursive_fetch(self.rules_url)
  File "/usr/lib/python2.6/site-packages/mwscan/ruleset.py", line 160, in _recursive_fetch
    data = self._httpget(url)
  File "/usr/lib/python2.6/site-packages/mwscan/ruleset.py", line 121, in _httpget
    return resp.content.decode('utf-8', errors='ignore')
TypeError: decode() takes no keyword arguments
gwillem commented 6 years ago

Thought I had fixed this in #206. Too bad CentOs can't just upgrade their ancient Python version...

gwillem commented 6 years ago

Can you try the fix and let me know?

sudo pip uninstall mwscan -y
sudo yum install git -y
sudo pip install git+https://github.com/gwillem/magento-malware-scanner.git@py26 -y
gwillem commented 6 years ago

Assume fixed

did-vmonroig commented 6 years ago

I was trying to test mwscan, but this problem rised. Seems that py26 branch has been deleted:

Collecting git+https://github.com/gwillem/magento-malware-scanner.git@py26
  Cloning https://github.com/gwillem/magento-malware-scanner.git (to py26) to /tmp/pip-q0tZl4-build
  Could not find a tag or branch 'py26', assuming commit.
error: pathspec 'py26' did not match any file(s) known to git.
  Complete output from command git checkout -q py26:

  ----------------------------------------
Command "git checkout -q py26" failed with error code 1 in /tmp/pip-q0tZl4-build