2018-10-27 18:58:52 +05:30
|
|
|
import copy
|
|
|
|
|
from fuzzywuzzy import fuzz
|
2018-11-15 15:41:01 +05:30
|
|
|
import re
|
|
|
|
|
from urllib.parse import unquote
|
|
|
|
|
|
2018-10-27 18:58:52 +05:30
|
|
|
from core.config import xsschecker
|
|
|
|
|
from core.requester import requester
|
2018-11-18 22:46:31 +01:00
|
|
|
from core.utils import replaceValue, fillHoles
|
2018-10-27 18:58:52 +05:30
|
|
|
|
2018-11-16 21:13:45 +05:30
|
|
|
|
2018-11-13 16:47:00 +05:30
|
|
|
def checker(url, params, headers, GET, delay, payload, positions, timeout, encoding):
|
2018-11-11 14:56:19 +05:30
|
|
|
checkString = 'st4r7s' + payload + '3nd'
|
2018-11-13 16:47:00 +05:30
|
|
|
if encoding:
|
|
|
|
|
checkString = encoding(unquote(checkString))
|
2018-11-18 22:46:31 +01:00
|
|
|
response = requester(url, replaceValue(
|
|
|
|
|
params, xsschecker, checkString, copy.deepcopy), headers, GET, delay, timeout).text.lower()
|
2018-10-30 16:28:56 +05:30
|
|
|
reflectedPositions = []
|
|
|
|
|
for match in re.finditer('st4r7s', response):
|
|
|
|
|
reflectedPositions.append(match.start())
|
|
|
|
|
filledPositions = fillHoles(positions, reflectedPositions)
|
2018-11-15 15:41:01 +05:30
|
|
|
# Itretating over the reflections
|
2018-11-11 14:56:19 +05:30
|
|
|
num = 0
|
2018-10-27 18:58:52 +05:30
|
|
|
efficiencies = []
|
2018-11-11 14:56:19 +05:30
|
|
|
for position in filledPositions:
|
|
|
|
|
allEfficiencies = []
|
|
|
|
|
try:
|
2018-11-16 21:13:45 +05:30
|
|
|
reflected = response[reflectedPositions[num]
|
|
|
|
|
:reflectedPositions[num]+len(checkString)]
|
2018-11-11 14:56:19 +05:30
|
|
|
efficiency = fuzz.partial_ratio(reflected, checkString.lower())
|
|
|
|
|
allEfficiencies.append(efficiency)
|
|
|
|
|
except IndexError:
|
|
|
|
|
pass
|
2018-10-30 16:28:56 +05:30
|
|
|
if position:
|
|
|
|
|
reflected = response[position:position+len(checkString)]
|
2018-11-13 16:47:00 +05:30
|
|
|
if encoding:
|
|
|
|
|
checkString = encoding(checkString.lower())
|
|
|
|
|
efficiency = fuzz.partial_ratio(reflected, checkString)
|
2018-11-11 14:56:19 +05:30
|
|
|
if reflected[:-2] == ('\\%s' % checkString.replace('st4r7s', '').replace('3nd', '')):
|
|
|
|
|
efficiency = 90
|
|
|
|
|
allEfficiencies.append(efficiency)
|
|
|
|
|
efficiencies.append(max(allEfficiencies))
|
2018-10-30 16:28:56 +05:30
|
|
|
else:
|
|
|
|
|
efficiencies.append(0)
|
2018-11-11 14:56:19 +05:30
|
|
|
num += 1
|
2018-11-15 10:37:38 +01:00
|
|
|
return list(filter(None, efficiencies))
|