Skip to content

Instantly share code, notes, and snippets.

View santrancisco's full-sized avatar
🏠
undefined

San santrancisco

🏠
undefined
View GitHub Profile
@santrancisco
santrancisco / deploy.sh
Last active June 16, 2020 07:04
Simple hugo deploy script to S3 bucket
## This used to be the way I deploy ...
## aws --profile=san-study s3 cp ./public/ s3://jeremyandjames/ --recursive
## Now I use this simple script to increamentally update a hugo site on s3 bucket. It is a whole lot faster and take less bandwidth ;)
## Note that the change base on size of the file, not hash because it's quicker to just get the size :p
## Uncomment aws copy and remove command to start using it ;)
#!/bin/bash
set -e
function finish {
@santrancisco
santrancisco / conversio.sh
Last active June 4, 2020 07:54
simple utility bashscript for argos gnome plugin
#!/bin/bash
### Requirements:
### zbarimg, xclip, zenity, xvkbd
### pip: segno
set -e
## Require: xclip, zbarimg, zenity
function pbcopy {
xclip -selection clipboard $1
}
@santrancisco
santrancisco / pchrome.sh
Last active May 28, 2020 05:42
pchrome.sh - bash script to create/manage multiple chrome profiles base on single one - useful for starting new pentest.
#!/bin/bash
## pchrome.sh is a snippet to create various pentest profiles base on 1 single chrome profile.
## The new profiles will have the same Extension, extension setting as the base profile
# Bail if there is an error
set -e
# Uncomment line below if you want to see the command being run
# set -x
@santrancisco
santrancisco / svgdata_san.js
Last active February 10, 2020 15:46
svgdata_san.js = A file use with draw.io to generate SVG with onclick-able elements for my demo
/**
* Sample plugin.
*/
Draw.loadPlugin(function(ui) {
/**
* Overrides SVG export to add metadata for each cell.
*/
var graphCreateSvgImageExport = Graph.prototype.createSvgImageExport;
@santrancisco
santrancisco / errorcheck.txt
Last active January 31, 2020 06:19
custom burp-suite-error-message-checks search
[^\\]\"> ?<[Ss]+[0-9]+> 0 Web Medium Certain
[^\\]"&gt; ?<[Ss]+[0-9]+> 0 Web Medium Certain
@santrancisco
santrancisco / cloudformation.json
Last active June 18, 2019 06:12
cloudformation example
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CTF check",
"Resources": {
"sg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "SSH Security Group",
"SecurityGroupIngress": {
"CidrIp": "0.0.0.0/0",
@santrancisco
santrancisco / gist:d027c777e3b0ce8f689f1e3b949e47cd
Last active June 18, 2019 05:54
Nodejs practice vulnerablecode
// Example of vulnerable code.
const express = require('express');
const router = express.Router();
const {
exec
} = require('child_process')
const fs = require('fs')
const uniqid = require('uniqid')
const streamifier = require('streamifier');
var magic = require('stream-mmmagic');
@santrancisco
santrancisco / bashtrick.md
Created January 31, 2019 02:14
bash tricks - to be updated

gnu sed

masking out key,token,secret when reading a file to stdout - could be used as an alias to used for demo/presenting.

gsed -r -e "s/((key|token|secret)[^(:|=)]*(=|:)[\t| ]+?['|\"]?+)[^('|\"|$)]*('|\"|$)/\1xxxxxxxxxxx\4/g" ~/.aws/credentials
@santrancisco
santrancisco / slackchallenge.py
Last active May 22, 2019 04:32
Simple httpserver in python to answer to slack challenge for event subscription
#!/usr/bin/env python
"""
Very simple HTTP server in python to answer challenge request from slack server when create an event subscription
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
Send a HEAD request::
curl -I http://localhost
Send a POST request::
@santrancisco
santrancisco / getallorgingithub.go
Last active August 22, 2018 04:52
Get all organisations exist in Github - require github token due to rate limiting
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
"time"