krmaxwell / maltrieve

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

User report: exception on UnboundLocalError #37

Closed krmaxwell closed 10 years ago

krmaxwell commented 10 years ago

On a run with over 1000 URI’s I find that each thread seems to eventually cause an exception: - example below. Is the being caused by malformed URLs without HTTP:// or is this coincidental?

1.  2014-05-22 16:36:49 140342549030656 1026 items remaining in queue
2.  Exception in thread Thread-1:
3.  Traceback (most recent call last):
4.    File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
5.      self.run()
6.    File "/usr/lib64/python2.6/threading.py", line 484, in run
7.      self.__target(*self.__args, **self.__kwargs)
8.    File "maltrieve.py", line 51, in get_malware
9.      mal = get_URL(url)
10.   File "/malware/maltrieve/malutil.py", line 17, in get_URL
11.     response.getcode())
12. UnboundLocalError: local variable 'response' referenced before assignment
13.  
14. 2014-05-22 16:37:12 140342538540800 urlopen() returned error [Errno 110] Connection timed out
15.  
16. 2014-05-22 16:37:12 140342538540800 Fetched URL julieandrews.us/  from queue
17. 2014-05-22 16:37:12 140342538540800 1025 items remaining in queue
18. Exception in thread Thread-2:
19. Traceback (most recent call last):
20.   File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
21.     self.run()
22.   File "/usr/lib64/python2.6/threading.py", line 484, in run
23.     self.__target(*self.__args, **self.__kwargs)
24.   File "maltrieve.py", line 51, in get_malware
25.     mal = get_URL(url)
26.   File "/malware/maltrieve/malutil.py", line 17, in get_URL
27.     response.getcode())
28. UnboundLocalError: local variable 'response' referenced before assignment
vito01 commented 10 years ago

I'm getting the same error with the most recent version

krmaxwell commented 10 years ago

Ok I will try again to reproduce On Jun 22, 2014 4:48 PM, "vito01" notifications@github.com wrote:

I'm getting the same error with the most recent version

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