Skip to content

Instantly share code, notes, and snippets.

View Paradoxis's full-sized avatar
:shipit:
Security Person

Luke Paris Paradoxis

:shipit:
Security Person
View GitHub Profile
@Paradoxis
Paradoxis / daemonize.go
Created December 4, 2021 12:30
GoLang - Daemonize a own process on runtime (MacOS / Linux)
package main
import (
"os"
"time"
"syscall"
)
func main() {
daemonize()
@Paradoxis
Paradoxis / is_development_install.py
Created August 9, 2021 09:56
Checks if a package is installed using an installable flag '-e' without use of pip's internal API
def is_development_install(package: str) -> bool:
"""Check if we're running a development installation"""
import pkg_resources
file = Path(dirname(pkg_resources.__file__)).parent
file = file.joinpath(package.replace('_', '-') + '.egg-link')
return file.exists()
@Paradoxis
Paradoxis / column_to_type.py
Last active March 15, 2019 14:38
SqlAlchemy - Column to native Python type
from sqlalchemy import Column
def column_to_type(column: Column):
"""
Helper to get the native Python type of a column
:param column: SqlAlchemy column
:return: Python type
"""
return column.property.columns[0].type.python_type
@Paradoxis
Paradoxis / flatten_html.py
Created September 24, 2018 14:46
Simple function that 'flattens' HTML documents by removing tags but replacing them with their original content, not too shabby on performance but it works
def flatten_html(html, *remove_tags):
copy = html
for name in remove_tags:
while True:
soup = BeautifulSoup(copy, 'html.parser')
tag = soup.find(name)
if not tag:
break
@Paradoxis
Paradoxis / README.md
Last active February 26, 2021 16:16 — forked from rduplain/README.md
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 16.04 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini:

@Paradoxis
Paradoxis / php-modules-hasher.py
Last active February 22, 2020 13:45
Hashes all PHP modules to keep track of their integrity
from argparse import ArgumentParser
from subprocess import Popen, PIPE
from hashlib import sha1
from os import path, walk
import re
import os
from sys import stderr
def extension_dir():
@Paradoxis
Paradoxis / url-decode.md
Created May 31, 2017 11:10
URL decode CLI

Agressive URL encode

Python based CLI tool to url-decode strings

Usage:

Firstly make a function in your .bash_profile to call the script

function url-decode()
{
 python ~//url_decode.py $@
@Paradoxis
Paradoxis / agressive-url-encode.md
Last active February 10, 2024 23:00
Agressive URL encode

Agressive URL encode

Python based CLI tool to agressively url-encode strings, rather than just encoding non-url characters this tool will encode every character in the URL.

Usage:

Firstly make a function in your .bash_profile to call the script

function url-encode()
{
 python ~//url_encode.py $@
@Paradoxis
Paradoxis / keybase.md
Last active September 2, 2016 13:02
Keybase verification

Keybase proof

I hereby claim:

  • I am paradoxis on github.
  • I am paradoxis (https://keybase.io/paradoxis) on keybase.
  • I have a public key whose fingerprint is 4E1E DEFC A2E2 0F6B B2AF C3DD 94E4 BA77 4EF9 D348

To claim this, I am signing this object:

@Paradoxis
Paradoxis / BrowserBackdoor.js
Last active May 19, 2017 12:15
Browser backdoor REST fallback proposal
function wsConnect(url)
{
if (ws == null && "WebSocket" in window) {
ws = new WebSocket(url);
}
if (ws == null && "RestSocket" in window) {
ws = new RestSocket(url);
}