Skip to content

Instantly share code, notes, and snippets.

View own2pwn's full-sized avatar
🌴
On vacation

own2pwn

🌴
On vacation
View GitHub Profile
@own2pwn
own2pwn / gist:2d59730ddea6a624e5b417554da0ecc8
Created December 31, 2016 16:55 — forked from TimSC/gist:5251670
Generate an RSA key pair, sign a message and verify it using crypto++ 5.6.1 or later. By Tim Sheerman-Chase, 2013. This code is in the public domain and CC0.
//Generate an RSA key pair, sign a message and verify it using crypto++ 5.6.1 or later.
//By Tim Sheerman-Chase, 2013
//This code is in the public domain and CC0
//To compile: g++ gen.cpp -lcrypto++ -o gen
#include <string>
using namespace std;
#include <crypto++/rsa.h>
#include <crypto++/osrng.h>
#include <crypto++/base64.h>
@own2pwn
own2pwn / DirectoryObserver
Created January 7, 2017 19:04 — forked from eonist/DirectoryObserver
Researching file watching
class DirectoryObserver {
deinit {
dispatch_source_cancel(source)
close(fileDescriptor)
}
init(URL: NSURL, block: dispatch_block_t) {
@own2pwn
own2pwn / heartbleed.py
Created January 13, 2017 15:52 — forked from eelsivart/heartbleed.py
Heartbleed (CVE-2014-0160) Test & Exploit Python Script
#!/usr/bin/python
# Modified by Travis Lee
# Last Updated: 4/21/14
# Version 1.16
#
# -changed output to display text only instead of hexdump and made it easier to read
# -added option to specify number of times to connect to server (to get more data)
# -added option to send STARTTLS command for use with SMTP/POP/IMAP/FTP/etc...
# -added option to specify an input file of multiple hosts, line delimited, with or without a port specified (host:port)
@own2pwn
own2pwn / UnCrustify-Swift.cfg
Created February 23, 2017 20:30 — forked from brcimo/UnCrustify-Swift.cfg
Uncrustify Swift in Allman Style
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.4.3 (252)
#
# General
# -------
## Other
@own2pwn
own2pwn / Civic.terminal
Created March 4, 2017 13:23 — forked from hum-n/Civic.terminal
macOS Terminal theme based on Civic Xcode 8 theme (WWDC 2016 colors)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjE0NTA5ODAzOTIgMC4xNDkwMTk2MDc4IDAuMTg4MjM1Mjk0MQAQAYAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
@own2pwn
own2pwn / gist:10125f504a04d647c3dfb417b0ab4a24
Created May 13, 2017 19:23 — forked from Ayms/gist:077b114a27450f773939
Monitoring and blocking the bittorrent monitoring spies

##Target

Protecting the privacy of the bittorrent users and protecting them from the monitoring spies making their activity much less visible by changing the way they connect to a torrent and setting a method to establish dynamic blocklists and maintain them.

##Abstract

Previous research has focused mainly on discovering monitors using trackers, this study focuses on tracking and blocking the monitors using the bittorrent peers and content discovery system only (called the DHT).

The global result is that the spies are organized to monitor automatically whatever exists in the bittorrent network, they are easy to find but difficult to follow since they might change their IP addresses and are polluting the DHT.

#!/usr/bin/python
from impacket import smb
from struct import pack
import os
import sys
import socket
'''
EternalBlue exploit by sleepya
The exploit might FAIL and CRASH a target system (depended on what is overwritten)
@own2pwn
own2pwn / compareimages.swift
Created July 6, 2017 12:39 — forked from SheffieldKevin/compareimages.swift
A couple of swift functions for comparing two CGImage using CIImage in OS X
/**
@brief Returns true if images have same meta. Width, Height, bit depth.
@discussion Assumes images are non null.
*/
func doImagesHaveSameMeta(#image1:CGImage, #image2:CGImage) -> Bool {
if CGImageGetWidth(image1) != CGImageGetWidth(image2) {
return false
}
if CGImageGetHeight(image1) != CGImageGetHeight(image2) {
@own2pwn
own2pwn / Digest.swift
Created July 19, 2017 19:42 — forked from advantis/Digest.swift
SHA1 digest in Swift
import Foundation
func sha1(data: NSData) -> String {
let length = Int(CC_SHA1_DIGEST_LENGTH)
var digest = [UInt8](count: length, repeatedValue: 0)
CC_SHA1(data.bytes, CC_LONG(data.length), &digest)
return digest.map { String(format: "%02x", $0) }.reduce("", +)
}
func sha1(string: String) -> String? {
@own2pwn
own2pwn / ProtocolAssociatedType.swift
Created July 22, 2017 08:08 — forked from troystribling/ProtocolAssociatedType.swift
A swift protocol with associated type used as type parameter in generic function
protocol Thing {
typealias argType
func doit(val:argType) -> argType
}
class IntThing : Thing {
func doit(val: Int) -> Int {
return val + 1
}
}