Skip to content

Instantly share code, notes, and snippets.

View zer0tonin's full-sized avatar
🏳️‍⚧️

Alice Girard Guittard zer0tonin

🏳️‍⚧️
View GitHub Profile
@zer0tonin
zer0tonin / main.go
Last active September 13, 2022 01:37
AES-CBC application
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
"os"
@zer0tonin
zer0tonin / main.go
Created June 22, 2019 19:26
AES-CBC exploit
package main
import (
"encoding/hex"
"fmt"
"os"
"github.com/gdamore/encoding"
)
Feature: bank account
A user's bank account must be able to withdraw and deposit cash
Scenario Outline: Deposit
Given I have a bank account with <start>$
When I deposit <deposit>$
Then it should have a balance of <end>$
Examples:
| start | deposit | end |
@zer0tonin
zer0tonin / init.vim
Last active November 19, 2020 15:37
NeoVim config for python and JS
" Requirements :
" plug.vim
" pip3 install neovim
" npm install -g neovim
" Post-setup
" :PlugInstall
" :UpdateRemotePlugins
" :CocInstall coc-json coc-tsserver
" pyenv
# If you come from bash you might have to change your $PATH
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="~/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="dracula"
@zer0tonin
zer0tonin / shell.php
Created March 9, 2020 08:51
CTF shell
<?php
function featureShell($cmd, $cwd) {
$stdout = array();
if (preg_match("/^\s*cd\s*$/", $cmd)) {
// pass
} elseif (preg_match("/^\s*cd\s+(.+)\s*(2>&1)?$/", $cmd)) {
chdir($cwd);
preg_match("/^\s*cd\s+([^\s]+)\s*(2>&1)?$/", $cmd, $match);
@zer0tonin
zer0tonin / main.go
Created February 18, 2020 16:53
Dumb mutex stuff
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"sync"
"time"
)
@zer0tonin
zer0tonin / orbit.py
Created December 6, 2019 17:49
Advent of Code day 6
class Node:
def __init__(self, value):
self.value = value
self.adjacent = []
def is_santa(self):
return self.value == "SAN"
def is_you(self):
return self.value == "YOU"
@zer0tonin
zer0tonin / parser.py
Created December 5, 2019 16:46
Advent of Code day 5
def param_accessor(instruction, position):
try:
if instruction[-2 - position] == "1":
return lambda pointer, opcodes: opcodes[pointer+position]
except IndexError:
pass
return lambda pointer, opcodes: opcodes[opcodes[pointer+position]]
def op_sum(pointer, opcodes, first_param, second_param):
@zer0tonin
zer0tonin / app.py
Created November 4, 2019 16:54
tartiflette-plugin-scalars example
import asyncio
from ipaddress import ip_address
from tartiflette import Resolver, create_engine
from aiohttp import web
from tartiflette_aiohttp import register_graphql_handlers
@Resolver("Query.ipAddress")
async def resolve_ip_address(parent, args, ctx, info):