Skip to content

Instantly share code, notes, and snippets.

View cmbaughman's full-sized avatar
🧐
I may be slow to respond.

Chris Baughman cmbaughman

🧐
I may be slow to respond.
View GitHub Profile
@cmbaughman
cmbaughman / fail2ban.md
Created December 13, 2022 16:49
Set up fail2ban

Configure fail2ban

Install

sudo apt install fail2ban

Activate the service (so that after reboot it runs)

sudo systemctl enable fail2ban.service

Create

cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

@cmbaughman
cmbaughman / cloudflare.vpn.md
Last active August 3, 2022 12:17
Cloudflare VPN IPv4 Addresses to block

Keeping a list here of automated attack IPs that use the cloudflare VPN. These are used by automated vulnerability scaners. Fuck those assholes.

173.245.48.0/20 103.21.244.0/22 103.22.200.0/22 103.31.4.0/22 141.101.64.0/18 108.162.192.0/18 190.93.240.0/20

@cmbaughman
cmbaughman / shell-passwords.md
Created July 21, 2022 14:20
Encrypt and Store Passwords for Shell Scripts

Encrypt and Store Passwords for Shell Scripts

Here's a safe and secure method of storing passwords, encrypted, for use in shell scripts. This is in bash, but can easily be ported to other shells as the bulk of the work is handled by the openssl and sshpass apps.

  1. Install openssl and sshpass:
sudo apt update && sudo apt install openssl sshpass -y
@cmbaughman
cmbaughman / RokuFun.md
Created June 8, 2022 23:49
Fun with Roku

Fun stuff with Roku

Enumerate Roku devices

sudo nmap -sV -O -n 192.168.X.X/24

Identify the device and other stuff using netcat on the SSDP multicast address, port 1900.

@cmbaughman
cmbaughman / fix-apt.sh
Last active December 29, 2021 14:35
When apt fails because there are too many kernels installed in /boot, but apt autoremove --purge doesn't remove them...
#!/usr/bin/bash
sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")
@cmbaughman
cmbaughman / firefox-dev-linux.md
Created October 12, 2020 14:14
Install Firefox Developer Edition On Linux

Installing the latest Firefox Developer Edition on Linux

Prerequisites

You need to have the application curl installed. Most Linux distros will already have it included. However, you may need to run either:

Fedora/RedHat

$ sudo dnf -y install curl
@cmbaughman
cmbaughman / linux_ad.sh
Created September 10, 2020 13:00
Ubuntu Active Directory
#!/bin/bash
sudo apt install sssd heimdal-clients msktutil
sudo mv /etc/krb5.conf /etc/krb5.conf.default
COMP=$HOSTNAME
read -p 'What is the domain name? (example: URLFINANCIAL without the .local) ' DOMAIN
LCASEDOMAIN=`echo "$DOMAIN" | tr '[:upper:]' '[:lower:]'`
@cmbaughman
cmbaughman / DockerFile
Created August 7, 2020 16:05 — forked from zhunhung/DockerFile
Selenium Linux DockerFile
FROM ubuntu:latest
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip
# INSTALL DEPENDENCIES
RUN apt-get install -y curl unzip openjdk-8-jre-headless xvfb libxi6 libgconf-2-4
@cmbaughman
cmbaughman / clean-empty-dir.sh
Created August 5, 2020 18:15
Clean up empty directories relative to the current directory
#!/bin/bash
find . -type d -empty -exec rm -i -R {} \;
@cmbaughman
cmbaughman / static-visual.sh
Created August 5, 2020 18:02
Generate White Noise
#!/bin/bash
while true;
do
printf "$(awk -v c="$(tput cols)" -v s="$RANDOM" 'BEGIN{srand(s);while(--c>=0){printf("\xe2\x96\\%s",sprintf("%o",150+int(10*rand())));}}')";
done