Solutions of https://xss.pwnfunction.com/
Dom-Based XSS
Dom-Based XSS
class Memoization(object): | |
def __init__(self, func): | |
self.func = func | |
self.data = {} | |
def __call__(self, n, **kwargs): | |
if n in self.data: | |
return self.data[n] | |
self.data[n] = self.func(n) |
"""Look for builtins...""" | |
import types | |
def is_builtins(v): | |
"""Does v seem to be the builtins?""" | |
if hasattr(v, "open") and hasattr(v, "__import__"): | |
return True | |
if isinstance(v, dict): | |
return "open" in v and "__import__" in v |
import re | |
from base64 import b64decode | |
import pprint | |
story1 = ''' | |
It's somewhat dark in here, but the walls (unbroken except for the door by | |
which I entered) encircle an area no more than eight feet in diameter. | |
It's horribly dank and dusty--no one can have been in here for years. | |
Is that an open envelope over there on the floor? | |
It seems there is a letter inside. Thank heavens it's in English. |
import binascii | |
txt = [int(t,2) for t in '01001000 01100001 01110000 01110000 01111001 00100000 01000010 01101001 01110010 01110100 01101000 01100100 01100001 01111001'.split()] | |
print ''.join([binascii.unhexlify('%x' % c) for c in txt]) |
#!/bin/bash | |
num=0 | |
for arq in ` find . -type f -name "*.html" -o -name "*.css" -o -name "*.conf" -o -name "*.js" -o -name "*.xml" -o -name "*.txt" -o -name "*.py"` | |
do | |
tmp=`wc -l $arq | awk '{print $1}'` | |
num=`expr $num + $tmp` | |
done | |
echo Total: $num |
|
#coding:utf-8 | |
from string import maketrans | |
class Leet(object): | |
def __init__(self): | |
self.intab = u"013457" | |
self.outab = u"oleast" | |
def encrypter(self, text): |
def sum_digits(num): | |
""" | |
@param: num number as string | |
""" | |
return sum([int(digit) for digit in num]) | |
def validate(cc_number): | |
""" | |
@param: cc_number credit card number as string | |
""" |
#coding:utf-8 | |
class Desktop(object): | |
""" | |
Computador novinho, ainda está todo embalado. | |
""" | |
def __init__(self, preco): | |
self.preco = preco or 'a combinar' | |
self.monitor = 'Monitor AOC Widescreen 19'' 912Vwa' | |
self.cpu = 'Daten' | |
self.extras = {'mouse':True, 'mousepad': True, 'teclado': True} |