Skip to content

Instantly share code, notes, and snippets.

@jclingensmith
jclingensmith / ToolSyntaxWithIPv6.md
Created January 18, 2025 18:07 — forked from chriselgee/ToolSyntaxWithIPv6.md
Tool Syntax with IPv6

Some tools allow or even require -6 as a command line option, and curl requires an IPv6 address to be in [] (square brackets). Also, for link local addresses, you usually have to specify the local interface you want to use.

  • ping 2001:7b8:666:ffff::1:42 -I eth0
  • nmap -6 2001:7b8:666:ffff::1:42%eth0
  • curl http://[2001:7b8:666:ffff::1:42]:8080/ --interface eth0
  • wget http://[2001:7b8:666:ffff::1:42]:8080/
  • telnet -6 2001:7b8:666:ffff::1:42
  • nc -6 2001:7b8:666:ffff::1:42%eth0 23

Want to find link local addresses for systems in your network segment? Try hitting local hosts and routers with these multicast addresses:

@jclingensmith
jclingensmith / OneLiners.sh
Created January 18, 2025 18:06 — forked from chriselgee/OneLiners.sh
Useful One-Liners
# Find a Linux executable named python3 in the /usr/ directory (finds the python3 executable)
find /usr -name "python3*" -exec file {} \; | grep ELF
# Loop over a set of numbers (pings 192.168.1.1 through 192.168.1.255)
for i in {1..255}; do sudo /usr/bin/ping -c1 192.168.1.$i; done
# Loop over lines in a file; write to a file (resolves hostnames to IP addresses)
while read f; do dig A $f +short; done < hosts.txt > ips.txt
# Loop over files ending in txt in your current directory (counts lines in files)
@jclingensmith
jclingensmith / vpn-refresh.sh
Created October 22, 2021 15:37 — forked from collinbarrett/vpn-refresh.sh
DD-WRT script for selecting an optimal ProtonVPN server
#!/bin/sh
# https://collinmbarrett.com/protonvpn-dd-wrt-api-script/
# specify PATH to run from cron
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
# kill openvpn
PID=$(pidof openvpn)
kill -s SIGTERM "$PID"
@jclingensmith
jclingensmith / ubuntu-hardening.md
Created August 18, 2020 13:38 — forked from lokhman/ubuntu-hardening.md
List of things for hardening Ubuntu

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean