Skip to content

Instantly share code, notes, and snippets.

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

MSKF3000 mskf3000

💭
I may be slow to respond.
View GitHub Profile
@mskf3000
mskf3000 / cloud_metadata.txt
Created June 5, 2023 11:16 — forked from BuffaloWill/cloud_metadata.txt
Cloud Metadata Dictionary useful for SSRF Testing
## IPv6 Tests
http://[::ffff:169.254.169.254]
http://[0:0:0:0:0:ffff:169.254.169.254]
## AWS
# Amazon Web Services (No Header Required)
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/meta-data/iam/security-credentials/dummy
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
@mskf3000
mskf3000 / regions.csv
Created May 22, 2023 06:18 — forked from leighmacdonald/regions.csv
Region Mappings
AD 02 Canillo
AD 03 Encamp
AD 04 La Massana
AD 05 Ordino
AD 06 Sant Julia de Loria
AD 07 Andorra la Vella
AD 08 Escaldes-Engordany
AE 01 Abu Dhabi
AE 02 Ajman
AE 03 Dubai
@mskf3000
mskf3000 / get-country-net-list.sh
Created May 22, 2023 06:14 — forked from serge-larin/get-country-net-list.sh
Get network list by country
#!/bin/bash
if [ -z "$1" ]; then
COUNTRY="ru"
else
COUNTRY=$1
fi
PATTERN=${COUNTRY^^}$
BATCH=50
I=0
ASN_LIST=""
@mskf3000
mskf3000 / haproxy.cfg
Created May 19, 2023 20:45 — forked from SilverBut/haproxy.cfg
[Haproxy cfg checking Socks5] Haproxy cfg to check the Socks5 connection #tags: GFW, network, haproxy, config
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
@mskf3000
mskf3000 / iptables-round-robin.sh
Created May 19, 2023 20:44 — forked from apparentlymart/iptables-round-robin.sh
round robin to three ports on the same host with iptables
# The following example shows a way to use iptables for basic round-robin load balancing, by redirecting
# packets two one of three ports based on a statistic counter.
#
# TCP packets for new sessions arriving on port 9000 will rotate between ports 9001, 9002 and 9003, where
# three identical copies of some application are expected to be listening.
#
# Packets that aren't TCP or that related to an already-established connection are left untouched, letting
# the standard iptables connection tracking machinery send it to the appropriate port.
#
# For this to work well, connections need to be relatively short. Ideally there would be an extra layer
@mskf3000
mskf3000 / tshark.md
Created March 13, 2023 10:47 — forked from typelogic/tshark.md
tshark basics

parsing pcap capture file with tshark

tcpdump -r vagrant_up.pcap -w outfile.pcap "dst port 5150"
tshark -r vagrant_up.pcap -n -T fields -e ip.src -e tcp.srcport -e ip.dst -e tcp.dstport
tshark -r vagrant_up.pcap -T json > /tmp/output.json
jq '.|length' /tmp/output.json
jq '.[4000]' /tmp/output.json

follow a tcp communication between two nodes

@mskf3000
mskf3000 / iptables
Created March 2, 2023 02:39 — forked from marcosptf/iptables
comandos IPTABLES
sudo iptables -t nat -L -n -v
sudo iptables -t filter -F
sudo iptables -t nat -F
sudo iptables -t mangle -F
sudo iptables -t nat -L -n -v
sudo iptables -t nat -A PREROUTING -i eth1 --src 10.3.14.118 --dst 127.0.0.1 -p tcp --dport 1198 -j REDIRECT --to-ports 5000
sudo iptables-save
sudo iptables -t nat -L -n -v
/*descobrir portas abertas */
@mskf3000
mskf3000 / run-as-cron.sh
Created February 9, 2023 12:36 — forked from daladim/run-as-cron.sh
Run a command or a script as cron would
#!/bin/bash
# Run as if it was called from cron, that is to say:
# * with a modified environment
# * with a specific shell, which may or may not be bash
# * without an attached input terminal
# * in a non-interactive shell
# This scripts supports cron jobs run by any user, just run it as the target user (e.g. using sudo -u <username>)
# An up-to-date version of this script may be available at https://github.com/daladim/run-as-cron
@mskf3000
mskf3000 / fapt.sh
Created February 7, 2023 12:42 — forked from spectra/fapt.sh
Parallel downloading for apt-get
#!/bin/bash
NBATCH=3
NPARALLEL=5
(apt-get -y --print-uris $@ | egrep -o -e "http://[^\']+" | xargs -r -l${NBATCH} -P${NPARALLEL} wget -nv -P "/var/cache/apt/archives/") && apt-get $@
@mskf3000
mskf3000 / vpn_namespace.md
Created January 30, 2023 14:23 — forked from EnigmaCurry/vpn_namespace.md
OpenVPN and browser specific network routing with ip netns

OpenVPN and browser specific network routing with ip netns

Create network bridge

A network bridge allows us to have a virtual router that we can plug multiple network interfaces into. The IP address is assigned to the bridge rather than the individual network interface.

Create the bridge device, br0 :