Skip to content

Instantly share code, notes, and snippets.

View 20esaua's full-sized avatar
💭
Installing Arch Linux

20esaua 20esaua

💭
Installing Arch Linux
View GitHub Profile
@20esaua
20esaua / ttsd_ad.py
Created March 20, 2018 16:02
Script that Carlos Hanson uses to import users into AD.
#!/usr/bin/env python
# coding: utf8
from gluon import *
import re
import smtplib
import tempfile
import ssam_utils
import ttsd.ldaputils
import ttsd.ldaputils.ad
from ttsd.ldaputils import StudentConfiguration
@20esaua
20esaua / INSTRUCTIONS.md
Last active May 13, 2021 10:01
pwn mac, get root

Instructions

  1. Shut down your computer, and turn it on again. Hold ⌘+S while it is booting.

  2. Mount the partition as read/write by running this command:

sudo mount -uw /
  1. When the console is done loading, run the command:
@20esaua
20esaua / rps.py
Last active May 29, 2019 18:14
markov chain based rock paper scissors game (in progress)
from random import choice as random
ROCK = 1
PAPER = 2
SCISSORS = 3
out_of = 3
best = out_of -1
MOVES = {
@20esaua
20esaua / Sanitize.java
Created August 8, 2018 19:01
For sanitizing user input
import java.net.URLEncoder;
import org.apache.commons.lang.StringEscapeUtils;
public class Sanitize {
/*
* @param input the String to be sanitized for use in HTML
* @return the sanitized String
*/
public static String html(Object input) {
var AaB_0x44df=['\x56\x45\x39\x47\x52\x47\x55\x3d','\x65\x56\x70\x34\x56\x47\x45\x3d','\x4d\x48\x67\x78\x4e\x51\x3d\x3d','\x4d\x48\x67\x78\x4e\x67\x3d\x3d','\x61\x6c\x6c\x75\x65\x58\x4d\x3d','\x63\x6d\x35\x59\x55\x6e\x63\x3d','\x64\x33\x52\x6c\x53\x58\x4d\x3d','\x55\x55\x68\x4a\x52\x46\x6f\x3d','\x64\x56\x64\x68\x63\x55\x49\x3d','\x54\x33\x52\x79\x57\x58\x49\x3d','\x4d\x48\x67\x78\x4f\x51\x3d\x3d','\x63\x45\x74\x70\x61\x30\x67\x3d','\x54\x6c\x5a\x4f\x64\x6c\x55\x3d','\x4d\x48\x67\x78\x4e\x77\x3d\x3d','\x4d\x48\x67\x78\x4f\x41\x3d\x3d','\x57\x55\x6c\x50\x5a\x55\x34\x3d','\x64\x57\x68\x52\x54\x48\x6b\x3d','\x57\x6d\x6c\x6c\x63\x58\x67\x3d','\x61\x45\x35\x73\x61\x33\x51\x3d','\x64\x56\x6c\x59\x57\x47\x77\x3d','\x51\x56\x4a\x52\x62\x47\x6b\x3d','\x52\x6d\x39\x43\x54\x46\x59\x3d','\x4d\x48\x67\x30','\x4d\x48\x67\x78','\x4d\x48\x67\x79','\x56\x32\x5a\x69\x51\x56\x6f\x3d','\x4d\x48\x67\x7a','\x4d\x48\x67\x31','\x52\x32\x39\x7a\x62\x32\x77\x3d','\x54\x31\x4a\x47\x56\x30\x6b\x3d','\x62\x6c\x42\x6c\x55\x57\x4d\x3d','\x
import urllib.request
def test(i):
try:
output = (urllib.request.urlopen("https://c.statcounter.com/t.php?sc_project=9723423&java=1&security=7dbba45b&u1=1DED3E2F05F14F9140589E441356E648&sc_random=0.04749143558385471&jg=new&rr=1.1.1.1.1.1.1.1.1&resolution=1920&h=1082340&camefrom=&u=https%3A//masseychem.weebly.com/ib-candidates.html&t=IB%20Candidates%20-%20Mr.%20Massey%27s%20Chemistry%20Pages&rcat=d&rdom=d&rdomg=new&bb=5&sc_snum=5&sess=7a9eb4&p=0", timeout=10).read())
print(i)
except:
print('Timeout!')
def rip():
@20esaua
20esaua / madlib.py
Last active June 4, 2018 15:48
Refactored version
text = 'Once upon a time in the land of Tigernet there lived a wise, but $adjective wizard named James. In his dominion was all kinds of electronic $nouns and $nouns. One day, the wizard Fulton declared, \'Let us make a giant balloon and adorn it with such devices as $nouns, $adjective $nouns, and $adjective $nouns. With these devices we will measure the curvature of the $noun - a $adjective but important scientific inquiry.\' So the many citizens of Tigernet embraced the $adjective mission of their leader and began the $adjective and $adjective task of building the $nouns. They used $adjective tools to make $quantity $adjective $nouns - some were $adjective while others were $adjective. They worked $adverb for $quantity days and nights. Finally, the day came to launch. They filled the $adjective balloon and watched it $adverb rise into the $adjective $adjective sky. It was a beautiful sight.'
for wordtype in {'noun', 'verb', 'adjective', 'adverb', 'quantity'}:
for _ in range(text.count('$%s' % wordtype)
`env -i ./binary` clear env vars
'AABB%<offset>$n' writes 4 (len('AABB')) to 0x41414242 (hex('AABB'))
'AABB%<value-4>x%<offset>$n' writes `value` to 0x41414242
to write 0xABABACAC to 0x41414242, split into 0x4141 and 0x4242:
CABBAABB%<unhex('ABAB')-8>%<offset>$hn%<unhex('ACAC')-unhex('ABAB')-8>%<offset+1>$hn
<address><address+2>%<number>x%<offset>$hn%<other number>x%<offset+1>$hn
@20esaua
20esaua / brainscrape.py
Created April 25, 2018 19:15
scrape brainscrape thing.png
url = 'https://www.brainscape.com/flashcards/domain-4-software-troubleshooting-session-6098579/packs/9226858'
def getHTML(page):
import urllib.request
with urllib.request.urlopen(page) as response:
return response.read().decode('utf-8')
html = getHTML(url).split("<h3 class='card-answer-text' itemprop='text'>")
first = True
@20esaua
20esaua / maze.py
Last active April 11, 2018 16:29
An automatic maze solver thing I wrote in python while in CS160 class
# enter in the maze content in ascii here
maze = [list('######################'),
list('#S #### # # ##'),
list('## #### # ##### ### ##'),
list('## # ###E##'),
list('####### ####### ######'),
list('## # ### ##'),
list('## ######## ##### ##'),
list('## ####### ##### ##'),
list('## ## ##'),