Skip to content

Instantly share code, notes, and snippets.

View angeloped's full-sized avatar

Angeloped angeloped

  • Philippines
View GitHub Profile
@angeloped
angeloped / 2serv.py
Created December 19, 2021 18:41 — forked from phrawzty/2serv.py
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@angeloped
angeloped / SimpleTcpRedirector.py
Created December 14, 2021 22:23 — forked from sivachandran/SimpleTcpRedirector.py
A simple TCP redirector in python
#!/usr/bin/env python
import socket
import threading
import select
import sys
terminateAll = False
class ClientThread(threading.Thread):
@angeloped
angeloped / http_proxy_connect.py
Created December 13, 2021 09:50 — forked from frxstrem/http_proxy_connect.py
Establish a socket connection through an HTTP proxy in Python.
'''
Establish a socket connection through an HTTP proxy.
Author: Fredrik Østrem <frx.apps@gmail.com>
License:
Copyright 2013 Fredrik Østrem
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without
@angeloped
angeloped / sigmoidGraph.py
Created February 17, 2021 09:42 — forked from Will-777/sigmoidGraph.py
simple sigmoid function with Python
#import section
from matplotlib import pylab
import pylab as plt
import numpy as np
#sigmoid = lambda x: 1 / (1 + np.exp(-x))
def sigmoid(x):
return (1 / (1 + np.exp(-x)))
mySamples = []
@angeloped
angeloped / gist:64bd475d2fb40a81b6b40d6485adb83d
Created February 8, 2021 20:35 — forked from zliuva/gist:1084476
A minimal Mach-o x64 executable for OS X
; A minimal Mach-o x64 executable for OS X (also see below Mountain Lion version)
;
; $ nasm -f bin -o tiny_hello tiny_hello.s
; $ chmod +x tiny_hello
; $ ./tiny_hello
; Hello World!
; $
; c.f.
; http://osxbook.com/blog/2009/03/15/crafting-a-tiny-mach-o-executable/ ( the original tiny mach-o executable )
@angeloped
angeloped / detect.js
Created February 7, 2021 13:34 — forked from hkulekci/detect.js
Detect Operating System with Javascript
// This script sets OSName variable as follows:
// "Windows" for all versions of Windows
// "MacOS" for all versions of Macintosh OS
// "Linux" for all versions of Linux
// "UNIX" for all other UNIX flavors
// "Unknown OS" indicates failure to detect the OS
var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
@angeloped
angeloped / kali-linux-mitmproxy-transparent-arpspoof.md
Created February 4, 2021 04:05 — forked from jkullick/kali-linux-mitmproxy-transparent-arpspoof.md
Intercept HTTP Traffic with Mitmproxy and Arpspoof on Kali Linux
  1. Enable IP forwarding & port redirection
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
  1. Use tmux to run 2 instances of arpspoof:
arpspoof -i $INTERFACE -t $VICTIM_IP $GATEWAY_IP
@angeloped
angeloped / bitconvert.py
Created January 12, 2021 04:50 — forked from laurenarcher/bitconvert.py
Simple python bitcoin currency converter using the Bitcoin Charts API. Documentation here: http://bitcoincharts.com/about/markets-api/
import urllib2
import json
data = urllib2.urlopen("http://api.bitcoincharts.com/v1/weighted_prices.json")
def convert_to_bitcoin(amount, currency):
bitcoins = json.loads(data.read())
converted = float(bitcoins[currency]["24h"]) * amount
print converted
@angeloped
angeloped / base58.py
Created January 3, 2021 08:01 — forked from ianoxley/base58.py
base58 encoding in Python
""" base58 encoding / decoding functions """
import unittest
alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
base_count = len(alphabet)
def encode(num):
""" Returns num in a base58-encoded string """
encode = ''