Fwaf-Machine-Learning-driven-Web-Application-Firewall
Fwaf-Machine-Learning-driven-Web-Application-Firewall copied to clipboard
Script not working?
Hi,
Has the ML script been run recently?
I tried to run it with python 3 and 2 and got errors.
For inst with python 2 (might be 2.7.15), I got the following logs:
"(py27) C:\Users\Thomas Lev\Documents\Fwaf\Fwaf-Machine-Learning-driven-Web-Application-Firewall-master>python script.py
C:\Users\Thomas Lev\AppData\Local\conda\conda\envs\py27\lib\site-packages\sklearn\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
Traceback (most recent call last):
File "script.py", line 43, in
Thanks
Thomas
It seems it's a decoding error. Maybe try reclone this project and make sure your badQueries and goodQueries text file are encoded with UTF-8, or try to convert them. Try this : https://stackoverflow.com/questions/4182603/how-to-convert-a-string-to-utf-8-in-python
Thanks. Indeed, a decoding error. Some chars in the text files appear not to be understood as UTF-8 chars. I managed to make it work by adding errors='ignore' in open function like this: with open(filepath,'r',errors='ignore') as f:
Thomas