Skip to content

Instantly share code, notes, and snippets.

View betrisey's full-sized avatar

Samuel Bétrisey betrisey

View GitHub Profile
anonymous
anonymous / untrusted-lvl12-solution.js
Created April 19, 2015 18:52
Solution to level 12 in Untrusted: http://alex.nisnevich.com/untrusted/
/*
* robotNav.js
*
* The green key is located in a slightly more
* complicated room. You'll need to get the robot
* past these obstacles.
*/
function startLevel(map) {
// Hint: you can press R or 5 to "rest" and not move the
anonymous
anonymous / untrusted-lvl7-solution.js
Created April 19, 2015 18:09
Solution to level 7 in Untrusted: http://alex.nisnevich.com/untrusted/
/*************
* colors.js *
*************
*
* You're almost at the exit. You just need to get past this
* color lock.
*
* Changing your environment is no longer enough. You must
* learn to change yourself. I've sent you a little something
* that should help with that.
@0xced
0xced / tsr_download.py
Created April 27, 2011 08:57
Download TSR medias
#!/usr/bin/env python
import json, os, subprocess, sys, urllib2
from termcolor import cprint
from xml.dom import minidom
def abort(error):
cprint(error, color='red', file=sys.stderr)
exit(1)
@aspyct
aspyct / workaround.php
Created August 22, 2012 16:10
The most undebuggable PHP snippet ever
<?php
define("true ", false);
function doIt() {
define(" false", true);
define("maybe", rand() & 1);
}
function  ($stupid="clever") {
if (assert_value($stupid)) {
@wolakRafal
wolakRafal / streams_.classpath
Created November 4, 2013 14:05
scala assigment bloxorz
<classpath>
<classpathentry output="target/scala-2.10/classes" path="src/main/scala" kind="src"></classpathentry>
<classpathentry output="target/scala-2.10/test-classes" path="src/test/scala" kind="src"></classpathentry>
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"></classpathentry>
<classpathentry path="./lib_managed/jars/org.scalatest/scalatest_2.10/scalatest_2.10-1.9.1.jar" kind="lib"></classpathentry>
<classpathentry path="./lib_managed/jars/org.scala-lang/scala-actors/scala-actors-2.10.0.jar" kind="lib"></classpathentry>
<classpathentry path="./lib_managed/jars/org.scala-lang/scala-reflect/scala-reflect-2.10.0.jar" kind="lib"></classpathentry>
<classpathentry path="./lib_managed/jars/junit/junit/junit-4.10.jar" kind="lib"></classpathentry>
<classpathentry path="./lib_managed/jars/org.hamcrest/hamcrest-core/hamcrest-core-1.1.jar" kind="lib"></classpathentry>
<classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"></classpathentry>
@danverbraganza
danverbraganza / hangman.py
Last active April 20, 2017 18:52
Hangman implemented in 3 lines of Python! For an explanation of how this works, see http://danverbraganza.com/writings/hangman-in-3-lines-of-python
license, chosen_word, guesses, scaffold, man, guesses_left = 'https://opensource.org/licenses/MIT', ''.join(filter(str.isalpha, __import__('random').choice(open('/usr/share/dict/words').readlines()).upper())), set(), '|======\n| |\n| {3} {0} {5}\n| {2}{1}{4}\n| {6} {7}\n| {8} {9}\n|', list('OT-\\-//\\||'), 10
while not all(letter in guesses for letter in chosen_word) and guesses_left: _, guesses_left = map(guesses.add, filter(str.isalpha, raw_input('%s(%s guesses left)\n%s\n%s:' % (','.join(sorted(guesses)), guesses_left, scaffold.format(*(man[:10-guesses_left] + [' '] * guesses_left)), ' '.join(letter if letter in guesses else '_' for letter in chosen_word))).upper())), max((10 - len(guesses - set(chosen_word))), 0)
print 'You', ['lose!\n' + scaffold.format(*man), 'win!'][bool(guesses_left)], '\nWord was', chosen_word
@dfletcher
dfletcher / tsws
Last active July 21, 2018 12:47
Totally simple web server using Bash and netcat (nc)
Moved to a proprer repositoy, TSWS is a real boy now!
https://github.com/dfletcher/tsws
PRs welcomed.
@betrisey
betrisey / itunes-festival.sh
Last active December 10, 2020 01:27
iTunes Festival - Download recordings
  1. Get your cookie. Either proxy your iPhone/iPod/iPad and record the cookie using the proxy server of your choice or capture the request using your AP with Wireshark or similar

  2. Make sure you have a cookie like token=expires=1409714101~access=/auth/*~md5=2d4466c1...

  3. Find the day of the artist you want to load (e.g. 01, 02, 10, 25) Find the artist on iTunes https://itunes.apple.com/us/artist/*deadmau5*/id*78011850* and take its ID and its name. Add an underscore between these two. (e.g. 78011850_deadmau5)

  4. Launch the script: sh itunes-festival.sh cookie day id_artist

    sh itunes-festival.sh "token=expires=1409714101~access=/auth/*~md5=2d4466c1" 01 78011850_deadmau5

  5. Have fun.

from pwn import *
r = remote('dicec.tf', 31924)
elf = ELF('babyrop')
rop = ROP(elf)
libc = ELF('/lib/x86_64-linux-gnu/libc.so.6')
libc_write = libc.symbols['write']
anonymous
anonymous / untrusted-lvl12-solution.js
Created April 19, 2015 18:53
Solution to level 12 in Untrusted: http://alex.nisnevich.com/untrusted/
/*
* robotNav.js
*
* The green key is located in a slightly more
* complicated room. You'll need to get the robot
* past these obstacles.
*/
function startLevel(map) {
// Hint: you can press R or 5 to "rest" and not move the