This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{ [].__class__.__base__.__subclasses__()[40]('app/views.py').read() }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import base64 | |
| import StringIO | |
| from django.template import engines | |
| from django.http import HttpResponse | |
| from PIL import Image | |
| def example(request): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.template import engines | |
| from django.http import HttpResponse | |
| from PIL import Image | |
| def image_view(request): | |
| image = Image.new("RGB", (200, 200)) | |
| response = HttpResponse(content_type="image/png") | |
| image.save(response, "PNG") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class mymap: | |
| def __init__(self, func, seq): | |
| self.func = func | |
| self.seq = iter(seq) | |
| def __iter__(self): | |
| return self | |
| def __next__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import os | |
| os.environ['MY_SECRET'] = 'oi :D' | |
| ret = subprocess.run(["python3.6", "sub.py"], stdout=subprocess.PIPE) | |
| if 'MY_SECRET' in ret.stdout.decode('utf-8'): | |
| print('pwned!') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In [82]: stdlib = set(open("stdlib").read().split("\n")) | |
| In [83]: result = set() | |
| In [84]: p = Path('.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from hashlib import md5 | |
| import redis | |
| class BloomFilterBaseBackend: | |
| def initialize(self, size): | |
| self.size = size | |
| def validate(self, position): | |
| if position < 0 or position >= self.size: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import wraps | |
| from flask import Flask, escape, request, make_response | |
| app = Flask(__name__) | |
| USERS = {"fabio": "12345", "italo": "abcde"} | |
| def login_required(func): | |
| @wraps(func) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| from pprint import pprint | |
| import requests | |
| def io_block_socket_call(url): | |
| resp = url, requests.get(url).status_code == 200 | |
| return resp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| from pprint import pprint | |
| from concurrent.futures import ProcessPoolExecutor | |
| import requests | |
| def io_block_socket_call(url): | |
| resp = url, requests.get(url).status_code == 200 | |
| return resp |