Skip to content

Instantly share code, notes, and snippets.

View BobBurns's full-sized avatar

Bob Burns BobBurns

  • Santa Cruz, CA
View GitHub Profile
@BobBurns
BobBurns / sockpay.c
Created October 3, 2017 03:51
fun payload for process infection
/* compile:
* gcc -fpic -pie -nostdlib sockpay.c -o sockpay
* use with https://github.com/BobBurns/hijack-process
* create a listener with nc -l -p 4444
*/
long _write(long fd, char *buf, unsigned long len)
{
long ret;
@BobBurns
BobBurns / hloop.go
Last active September 21, 2017 04:30
trying to trace golang program with ptrace from Learning Linux Binary Analysis by Elfmaster Ryan O'Neill
package main
import (
"fmt"
"time"
)
func print_hello(str string) {
fmt.Println("hello", str)
}
@BobBurns
BobBurns / aws_check_nrpe.php
Last active October 15, 2016 21:33
Php wrapper script that can be used for nagios checks with an AWS ec2 instance
#!/usr/bin/php
<?php
# see https://gist.github.com/BobBurns/bc16d6e45fc01e61138f026c18187b00
# for a more efficient script using the aws php sdk
# wrapper script that can be used for nagios checks with aws ec2 instance
#
# Must have Instance Id $dim_value
@BobBurns
BobBurns / cloudwatch_nrpe.php
Created October 15, 2016 18:51
Nagios plugin to check AWS Cloudwatch Metrics with AWS PHP SDK
#!/usr/bin/php
<?php
# php script to get aws cloudwatch data and format output
# for nagios check
# can be expanded to get Metrics from all AWS namespaces
# requires aws cli configured and aws sdk for php
# http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
@BobBurns
BobBurns / lfsr6x5.c
Created January 9, 2016 15:42
Understanding Cryptography 2.11
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STREAM (256 * 8)
/* short program to understand linear feed shift register
* and its use in stream ciphers.
*
* modified to solve problem 2.11 in Understanding Cryptography by C. Paar
@BobBurns
BobBurns / aff_c.c
Created January 3, 2016 01:06
c algorithm to decipher affine cipher
#include <stdio.h>
#include <stdlib.h>
/* quick program to solve affine cipher with key a, b mod 26 */
/* usage: ./aff_c <key a> <key b> <optional e=encrypt>
* cipher-text from stdin or pipe
*/
int
@BobBurns
BobBurns / rijndael_field_sbox.c
Created December 30, 2015 19:35
Rijndail S-box the long way
#include <stdio.h>
/* Rijndael Field S-box transformation
* part of the AES encryption algorythm or Rijndal's block cipher.
*
* code expanded on blog @ www.samiam/galois.html
*/
/* global vars */
@BobBurns
BobBurns / rijndal_field_mul_inv.c
Created December 28, 2015 21:29
program to calculate the multiplicative inverse in Rijndal's Galois Feild.
#include <stdio.h>
/* program to demonstrate how to find multiplicative inverse in Rijndal's Galois Field
* part of the AES encryption algorithm or Rijndal's block cipher.
*
* code expanded on blog @ www.samiam/galois.html
*/
/* global vars */
@ program: systick_tst.s
@ programmer: reb
@ device: stm32L152c discovery eval board
@ description: blink led with systick count down
@ uses systick interrupt routine
@
@ how to compile and flash:
@ arm-none-eabi-as -mcpu=cortex-m3 systick_tst.s -o systick_tst.o
@ arm-none-eabi-ld -v -T stm32.ld -nostartfiles -o systick_tst.elf systick_tst.o
@ arm-none-eabi-objcopy -O binary systick_tst.elf systick_tst.bin
@BobBurns
BobBurns / cylon_eyes.s
Created August 14, 2015 21:05
cylon eyes program in arm assembly for stm32L discovery
@ cylon eyes for stm32L discovery
@ uses lcd software driver 1/4 duty 1/3 bias
@ how to compile and flash:
@ arm-none-eabi-as -mcpu=cortex-m3 cylon_eyes.s -o cylon_eyes.o
@ arm-none-eabi-ld -v -T stm32.ld -nostartfiles -o cylon_eyes.elf cylon_eyes.o
@ arm-none-eabi-objcopy -O binary cylon_eyes.elf cylon_eyes.bin
@ then from st-link (https://github.com/texane/stlink)
@ ./st-flash write ../first_arm/cylon_eyes.bin 0x08000000
.thumb