Skip to content

Instantly share code, notes, and snippets.

View dwallraff's full-sized avatar

Dave Wallraff dwallraff

View GitHub Profile
@dwallraff
dwallraff / ssh_remote_config.sh
Last active July 15, 2017 02:19
SSH Config ProxyCommand fun times
Host internal-server
HostName 192.0.1.10
User internal-user
ServerAliveInterval 60
ProxyCommand sh -c ">&2 echo 'Password is: XXXXXXXX'; ssh -T -i ~/.ssh/generic_key external-user@123.123.123.123 'nc %h %p'"
@dwallraff
dwallraff / swap_newline.sh
Created September 21, 2016 16:32
Joins multiple lines and separates them with the string "<br />"
sed ':a;N;$!ba;s/\n/<br \/>/g' # Joins multiple lines and separates them with the string "<br />".
@dwallraff
dwallraff / list_uaac_group_mappings.sh
Created September 27, 2016 20:37
List all UAA LDAP group mappings (uaa scopes to LDAP groups, used to give admin access to a specific LDAP group)
# https://docs.cloudfoundry.org/adminguide/uaa-user-management.html#external-group
uaac group mappings
@dwallraff
dwallraff / nc_tar_pipe.sh
Last active March 3, 2022 02:51
Netcat Tar Pipe
## -z is optional. Traffic sent will be less, but CPU overhead will be higher.
# On the receiving end do:
nc -vl 12345 | tar xzv
# And on the sending end do:
tar czvf - * | nc -v <remote_host> 12345
@dwallraff
dwallraff / bosh_scp.sh
Last active October 4, 2018 12:23
BOSH SCP - used to upload/download files to BOSH managed VMs
# Command to copy files with bosh ssh/scp
# Paths must absolute, no wildcards
# Download
bosh scp <job_name> <job_instance_number> --download <remote_file_path> <local_file_path>
# Upload
bosh scp <job_name> <job_instance_number> --upload <local_file_path> <remote_file_path>
@dwallraff
dwallraff / reserved_addresses.md
Last active May 25, 2025 17:46
Tables of Reserved IP Addresses (blatantly stolen from https://en.wikipedia.org/wiki/Reserved_IP_addresses)

IPv4 Reserved IP Addresses

Address block (CIDR) Range Number of Addresses Scope Decsription
0.0.0.0/8 0.0.0.0–0.255.255.255 16,777,216 Software Current (local, "this") network
10.0.0.0/8 10.0.0.0–10.255.255.255 16,777,216 Private network Used for local communications within a private network
100.64.0.0/10 100.64.0.0–100.127.255.255 4,194,304 Private network IPv4 shared address space
127.0.0.0/8 127.0.0.0–127.255.255.255 16,777,216 Host Used for loopback addresses to the local host
#!/bin/bash
# Secure OpenVPN server installer for Debian, Ubuntu, CentOS and Arch Linux
# https://github.com/Angristan/OpenVPN-install
if [[ "$EUID" -ne 0 ]]; then
echo "Sorry, you need to run this as root"
exit 1
fi
@dwallraff
dwallraff / cli_web_server.sh
Last active February 15, 2017 17:51
Various CLI Web Server examples (netcat, socat, perl, python)
# Netcat
while true ; do nc -k -l 80 < index.html ; done
# Perl
perl -MIO::Socket::INET -ne \
'BEGIN{$l=IO::Socket::INET->new(LocalPort=>80,Proto=>"tcp",Listen=>5,ReuseAddr=>1);\
$l=$l->accept}print $l $_' < index.html
# Socat
socat -u - tcp-listen:80,reuseaddr < index.html
@dwallraff
dwallraff / password_cracking_resources
Created October 6, 2016 13:03
Password cracking resources
https://hashcat.net/wiki/doku.php?id=example_hashes
https://wiki.skullsecurity.org/Passwords
@dwallraff
dwallraff / bird.txt
Created October 10, 2016 19:54
bird
....................../´¯/)
....................,/¯../
.................../..../
............./´¯/'...'/´¯¯`·¸
........../'/.../..../......./¨¯\
........('(...´...´.... ¯~/'...')
.........\.................'...../
..........''...\.......... _.·´
............\..............(
..............\.............\...