CIRCL / AIL-framework

AIL framework - Analysis Information Leak framework. Project moved to https://github.com/ail-project
https://github.com/ail-project/ail-framework
GNU Affero General Public License v3.0
1.3k stars 282 forks source link

Pystemon feeder bug #489

Open Wiindea opened 4 years ago

Wiindea commented 4 years ago

Hello!

I tried to link your framework with pystemon by following these directions, but when I launch the pystemon feeder I get this output...

Traceback (most recent call last):
  File "./bin/feeder/pystemon-feeder.py", line 29, in <module>
    sys.path.append(os.path.join(os.environ['AIL_BIN'], 'lib/'))
  File "/usr/lib/python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'AIL_BIN'

Any idea about what could cause the error?

Terrtia commented 4 years ago

Hi @Wiindea !

You need to activate the virtual environment:

cd AIL-framework
. ./AILENV/bin/activate

./bin/feeder/pystemon-feeder.py
Wiindea commented 4 years ago

Thanks for the fast answer @Terrtia!

Now I can launch the pystemon feeder, but I can't get anything on the AIL homepage. I think it's related to an error I should have made while setting up pystemon. When launching pystemon, I get some errors each time it downloads files:

Downloading list of new pastes from slexy.org. Will check again in 16 seconds
Downloading url: http://slexy.org/recent with proxy: None and user-agent: None
Downloading url: http://slexy.org/recent with proxy: None and user-agent: None
!!Proxy error on http://slexy.org/recent for proxy None.
Thread for slexy.org crashed unexpectectly, recovering...: local variable 'response' referenced before assignment
Traceback (most recent call last):
  File "./pystemon.py", line 131, in run
    last_pasties = self.get_last_pasties()
  File "./pystemon.py", line 150, in get_last_pasties
    response = download_url(self.archive_url)
  File "./pystemon.py", line 736, in download_url
    return response
UnboundLocalError: local variable 'response' referenced before assignment

Downloading list of new pastes from slexy.org. Will check again in 20 seconds
Downloading url: http://slexy.org/recent with proxy: None and user-agent: None
Downloading url: http://slexy.org/recent with proxy: None and user-agent: None
!!Proxy error on http://slexy.org/recent for proxy None.
Thread for slexy.org crashed unexpectectly, recovering...: local variable 'response' referenced before assignment
Traceback (most recent call last):
  File "./pystemon.py", line 131, in run
    last_pasties = self.get_last_pasties()
  File "./pystemon.py", line 150, in get_last_pasties
    response = download_url(self.archive_url)
  File "./pystemon.py", line 736, in download_url
    return response
UnboundLocalError: local variable 'response' referenced before assignment

Here is an example with Slexy and all the errors I get, but the same also happen with PasteBin.

0vert1m3 commented 4 years ago

Thanks for the fast answer @Terrtia!

Now I can launch the pystemon feeder, but I can't get anything on the AIL homepage. I think it's related to an error I should have made while setting up pystemon. When launching pystemon, I get some errors each time it downloads files:

Downloading list of new pastes from slexy.org. Will check again in 16 seconds
Downloading url: http://slexy.org/recent with proxy: None and user-agent: None
Downloading url: http://slexy.org/recent with proxy: None and user-agent: None
!!Proxy error on http://slexy.org/recent for proxy None.
Thread for slexy.org crashed unexpectectly, recovering...: local variable 'response' referenced before assignment
Traceback (most recent call last):
  File "./pystemon.py", line 131, in run
    last_pasties = self.get_last_pasties()
  File "./pystemon.py", line 150, in get_last_pasties
    response = download_url(self.archive_url)
  File "./pystemon.py", line 736, in download_url
    return response
UnboundLocalError: local variable 'response' referenced before assignment

Downloading list of new pastes from slexy.org. Will check again in 20 seconds
Downloading url: http://slexy.org/recent with proxy: None and user-agent: None
Downloading url: http://slexy.org/recent with proxy: None and user-agent: None
!!Proxy error on http://slexy.org/recent for proxy None.
Thread for slexy.org crashed unexpectectly, recovering...: local variable 'response' referenced before assignment
Traceback (most recent call last):
  File "./pystemon.py", line 131, in run
    last_pasties = self.get_last_pasties()
  File "./pystemon.py", line 150, in get_last_pasties
    response = download_url(self.archive_url)
  File "./pystemon.py", line 736, in download_url
    return response
UnboundLocalError: local variable 'response' referenced before assignment

Here is an example with Slexy and all the errors I get, but the same also happen with PasteBin.

I had the same problem today the fix is not to use the old version that circl is providing else install "https://github.com/cvandeplas/pystemon" and turn save / save-all on your module to on and switch Redis query / query-all too on as well works perfectly for me.