Skip to content

Instantly share code, notes, and snippets.

View michenriksen's full-sized avatar

Michael Henriksen michenriksen

View GitHub Profile
@michenriksen
michenriksen / dnscheck.rb
Created November 2, 2012 15:29 — forked from daniel-marschner/gist:4001503
Loops until given domain is resolvable. Used to check when new domains are live.
require 'resolv'
require 'date'
unless @domain = ARGV.first
puts "DNS Checker\n\n"
puts "Performs a DNS lookup on a domain until it can be resolved.\n\n"
puts "USAGE:"
puts " ruby #{__FILE__} <domain> [<sleep>]\n\n"
@michenriksen
michenriksen / freenodes.sh
Last active December 25, 2015 12:09
The Freenode IRC network supports connections via Tor hidden service URL's which provides solid anonymity and security, but unfortunately the hosts are a little flaky and you will have to regularly switch out the host. This simple shell script makes it easy to figure out which ones are alive. Note: The scripts assumes that Torsocks (https://code…
hosts=( p4fsi4ockecnea7l.onion lgttsalmpw3qo4no.onion 5jebommkgbfl6agc.onion lbkwyb2csfcgoxwa.onion )
for i in "${hosts[@]}"
do
torsocks 2>&1 > /dev/null nc -w5 $i 6667 2>&1 > /dev/null && echo " ✔ $i is alive!" || echo " ✖ $i seems dead."
done
@michenriksen
michenriksen / viewsource.sh
Last active November 2, 2024 17:00
Simple function to view the source code of a web page in a terminal with syntax highlighting. Very convenient for checking out potentially malicious websites before rendering them in a browser. [Pygments](http://pygments.org/) is used for the syntax highlighting and can be installed with `sudo easy_install pygments`. Copy/Paste the function into…
function viewsource {
/usr/bin/curl --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0" -s "$1" | /usr/local/bin/pygmentize -g -O encoding='utf-8'
}
@michenriksen
michenriksen / mailspoof.rb
Created January 16, 2014 12:08
A Ruby script for spoofing mail directly to the destination's SMTP server. This is not my work, got it from https://defuse.ca/email-spoofing-in-ruby.htm
# A Ruby script for spoofing mail directly to the destination's SMTP server.
# https://defuse.ca/email-spoofing-in-ruby.htm
#
# This code is in the public domain. Do whatever you want with it.
#
# Usage: mailspoof.rb <options>
# -t, --to ADDRESS Send mail to this email address
# -f, --from ADDRESS Send mail from this email address
# -s, --subject SUBJECT Mail subject
# -m, --mail FILE File containing email message

Keybase proof

I hereby claim:

  • I am michenriksen on github.
  • I am michenriksen (https://keybase.io/michenriksen) on keybase.
  • I have a public key whose fingerprint is 6E84 2CEC 82F6 9A2E 0AEF D873 669F 1E2A 8DFA 5CA5

To claim this, I am signing this object:

@michenriksen
michenriksen / anti-theft
Created May 27, 2014 09:10
Simple anti-theft script for Debian systems. When the machine enters battery mode while in lockscreen/screensaver, kill KeePassX, Chromium, Firefox, dismount TrueCrypt volumes and shut down.
#!/bin/sh
# Put this file in /etc/pm/power.d/ and make it executable
case $1 in
true)
# Replace <username> with your actual username.
# You might need to use gnome-screensaver-command instead
if DISPLAY=:0.0 XAUTHORITY=/home/<username>/.Xauthority sudo -u <username> cinnamon-screensaver-command -q | egrep -q 'is active'; then
# Kill KeePassX
killall keepassx
@michenriksen
michenriksen / firehose.rb
Last active August 29, 2015 14:07
Script to view Firechat broadcast messages
# Read more about the issue here: http://breizh-entropy.org/~nameless/random/posts/firechat_and_nearby_communication/
require 'socket'
require 'openssl'
require 'json'
require 'cgi'
FIRECHAT_HOST = '209.237.236.194'
FIRECHAT_PORT = 4176
@michenriksen
michenriksen / subdomains.lst
Last active August 29, 2024 16:24
Subdomain list for bruteforcing
0
01
02
03
0_
1
10
100
101
102
extract() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
@michenriksen
michenriksen / detect-hunchly.html
Created November 14, 2016 13:34
Detecting Hunchly
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Detecting Hunchly</title>
</head>
<body>
<div id="canary">
John Doe [email protected] 888444333