Skip to content

Instantly share code, notes, and snippets.

View kristovatlas's full-sized avatar

Kristov Atlas kristovatlas

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kristovatlas on github.
  • I am kristovatlas (https://keybase.io/kristovatlas) on keybase.
  • I have a public key whose fingerprint is A9CE 8949 F2DE 1D7A 8837 13EB 0D3F B453 5AB1 880B

To claim this, I am signing this object:

@kristovatlas
kristovatlas / gist:6d5766e40118596c11fe
Created March 3, 2015 21:25
+kristov on onename verification
Verifying that +kristov is my openname (Bitcoin username). https://onename.com/kristov
standard rules:
1. # unique input scripts == # unique output scripts
2. all output scripts unique
3. at least one pair of outputs has equal value
alternate rules (replace standard rule 1):
1A. # unique inputs > 1
1B. # of unique input scripts > # unique output scripts / 2
tx 01 (standard form):
@kristovatlas
kristovatlas / injection.js
Created March 4, 2016 21:52
A simple example of an Angular injection using $scope.$eval
<!-- angular injection using $scope.$eval -->
<!DOCTYPE html>
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.1/angular.js"></script>
<script type="text/javascript">
function MyController($scope) {
$scope.hack_the_planet = function() {
$scope.myoutput = $scope.$eval($scope.myinput);
}
@kristovatlas
kristovatlas / injection.html
Last active March 18, 2016 19:41
A simple Angular injection using $scope.$eval without reflection
<!-- angular injection using $scope.$eval -->
<!DOCTYPE html>
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.1/angular.js"></script>
<script type="text/javascript">
function MyController($scope) {
$scope.hack_the_planet = function() {
// POC: constructor.constructor('alert(1337)')()
$scope.$eval($scope.myinput);
<!-- brute forces answer to http://alf.nu/ReturnTrue 'transitive' challenge -->
<html>
<head>
<script type="text/javascript">
vals = [NaN, 0, 1, true, false, null, [0], undefined, new Boolean, "", "1", "0", Number(0), Number(1)];
function sleep (time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
@kristovatlas
kristovatlas / cssbanner-beautified2.js
Last active March 9, 2018 21:49
cleaned up version of cssbanner.js
//beautified at http://jsbeautifier.org/ with default options
//and then manually modified
/*jslint bitwise: true */
self.onmessage = function (msg) {
var thecode = msg.data;
/**
* Ostensibly unused function
@kristovatlas
kristovatlas / drozer_setup.sh
Last active February 16, 2020 11:58
Instructions for setting up drozer in MacOS 10.11 "El Capitan"
#Based on https://blog.ropnop.com/installing-drozer-on-os-x-el-capitan/
#Install recent python 2 and viritualenvwrapper
brew install python
brew upgrade python
pip install virtualenvwrapper
#At this point if you try to run mkvirtualenv, you'll get an error message. To resolve, follow the instructions indicated in /usr/local/bin/virtualenvwrapper.sh. In my current copy, they are:
# 1. Create a directory to hold the virtual environments.
# (mkdir $HOME/.virtualenvs).
@kristovatlas
kristovatlas / demo.py
Created June 7, 2017 19:23
Demo requests using Tor and changing circuits
"""Prints external IP address and a few bytes from example.com repeatedly."""
import time
from torrequests import Tor # pip install torrequests
from stem import Signal # pip install stem
from stem.control import Controller # pip install stem
SLEEP_SEC_BT_REQS = 10
def _new_nym():
"""Find first block has a TXO created and spent in the same block
Using a remote API because this should be a fast search early in the blockchain
"""
import json
from time import sleep
import requests
BLOCK_HEIGHT_URL = "https://blockchain.info/block-height/{height}?format=json"
TX_INDEX_URL = "https://blockchain.info/tx-index/{tx_index}/{txo_n}?format=json"