Skip to content

Commit

Permalink
disclaim ownership and explained why i'm using it
Browse files Browse the repository at this point in the history
  • Loading branch information
AlaBouali committed Nov 4, 2023
1 parent 85c07e2 commit cc85441
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions bane/utils/js_fuck.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
I don't claim any copy rights for this script and I lost the original's URL.
So if you know the original author or you are the original author,
please contact me to give you credits or I can remove it if you don't want me to use it.
please contact me to give you credits or I can remove it if you don't want me
to use it since I'm just using it to encode the XSS payloads, nothing more , nothing less.
"""

def get_dict(d):
if sys.version_info < (3,0):
return d.iteritems()
else:
return tuple(d.items())


"""
Expand Down Expand Up @@ -163,7 +159,14 @@ class js_fuck(object):
'~': USE_CHAR_CODE
}

GLOBAL = 'Function("return this")()'
GLOBAL = 'Function("return this")()'

def get_dict(self,d):
if sys.version_info < (3,0):
return d.iteritems()
else:
return tuple(d.items())


def __init__(self, js=None):
'''
Expand Down Expand Up @@ -406,10 +409,10 @@ def numberReplacer(y):
while value != original:
original = value

for key, val in get_dict(self.CONSTRUCTORS):
for key, val in self.get_dict(self.CONSTRUCTORS):
value = replace(r'\b' + key, val + '["constructor"]')

for key, val in get_dict(self.SIMPLE):
for key, val in self.get_dict(self.SIMPLE):
value = replace(key, val)

value = replace(r'(\d\d+)', numberReplacer)
Expand All @@ -435,7 +438,7 @@ def findMissing():
# python 2 workaround for nonlocal
findMissing.missing = {}

for key, value in get_dict(self.MAPPING):
for key, value in self.get_dict(self.MAPPING):
if re.findall(regex, value):
findMissing.missing[key] = value
done = True
Expand Down

0 comments on commit cc85441

Please sign in to comment.