krmaxwell / maltrieve

A tool to retrieve malware directly from the source for security researchers.
GNU General Public License v3.0
563 stars 184 forks source link

exception #65

Closed adimenia closed 9 years ago

adimenia commented 10 years ago

is there a reason i keep getting these exceptions when running the tool. Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(_self.args, *_self.__kwargs) File "/usr/local/bin/maltrieve.py", line 52, in get_malware mal = get_URL(url) File "/usr/local/maltrieve/malutil.py", line 17, in get_URL response.getcode()) UnboundLocalError: local variable 'response' referenced before assignment

krmaxwell commented 10 years ago

That's fixed in later revisions. Try updating Maltrieve to the latest version and you should be good to go.

adimenia commented 10 years ago

I downloaded the new version and im getting these exceptions Exception in thread Thread-5: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(_self.args, *_self.__kwargs) File "/usr/local/bin/maltrieve.py", line 52, in get_malware mal = get_URL(url) File "/usr/local/maltrieve/malutil.py", line 17, in get_URL response.getcode()) UnboundLocalError: local variable 'response' referenced before assignment

2014-10-18 11:46:03 -1236354192 urlopen() returned error [Errno 111] Connection refused

2014-10-18 11:46:03 -1236354192 Fetched URL www.free-ocr.org/FreeScanandOCRtoWord.exe from queue 2014-10-18 11:46:03 -1236354192 1025 items remaining in queue Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(_self.args, *_self.__kwargs) File "/usr/local/bin/maltrieve.py", line 52, in get_malware mal = get_URL(url) File "/usr/local/maltrieve/malutil.py", line 17, in get_URL response.getcode()) UnboundLocalError: local variable 'response' referenced before assignment

2014-10-18 11:46:04 -1219568784 urlopen() returned error [Errno 111] Connection refused

2014-10-18 11:46:04 -1219568784 Fetched URL baixaanexo.cloudapp.net/Org-Boletim-de-Ocorrencia_gerado_online_de.zip from queue 2014-10-18 11:46:04 -1219568784 1024 items remaining in queue Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(_self.args, *_self.__kwargs) File "/usr/local/bin/maltrieve.py", line 52, in get_malware mal = get_URL(url) File "/usr/local/maltrieve/malutil.py", line 17, in get_URL response.getcode()) UnboundLocalError: local variable 'response' referenced before assignment

2014-10-18 11:46:05 -1244746896 urlopen() returned error [Errno 111] Connection refused

2014-10-18 11:46:05 -1244746896 Fetched URL ww.yuchengdjc.com/s.exe?_upd=G30769_s_0529.exe from queue 2014-10-18 11:46:05 -1244746896 1023 items remaining in queue Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(_self.args, *_self.__kwargs) File "/usr/local/bin/maltrieve.py", line 52, in get_malware mal = get_URL(url) File "/usr/local/maltrieve/malutil.py", line 17, in get_URL response.getcode()) UnboundLocalError: local variable 'response' referenced before assignment

2014-10-18 11:46:24 -1227961488 urlopen() returned error [Errno 111] Connection refused

2014-10-18 11:46:24 -1227961488 Fetched URL events.unr.edu/event/nbc_baylor_vs_west_virginia_live from queue 2014-10-18 11:46:24 -1227961488 1022 items remaining in queue Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(_self.args, *_self.__kwargs) File "/usr/local/bin/maltrieve.py", line 52, in get_malware mal = get_URL(url) File "/usr/local/maltrieve/malutil.py", line 17, in get_URL response.getcode()) UnboundLocalError: local variable 'response' referenced before assignment everytime on the same place

krmaxwell commented 10 years ago

This is definitely buggy old code that's been replaced. That file (malutil.py) doesn't even exist in the current code. Download the newest version either here or from the git repo (git clone git@github.com:technoskald/maltrieve.git from a fresh directory) and try again.

adimenia commented 10 years ago

thanks...i downloaded the new code. (i also seemed to miss some dependencies so i downloaded them too.) now this is what i get after download is finished Completed downloads Traceback (most recent call last): File "./maltrieve.py", line 336, in main() File "./maltrieve.py", line 327, in main json.dump(past_urls, urlfile) File "/usr/lib/python2.7/json/init.py", line 181, in dump for chunk in iterable: File "/usr/lib/python2.7/json/encoder.py", line 436, in _iterencode o = _default(o) File "/usr/lib/python2.7/json/encoder.py", line 178, in default raise TypeError(repr(o) + " is not JSON serializable") issues with jason?

krmaxwell commented 10 years ago

now we're onto something interesting! I've not seen this before, will dig into it.

krmaxwell commented 9 years ago

I've been unable to reproduce this. Does this still happen for you?

adimenia commented 9 years ago

I will check asap and let you know בתאריך 14 בנוב 2014 23:01, "Kyle Maxwell" notifications@github.com כתב:

I've been unable to reproduce this. Does this still happen for you?

— Reply to this email directly or view it on GitHub https://github.com/technoskald/maltrieve/issues/65#issuecomment-63128334 .

krmaxwell commented 9 years ago

Fixed by #93 and #91