Skip to content

Instantly share code, notes, and snippets.

View dorneanu's full-sized avatar
💭
Engineering #security stuff in #go and #python in #AWS

Victor Dorneanu dorneanu

💭
Engineering #security stuff in #go and #python in #AWS
View GitHub Profile
@dorneanu
dorneanu / stack.dot
Created October 31, 2016 15:15
Graphviz for plotting stack and dereferenced values
// Show stack and dereferenced values using Graphviz (DOT)
// (c) Victor Dorneanu
digraph G {
// Define layout
graph [pad=".75", ranksep="0.95", nodesep="0.05"];
rankdir=LR;
node [shape="record"];
rank=same;
@dorneanu
dorneanu / main.go
Last active September 27, 2023 16:06
Simple JS keylogger (can be used in XSS) in combination with a websocket server in Golang. Adapted from the example in the "Black Hat Go" book.
package main
import (
"flag"
"fmt"
"html/template"
"log"
"net/http"
"github.com/gorilla/mux"
@dorneanu
dorneanu / list_all_repos.py
Last active December 15, 2023 17:10
Python: List all repos inside a organization using python and github3
# Make sure you authorize your access token to be used with SAML
# https://help.github.com/articles/authorizing-a-personal-access-token-for-use-with-a-saml-single-sign-on-organization/
#
# Run:
# python list_all_repos.py <org>
import github3
import os
GITHUB_ACCESS_TOKEN = os.environ["GITHUB_ACCESS_TOKEN"]
@dorneanu
dorneanu / multiprocessing.py
Created May 6, 2015 18:44
Simple parallelism with Python
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Simple demo of using multiprocessing when parsing files """
import sys
import os
import codecs
from multiprocessing import Pool, Process, Queue, cpu_count
@dorneanu
dorneanu / plugin_architecture.md
Last active April 17, 2024 00:15
Python: Implement basic plugin architecture with Python and importlib

Implementing a basic plugin architecture shouldn't be a complicated task. The solution described here is working but you still have to import every plugin (inheriting from the base class).

This is my solution:

Basic project structure

$ tree