Skip to content

Instantly share code, notes, and snippets.

View manesec's full-sized avatar
🏠
Sleep is good

Mane manesec

🏠
Sleep is good
View GitHub Profile
@manesec
manesec / minio-upload.sh
Created February 22, 2024 17:54 — forked from PhilipSchmid/minio-upload.sh
Upload data to Minio using CURL
#!/bin/bash
# Usage: ./minio-upload my-bucket my-file.zip
bucket=$1
file=$2
host=minio.example.com
s3_key=svc_example_user
s3_secret=svc_example_user_password
@manesec
manesec / decryptchromecookies.py
Created December 18, 2023 15:09 — forked from zackmark29/decryptchromecookies.py
Decrypt Chrome Cookies File (Python 3) - Windows
# Based on:
# https://gist.github.com/DakuTree/98c8362fb424351b803e
# https://gist.github.com/jordan-wright/5770442
# https://gist.github.com/DakuTree/428e5b737306937628f2944fbfdc4ffc
# https://stackoverflow.com/questions/60416350/chrome-80-how-to-decode-cookies
# https://stackoverflow.com/questions/43987779/python-module-crypto-cipher-aes-has-no-attribute-mode-ccm-even-though-pycry
import os
import json
import base64
@manesec
manesec / singbox.json
Created November 3, 2023 07:16
解決 HTB THM 靶場連接超時的 singbox 配置文件,使用singbox劫持openvpn
{
"log": {
"level": "info",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "dns_proxy",
"address": "tls://dns.google",
@manesec
manesec / SeBackupPrivilege.md
Created November 2, 2023 09:53
Exploit with SeBackupPrivilege.

SeBackupPrivilege

Exploit with SeBackupPrivilege.

You need to setup NTFS Disk to support remote windows backup.

0x0 Pre-setup ntfs

# Create 2G Disk
@manesec
manesec / Ping Monitor.sh
Last active January 16, 2025 03:47
Use for Ping Monitor
#! /bin/bash
interface="$(ip tuntap show | cut -d : -f1 | head -n 1)"
gatewayip=`ip -j route list table all | jq -r '.[] | select(.dev=="'$interface'") | .gateway' | grep -v null | head -n 1`
localip=`ip -j route list table all | jq -r '.[] | select(.dev=="'$interface'") | .prefsrc' | grep -v null | head -n 1`
delay=`ping $gatewayip -W 1 -c 1| awk -F'/' 'END{ print (/^rtt/? ""$5" ms":"") }'`
if [[ $interface == '' ]]; then
echo "" ;
else
@manesec
manesec / better-sqli-lab.sh
Last active October 13, 2023 17:54
Hackable sqli-lab container
#! /bin/bash
# Please note that the script runs in base64 to prevent spoilers.
# If you're done, you can decode the base64.
# container port
port=8888
echo ' *** This is script used to create Hackable sqli-lab container *** '
echo 'Please Note that: After patch it, You can get a root shell !!'
@manesec
manesec / update_openwrt
Last active July 1, 2023 22:19
A auto change openwrt in docker simple script.
#! /bin/python3
# add crontab
# * * * * * /bin/update_openwrt | tee /update_openwrt.log
import subprocess,sys,time,os
from netaddr import IPAddress,IPNetwork
# simple config openwrt in docker
# by manesec
@manesec
manesec / elasticsearch_in_lxd.md
Created April 17, 2023 21:53 — forked from ruanbekker/elasticsearch_in_lxd.md
Fix Elasticsearch issues in LXD/LXC containers

Errors like this appear when you start elasticsearch in a container:

$ journalctl -xe
Dec 27 16:50:17 elasticsearch-03 mount[62]: mount: /sys/kernel/config: cannot mount configfs read-only.
Dec 27 16:50:17 elasticsearch-03 systemd-sysctl[63]: Couldn't write '262144' to 'vm/max_map_count', ignoring: Read-only file system
Dec 27 16:50:17 elasticsearch-03 systemd-sysctl[63]: Couldn't write '1' to 'fs/protected_hardlinks', ignoring: Read-only file system
Dec 27 16:50:17 elasticsearch-03 systemd-sysctl[63]: Couldn't write '1' to 'fs/protected_symlinks', ignoring: Read-only file system

$ /etc/init.d/elasticsearch status
@manesec
manesec / rocky-docker.sh
Created March 24, 2023 04:16 — forked from ryanmaclean/rocky-docker.sh
Install Docker on Rocky Linux
#!/usr/bin/env bash
## Script to install docker-ce on Rocky Linux
## Run using `sudo rocky-docker.sh`
# Ensuring "GROUP" variable has not been set elsewhere
unset GROUP
echo "Removing podman and installing Docker CE"
dnf remove -y podman buildah
@manesec
manesec / Simple moodle midden click auto locate resource file.js
Created March 13, 2023 03:00
Simple moodle midden click auto locate resource file.
// ==UserScript==
// @name moodle midden click auto locate resource file.
// @namespace http://tampermonkey.net/
// @version 0.1
// @description moodle midden click auto locate resource file.
// @author manesec
// @match https://ummoodle.um.edu.mo/mod/resource/view.php?id=*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==