Skip to content

Instantly share code, notes, and snippets.

@wrightrocket
wrightrocket / lumma_cf.py
Created September 21, 2024 06:10 — forked from herrcore/lumma_cf.py
Lumma Stealer Deobfuscation (IDA Python)
# import idautils
import idc
import ida_bytes
import ida_ua
import ida_funcs
import ida_idp
from idautils import DecodeInstruction
import struct
jump_instructions = [
@wrightrocket
wrightrocket / doc.md
Created February 7, 2024 07:12 — forked from methanoliver/doc.md
DuckyScript commands supported by Flipper's BadUSB

DuckyScript commands supported by Flipper's BadUSB

Explanations are only given for commands not present in the original DuckyScript, for everything else refer to DuckyScript documentation.

Keys

These mean exactly what one would expect and should need no further explanation.

  • Modifiers: CTRL, CONTROL, SHIFT, ALT, GUI, WINDOWS
  • Combos: CTRL-ALT, CTRL-SHIFT, ALT-SHIFT, ALT-GUI, GUI-SHIFT
@wrightrocket
wrightrocket / Proxmox-Cloudinit.sh
Created November 16, 2023 23:12 — forked from chris2k20/Proxmox-Cloudinit.sh
Proxmox Cloud-Init Template Creation Bash-Script (Ubuntu)
#!/bin/bash
# Creats a ubuntu Cloud-Init Ready VM Template in Proxmox
#
# https://gist.github.com/chris2k20/dba14515071bd5a14e48cf8b61f7d2e2
#
export IMAGENAME="focal-server-cloudimg-amd64.img"
export IMAGEURL="https://cloud-images.ubuntu.com/focal/current/"
@wrightrocket
wrightrocket / pulse_sreaming.md
Created October 4, 2022 02:55 — forked from savegame/pulse_sreaming.md
PulseAudio / PipeWire streaming audio from Client to remote PulseAudio / PipeWire Server

We have Server machine, this computer with Headphones, and we have Client computer, this is remote PC with music =) On Server we should first open port for listening connections from Client :

# on ubuntu 
sudo ufw allow from <Client_IP> to any port 4656 proto tcp
# on fedora ( with firewalld ) 
sudo firewall-ctl --add-port 4656/tcp

note: port 4656 just for sample. you can use any port you want
than on Server, from current user add listening for connections

@wrightrocket
wrightrocket / server_certificates_to_pem.md
Created October 16, 2021 21:40 — forked from stevenhaddox/server_certificates_to_pem.md
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@wrightrocket
wrightrocket / sysctl.conf
Created August 16, 2019 03:10 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
require ‘thor’
require ‘thor/hollaback’
module MyProgram
class Error < StandardError
end
class CLI
class_option :debug, desc: 'Sets up debug mode', aliases: ['-d'], type: :boolean
class_around :safe_execute
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import os
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub
client_id = "<your client key>"
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import os
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub
client_id = "<your client key>"

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!