Python filt is the packeage for using Filt.
You can use to make below.
Use filt to check whether the target hits the signature.
Get target and signature, check whether the target hits the signature, and return result to Filt.
Type command below.
$ git clone https://github.com/akakou/python-filt
$ cd python-filt
$ sudo pip install .
Make the project folder.
$ mkdir sample
$ cd sample
Make Setting.toml
in project directory
# this is sample/Settings.toml
excutable_file = "scanner.py"
Make python file and write like below.
#!/usr/bin/env python
"""
This is sample/scanner.py
"""
from filt.scanner import BaseScanner
# **DO NOT use** stdin and stdout.
# Scanner use them to communicate with filt.
class SampleScanner(BaseScanner):
def scan(self, target, signature):
"""
Check target and signature,
and return is_hit(bool) and message(str).
"""
# WRITE HERE
return (is_hit, message)
if __name__ == '__main__':
# run scanner
sample_scanner = SampleScanner()
sample_scanner.run()
Make python file and write like below.
#!/usr/bin/env python
from filt.client import FiltClient
def main():
# set param
url = 'https://localhost:3000'
target = "hello world"
option = {"hoge": "fuga"}
# construct filt client
filt = FiltClient(url)
# send data to filt
result = filt.send(target, verify=False)
print(result)
# add option and send data
result = filt.send(target, option=option, verify=False)
print(result)
if __name__ == '__main__':
main()