Skip to content

Instantly share code, notes, and snippets.

@deeso
deeso / setup_nfs.py
Created May 4, 2015 01:28
Script that can be used to set-up nfs on a remote host using paramiko
import paramiko, re, time, sys
def ssh_to_target (hostname, username, password):
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname, username=username, password=password)
return client
def setup_nfs (client, password, cmds):
for cmd in cmds:
transport = client.get_transport()
@deeso
deeso / set_hostname.py
Created May 4, 2015 01:33
set the hostname of a remote host
import paramiko, re, time, sys
def ssh_to_target (hostname, username, password):
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname, username=username, password=password)
return client
def set_hostname(client, password, cmds):
for cmd in cmds:
transport = client.get_transport()
@deeso
deeso / start_ssl.py
Created June 5, 2015 23:28
Start or stop SSL VMS, if no parameter is provided start, otherwise stop
from multiprocessing import Process
import sys, libvirt, paramiko, subprocess, time, os, threading, select, errno
import binascii, subprocess, json, shutil, random, urllib, multiprocessing, re
from datetime import datetime, timedelta
from datetime import datetime
def time_str():
return str(datetime.now().strftime("%H:%M:%S.%f %m-%d-%Y"))
WORKING_LIST = []
@deeso
deeso / keyinfo_to_wireshark.py
Created June 9, 2015 05:08
this file will convert my custom output to a wireshark input that can be used for TLS decryption.
from multiprocessing import Process
import os, urllib, json
import sys, re, libvirt, paramiko, subprocess, time, os, threading, select, errno
import binascii, subprocess, json, shutil
import multiprocessing
from datetime import datetime
WIRESHARK_PMS_FMT = "PMS_CLIENT_RANDOM {pms} {crandom} {ms}"
@deeso
deeso / cmdline.rs
Last active December 13, 2015 16:56
First basic rust program, ever.
extern crate getopts;
use getopts::{optflag,getopts,OptGroup, usage, Matches};
use std::io::{File, Open, Read};
use std::path::Path;
use std::io::{Command};
use std::string::{String};
use std::os;
use std::str;
@deeso
deeso / gist:8085000
Created December 22, 2013 16:30
Example of using r2 ob command
# r2 malloc://1024
[0x00000000]> wx cafebabe00000032003a070002010014546573745661726961626c6553776974636855700700040100106a6176612f6c616e672f4f626a6563740100063c696e69743e010003282956010004436f64650a000300090c0005000601000f4c696e654e756d6265725461626c650100124c6f63616c5661726961626c655461626c65010004746869730100164c546573745661726961626c6553776974636855703b010014546573744d756c7469706c655661726961626c650a001000120700110100116a6176612f6c616e672f496e74656765720c0013001401000776616c75654f660100162849294c6a6176612f6c616e672f496e74656765723b0800160100067472796f6e65090018001a0700190100106a6176612f6c616e672f53797374656d0c001b001c0100036f75740100154c6a6176612f696f2f5072696e7453747265616d3b07001e0100176a6176612f6c616e672f537472696e674275696c646572080020010011417474656d7074696e67207072696e74200a001d00220c00050023010015284c6a6176612f6c616e672f537472696e673b29560a001d00250c00260027010006617070656e6401002d284c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e674275696c6465723b0a001d00290c002a002b010008746
@deeso
deeso / ik_test_case
Created December 22, 2013 21:57
Test Case for SDB, Note Junk between the ',' in the array,
rax -s cafebabe00000032006107000201000f436173655461626c655377697463680700040100106a6176612f6c616e672f4f626a6563740100063c696e69743e010003282956010004436f64650a000300090c0005000601000f4c696e654e756d6265725461626c650100124c6f63616c5661726961626c655461626c65010004746869730100114c436173655461626c655377697463683b010001610100152849294c6a6176612f6c616e672f537472696e673b09001100130700120100106a6176612f6c616e672f53797374656d0c001400150100036f75740100154c6a6176612f696f2f5072696e7453747265616d3b0700170100176a6176612f6c616e672f537472696e674275696c64657208001901000956616c7565206973200a0016001b0c0005001c010015284c6a6176612f6c616e672f537472696e673b29560a0016001e0c001f0020010006617070656e6401001c2849294c6a6176612f6c616e672f537472696e674275696c6465723b0a001600220c00230024010008746f537472696e6701001428294c6a6176612f6c616e672f537472696e673b0a002600280700270100136a6176612f696f2f5072696e7453747265616d0c0029001c0100077072696e746c6e08002b01001756616c75652069732067726561746572207468616e203507002d0100106a6176612f6c616e672f537472696e6
@deeso
deeso / basic_rcore.py
Last active January 2, 2016 06:19
Radare Python example that loads a bin object using the "zip://" URI. Note the core.file_open first, and then the call to core.bin_load with a None object. This will trigger the bin object to be loaded from the IO layer. The core.cmd0 will execute the commands, 'af' and then 'pdf'. 'af' will analyse the functions, and the 'pdf' will print the di…
def flush(c):
k = c.cons
k.flush()
def exec_(c, cmd):
c.cmd0(cmd)
k = c.cons
k.flush()
from r2.r_core import RCore
@deeso
deeso / rax2 example
Created January 7, 2014 03:33
Radare hex to string example.
~/apps$ rax2 -S < ~/workspace/radare_test_cases/bin/radare_test_cases/basic_arithmetic.class
cafebabe0000003300160700020100227261646172655f746573745f63617365732f62617369635f61726974686d657469630700040100106a6176612f6c616e672f4f626a6563740100063c696e69743e010003282956010004436f64650a000300090c0005000601000f4c696e654e756d6265725461626c650100124c6f63616c5661726961626c655461626c65010004746869730100244c7261646172655f746573745f63617365732f62617369635f61726974686d657469633b010018706572666f726d5f62617369635f61726974686d6574696301000328294901000565696768740100014901000374656e0100017001000a536f7572636546696c6501001562617369635f61726974686d657469632e6a617661002100010003000000000002000100050006000100070000002f00010001000000052ab70008b100000002000a00000006000100000003000b0000000c000100000005000c000d00000008000e000f0001000700000052000200030000000c10083b100a3c1a1b603d1cac00000002000a0000000e00030000000600060007000a0008000b0000002000030003000900100011000000060006001200110001000a000200130011000200010014000000020015
@deeso
deeso / Basic Java Reversing with Radare
Created January 26, 2014 07:39
r2 session demonstrating basic Java analysis features.
r2 malloc://4096
-- duck my sick!
[0x00000000]> e asm.comments=false
[0x00000000]> e asm.cmtflgrefs=false
[0x00000000]> e asm.xrefs=false
[0x00000000]> wx cafebabe00000033001707000201001b7261646172655f746573745f63617365732f6368616c6c656e67650700040100106a6176612f6c616e672f4f626a6563740100063c696e69743e010003282956010004436f64650a000300090c0005000601000f4c696e654e756d6265725461626c650100124c6f63616c5661726961626c655461626c650100047468697301001d4c7261646172655f746573745f63617365732f6368616c6c656e67653b01001573696d706c655f636173655f73746d745f3476616c01000328294901000169010001490100016a0100016b01000d537461636b4d61705461626c6501000a536f7572636546696c6501000e6368616c6c656e67652e6a617661002100010003000000000002000100050006000100070000002f00010001000000052ab70008b100000002000a00000006000100000003000b0000000c000100000005000c000d00000008000e000f00010007000000c10002000300000048033b033ca7003c1a08703d1caa0000000000003200000000000000030000002000000026000000320000002c840202a70011840203a7000b840209a70005033c1a100aa1ffc41bac