Skip to content

Instantly share code, notes, and snippets.

View mxrch's full-sized avatar
🌏
diving into other realities

mxrch mxrch

🌏
diving into other realities
View GitHub Profile
@mxrch
mxrch / argparse_hack_groups.py
Created December 2, 2021 01:37
[Python Argparse] Add groups to multi subparsers
# Explication => https://stackoverflow.com/a/70193244/12778808
import argparse
import ctypes
parent_parser = argparse.ArgumentParser(description="Redacted")
subparsers = parent_parser.add_subparsers()
@mxrch
mxrch / echoer.py
Last active December 2, 2021 17:21
Easy copy/paste on isolated Windows machines
import sys
from os.path import isfile
if len(sys.argv)<=1:
print("Please specify your source file.")
exit()
elif not isfile(sys.argv[1]):
print("{} not found.".format(sys.argv[1]))
exit()
@mxrch
mxrch / obfuscate.py
Created June 1, 2020 22:28
Obfuscate python code by using chr() functions
payload = 'eval(open("/tmp/flag.txt", "r").read())'
final = ""
for i in payload:
final+="chr({})+".format(ord(i))
final = final[:-1]
print("Here is your payload king :\n-> eval({})".format(final))
@mxrch
mxrch / matomo.conf
Created May 22, 2020 12:29
Matomo NGINX config, but it's working for NGINX 1.18.X
server {
if ($host = yourwebsite.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name yourwebsite.com;
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
location / {