Skip to content

Commit 39c7e04

Browse files
committed
Added concept file for fuzzy logic feature
1 parent 97ba861 commit 39c7e04

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

fuzzy_logic_concept.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env python3
2+
3+
import requests
4+
import hashlib
5+
import itertools
6+
from fuzzywuzzy import fuzz
7+
8+
headers = ('a.example.com', 'b.example.com', 'c.example.com')
9+
10+
request_data = {}
11+
12+
for host in headers:
13+
headers = { 'Host': host }
14+
req = requests.get('http://test.host.here/', headers=headers, verify=False)
15+
hash = hashlib.sha256(req.text.encode('utf-8')).hexdigest()
16+
request_data[hash] = req.content
17+
18+
for a, b in itertools.combinations(request_data.keys(), 2):
19+
print('%s is %s percent similar to %s' % (a, fuzz.ratio(request_data[a], request_data[b]), b))

0 commit comments

Comments
 (0)