Skip to content

Instantly share code, notes, and snippets.

@hyakuhei
hyakuhei / gvtest.py
Created December 18, 2021 15:23
Script to show nesting issue in GvGen
import subprocess
from gvgen import *
graph = GvGen()
# Everything in our graph should be within this
mainContainer = graph.newItem("Main Container")
# a2 nests under a1 which nests under mainContainer
@hyakuhei
hyakuhei / enumerate.py
Last active April 10, 2021 19:30
AWS Metadata Enumerator (for use with SSRF)
import requests
import json
import base64
import sys
# Scenario - Base addr is a website up/down checker, running on an ec2 instance
# it takes a GET parameter of "addr" and returns two pieces of data:
# base64 of the response text
# status code
INFO:anchor:using config: config.json
DEBUG:stevedore.extension:found extension EntryPoint.parse('anchor = anchor.certificate_ops:sign')
DEBUG:stevedore.extension:found extension EntryPoint.parse('standards_compliance = anchor.validators.standards:standards_compliance')
DEBUG:stevedore.extension:found extension EntryPoint.parse('check_networks = anchor.validators.custom:check_networks')
ERROR:stevedore.extension:Could not load 'check_networks': <module 'anchor.validators.custom' from '/root/anchor/anchor/validators/custom.py'> has no 'check_networks' attribute
ERROR:stevedore.extension:<module 'anchor.validators.custom' from '/root/anchor/anchor/validators/custom.py'> has no 'check_networks' attribute
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 163, in _load_plugins
verify_requirements,
File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 186, in _load_one_plugin
FROM ubuntu:latest
MAINTAINER Robert Clark <hyakuhei@gmail.com>
# root user operations
# Upgrade the base and install required packages
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y \
python-dev \
libssl-dev \
libffi-dev \
[H[J[1;1H[?25l[m[H[J[1;1H[2;27HGNU GRUB version 2.02~beta2
[m[4;2H+----------------------------------------------------------------------------+[5;2H|[5;79H|[6;2H|[6;79H|[7;2H|[7;79H|[8;2H|[8;79H|[9;2H|[9;79H|[10;2H|[10;79H|[11;2H|[11;79H|[12;2H|[12;79H|[13;2H|[13;79H|[14;2H|[14;79H|[15;2H|[15;79H|[16;2H|[16;79H|[17;2H+----------------------------------------------------------------------------+[m[18;2H[19;2H[m Use the ^ and v keys to select which entry is highlighted.
Press enter to boot the selected OS, `e' to edit the commands
before booting or `c' for a command-line. [5;80H [7m[5;3H*CoreOS default [m[5;78H[m[m[6;3H CoreOS USR-A [m[6;78H[m[m[7;3H CoreOS USR-B [m[7;78H[m[m[8;3H [m[8;78H[m[m[9;
'''
Created on 16 Apr 2015
@author: robert
'''
import lxml.html as html
import requests
import logging
import time
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.System as Sys;
using Toybox.Lang as Lang;
class TestWatchView extends Ui.WatchFace {
//! Load your resources here
function onLayout(dc) {
setLayout(Rez.Layouts.WatchFace(dc));
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.System as Sys;
using Toybox.Lang as Lang;
using Toybox.Time as Time;
class WaveWatch1View extends Ui.WatchFace {
//! Constants
const BAR_THICKNESS = 5;
const ARC_MAX_ITERS = 300;
@hyakuhei
hyakuhei / search.sh
Created January 28, 2015 11:30
Simple script to find all statically compiled binaries that appear to use glibc
#!/bin/bash
find / -type f -executable -exec file {} \; | grep statically | cut -d ':' -f 1 > search.txt
for fn in `cat search.txt`; do
if grep --quiet 'glibc' $fn; then
echo $fn is statically linked and uses GLibc
fi
done
[user@...ora-19 ~]$ cat > GHOST.c << EOF
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
struct {