Skip to content

Instantly share code, notes, and snippets.

View digininja's full-sized avatar
💭
Hacking away

Robin Wood digininja

💭
Hacking away
View GitHub Profile
### Keybase proof
I hereby claim:
* I am digininja on github.
* I am digininja (https://keybase.io/digininja) on keybase.
* I have a public key whose fingerprint is 79D0 248B 504B 5B30 6911 7DEF D671 D402 E447 F6DB
To claim this, I am signing this object:
@digininja
digininja / report_generator.rb
Created May 28, 2015 11:30
Generate a report from a crashed Eyewitness run
#!/usr/bin/env ruby
# Pick up a crashed Eyewitness session and generate a report from it.
#
# Robin Wood robin@digi.ninja https://digi.ninja
#
report = File.open "report.html", "w"
screens_files = Dir["screens/*"]
@digininja
digininja / gist:e5e16b285232ebf0c1df
Last active January 5, 2016 21:41
Redis increase and dump
require "redis"
redis = Redis.new
redis.flushdb
redis.zincrby("colours", 1, "red")
redis.sadd("colours:base:red", "thread")
redis.zincrby("colours", 1, "red")
redis.sadd("colours:base:red", "red box")
redis.zincrby("colours", 1, "green")
@digininja
digininja / gist:d68f3c272778ec9a3299
Last active January 11, 2016 09:25
redis threaded pool queue
#!/usr/bin/env ruby
require "redis"
require "concurrent"
redis = Redis.new
redis.flushdb
pool = Concurrent::FixedThreadPool.new(
Concurrent.processor_count,
@digininja
digininja / macro.php
Created January 24, 2018 20:49
Sample code to go with the Burp Macro blog post at https://digi.ninja/blog/burp_macros.php
<?php
session_start();
$message = "";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if (array_key_exists ("token", $_POST) && array_key_exists ("token", $_SESSION)) {
if (array_key_exists ("token", $_SESSION)) {
if ($_POST['token'] == $_SESSION['token']) {
$message = "Success";
@digininja
digininja / dvwa_db_connection_test.php
Created August 8, 2018 15:06
Check for DVWA database connection issues
<?php
/*
Put this file in the root of the DVWA installation then access it through a browser.
*/
require_once "config/config.inc.php";
function var_dump_pre ($data) {
print "<pre>";
var_dump ($data);
10 PRINT "Hello"
20 GOTO 10
@digininja
digininja / gist:d11e71184fed5db468eb68fc89afed39
Created October 15, 2020 09:18
Reset a git fork to its upstream master
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
@digininja
digininja / day1_part2.rb
Created December 1, 2021 18:30
Solution to day 1 part 2 of advent of code challenge
count = 0
previous = 999999999999999
current = 0
block1=0
block2=0
block3=0
pos=0
File.readlines('input').each do |line|
num = line.to_i
@digininja
digininja / part1.rb
Created December 2, 2021 09:28
advent of code day two part one
depth=0
forward=0
File.readlines('input.txt').each do |line|
if /([^ ]*) ([0-9]*)/ =~ line
puts "direction: " + $1 + " value " + $2 + "\n"
value = $2.to_i
movement = $1
if movement == "forward"
forward = forward + value
else