Skip to content

Instantly share code, notes, and snippets.

View tuxfight3r's full-sized avatar
:octocat:
Working from home

Mohan Balasundaram tuxfight3r

:octocat:
Working from home
View GitHub Profile
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active October 9, 2024 15:34
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@tuxfight3r
tuxfight3r / tcp_flags.txt
Last active October 8, 2024 05:05
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@tuxfight3r
tuxfight3r / vim-shortcuts.md
Last active October 4, 2024 04:38
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@tuxfight3r
tuxfight3r / s3_upload.sh
Last active September 30, 2024 15:12
AWS - Upload files to S3 via curl
#!/bin/bash -x
#Date: 21/7/2017
#Author: Mohan
#Purpose: To upload files to AWS S3 via Curl
#Uploads file at the top level folder by default
#S3 parameters
S3KEY="XXXXXXXXXXX"
S3SECRET="XXXXXXXXXXXXXXXX"
@tuxfight3r
tuxfight3r / ldap_notes.txt
Last active September 20, 2024 16:04
LDAP Search / with TLS
### LDAP SEARCH ###
#search by user
ldapsearch -xv -h ad1.domain.local -p 389 -b "dc=domain,dc=local" -D "user123@domain.local" \
-W "(&(objectClass=user)(sAMAccountName=user123))"
#search by user but dont wrap the output
ldapsearch -x -H ldap://ad1.domain.local -b "dc=domain,dc=local" -D "user123@domain.local" \
-W "(&(objectClass=user)(sAMAccountName=user123))" -o ldif-wrap=no
@tuxfight3r
tuxfight3r / ssh-keygen
Last active September 1, 2024 16:09
ssh key / fingerprint tricks
#Read multiple keys from an authorized_keys file and print the finger print
[root@server01 .ssh]# while read line; do ssh-keygen -l -f /dev/stdin <<< $line; done < authorized_keys
2048 87:7a:4d:70:d2:10:a4:4b:b7:e1:2b:7c:77:92:25:04 /dev/stdin (RSA)
2048 7d:f0:89:94:00:09:bc:70:46:59:8d:9a:70:3b:ac:70 /dev/stdin (RSA)
2048 61:63:ee:0d:f6:d2:d8:d6:ae:37:0c:35:ae:da:51:6a /dev/stdin (RSA)
#read a key from authorized key file
[root@server01 .ssh]# ssh-keygen -l -f authorized_keys
2048 87:7a:4d:70:d2:10:a4:4b:b7:e1:2b:7c:77:92:25:04 authorized_keys (RSA)
@tuxfight3r
tuxfight3r / socat-forward-tcp.sh
Created April 18, 2019 14:15 — forked from drmalex07/socat-forward-tcp4-to-tcp6.sh
Tunnel TCP traffic via socat. #socat
#!/bin/bash
PUBLIC_IP4_IFACE=eth2
LISTEN_IFACE=${PUBLIC_IP4_IFACE}
listen_address=$(ip -f inet addr show dev ${LISTEN_IFACE} | grep -Po 'inet \K[\d.]+')
listen_port=${1}
target_host=${2}
target_port=${3}
@tuxfight3r
tuxfight3r / curl.md
Created February 4, 2021 20:32 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@tuxfight3r
tuxfight3r / heredoc_erb1.rb
Created July 25, 2016 14:56
ruby DATA and __END__ heredoc method
#!/usr/bin/ruby
DATA.each_line do |line|
puts line
end
__END__
Doom
Quake
Diablo
@tuxfight3r
tuxfight3r / dialog.sh
Last active March 30, 2024 17:34
bash script to choose an option with dialog box
#!/bin/bash
HEIGHT=10
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="Cluster Options"
TITLE="Select Cluster"
MENU="Choose one of the following options:"
ENV="${ENV:-dev}"