Miscellaneous
Linux Directories
/usr/bin
managed by package manager/usr/local/bin
managed by user
Config Files Default Locations
- Apache config
/etc/apach2/sites-enabled/000-default.conf
- gitlab rails
/opt/gitlab/embedded/service/gitlab-rails/config/secrets.yml
- AWS
~/. aws/config
Share VPN Connection between 2 VMs
On The Linux VM with the openvpn connection
# Enable IP Forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Forward Connection
iptables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
# Add NAT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o tun0 -j MASQUERADE
On The windows vm
References: Networking VMs for HTB | 0xdf hacks stuff Ippsec - HTB Sharp
Log Incoming connections to file
# Setup Logging rule
iptables -A INPUT -p tcp -m state --state NEW -j LOG --log-prefix "IP Tables New-Connection: " -i tun0
# Confirm rule was added
iptables -L
# Check Log file for the connections
grep -i iptables /etc/log/messages
Useful terminal tricks
Pipe to clipboard
# Install package via npm
npm install -g clipboard-cli
# pipe output to clipboard
echo foo | clipboard
# Via xsel
ls | xsel -ib
# Via xclip
ls | xclip -sel clip
# Pipe clipboard to file using xclip
xclip -selection clipboard -o > clipboard.txt
Capabilities
# Allow python to bind to privileged ports
sudo setcap cap_net_bind_service+eip $(which python3.9)
# Check Capabilities
getcap $(which python3)
# or
stat $(which python3)