Skip to content

Instantly share code, notes, and snippets.

View sampritipanda's full-sized avatar

Sampriti Panda sampritipanda

View GitHub Profile
@sampritipanda
sampritipanda / mixed_cipher.py
Created September 2, 2018 04:19
Tokyo Westerns CTF 2018 - Mixed Cipher
from pwn import *
from randcrack import RandCrack
from gmpy import gcd
from Crypto.Util.number import long_to_bytes
from Crypto.Cipher import AES
# proc = remote('crypto.chal.ctf.westerns.tokyo', 5643)
proc = process('./server.py')
# context.log_level = 'debug'
@sampritipanda
sampritipanda / exploit.c
Created August 24, 2018 09:58
Real World CTF - SCSI Driver Exploitation Challenge
#include <stdint.h>
#include <sys/io.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <string.h>
#include <assert.h>
#include "virt_to_phys.c"
@sampritipanda
sampritipanda / ForPlayer_solve.py
Last active August 21, 2018 12:44
WhiteHat Grandprix 2018 - ForPlayer Solution
from pwn import *
#r = process("/home/gift/run.sh")
r = remote("pwn01.grandprix.whitehatvn.com", 26129)
bin = ELF('./giftshop')
poprdi = 0x000000000000225f # pop rdi ; ret
poprsi = 0x0000000000002261 # pop rsi ; ret
poprdx = 0x0000000000002265 # pop rdx ; ret
putsplt = bin.plt['puts']
putsgot = bin.got['puts']
@sampritipanda
sampritipanda / do_setup.sh
Created July 13, 2018 12:52
Digital Ocean Setup
#!/bin/bash
adduser sampriti
usermod -aG sudo sampriti
rsync --archive --chown=sampriti:sampriti ~/.ssh /home/sampriti
#!/usr/bin/env python
import logging
import socket
import urllib
import ipaddress
import tornado.ioloop
import tornado.iostream
import tornado.web
@sampritipanda
sampritipanda / Vn_x9.31_solve.py
Created December 21, 2017 15:28
Solution for Vn_x9.31 from WhiteHat Grand Prix 2017
import struct
from z3 import *
from pwn import *
from ciphers import tbl, names, permute, xor
import hashlib
import binascii
import os
tbl_rev = [{} for i in range(6)]
for i in range(6):

Keybase proof

I hereby claim:

  • I am sampritipanda on github.
  • I am sampriti (https://keybase.io/sampriti) on keybase.
  • I have a public key whose fingerprint is 8DAA AC1F 77E6 78CF 752D 6DD7 2C5C 6A6A 2C52 02CB

To claim this, I am signing this object:

@sampritipanda
sampritipanda / drafts.js
Created January 11, 2017 23:10
Draft Model for interacting with LocalStorage
var draft_model = (function () {
var exports = {};
// the key that the drafts are stored under.
var KEY = "drafts";
var ls = localstorage();
ls.version = 1;
function createKey () {
// use the base16 of the current time + a random string to reduce
@sampritipanda
sampritipanda / Gemfile
Last active January 12, 2016 17:59
Public Parliament Data Scraper
gem 'nokogiri' # Required for parsing webpages
@sampritipanda
sampritipanda / pair_organiser.rb
Last active November 5, 2015 08:34
Finding all possible bipartite matchings in a set of nodes.
def recursive(a, b)
n = a.length
if n == 0 or n == 1 then
p b
return
end
(1...n).each do |i|
recursive(a - [a[0], a[i]], b + [[a[0], a[i]]])
end