Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
jfeilbach / fips_140-2.md
Last active April 22, 2021 00:59
Disable FIPS; Enable FIPS

Enable FIPS Mode

FIPS stands for “Federal Information Processing Standards.” It’s a set of government standards that define how certain things are used in the government–for example, encryption algorithms. FIPS defines certain specific encryption methods that can be used, as well as methods for generating encryption keys. It’s published by the National Institute of Standards and Technology, or NIST. FIPS mode is stupid.

yum install dracut-fips

For CPUs with the AES New Instructions (AES-NI) support, install the dracut-fips-aesni package as well:

yum install dracut-fips-aesni

@jfeilbach
jfeilbach / squid.conf
Last active November 14, 2019 17:08
improve squid logging
logformat squid %tl %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
```
Time related format codes:
ts Seconds since epoch
tu subsecond time (milliseconds)
tl Local time. Optional strftime format argument
default %d/%b/%Y:%H:%M:%S %z
tg GMT time. Optional strftime format argument
@jfeilbach
jfeilbach / check_tls.sh
Last active March 14, 2023 23:51
Check for TLS cert expiration
#!/bin/bash
SECONDS=0
RED='\033[0;31m'
WHITE='\033[1;37m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
list=''
@jfeilbach
jfeilbach / dark.md
Last active February 18, 2020 07:18
How To Get Dark GNOME Shell Menus And Dialogs On Ubuntu 19.10 With Yaru Theme

Gnome Shell dark

The default dark theme in Ubuntu 19.04/19.10 Gnome is missing some components in gnome shell. This will apple the YAru dark theme to the missing portions of gnome shell.

Install software

sudo apt install git meson sassc libglib2.0-dev libxml2-utils
git clone https://github.com/ubuntu/yaru
cd yaru
meson build
cd build
@jfeilbach
jfeilbach / .vimrc
Last active September 13, 2019 15:54
some .vimrc settings
hi comment ctermfg=grey
if has("syntax")
syntax on
endif
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
@jfeilbach
jfeilbach / get_brent.sh
Last active September 4, 2019 15:47
Checks the last time a user logged into AWS console
#!/bin/bash
# Checks the last time a user logged into AWS console via CloudTrail
# Outputs to stdout or notify OSD
# Requires ~/.aws/credentials with AWS_REGION and AWS_DEFAULT_PROFILE set
SECONDS=0
export AWS_SSH_KEY=<key name>
export AWS_REGION=us-gov-west-1
export AWS_DEFAULT_PROFILE=gov
@jfeilbach
jfeilbach / fix.sh
Last active August 15, 2019 16:58
fix display resolution in vm
#!/bin/bash
# Fix resolution lost during reboot
cmd=$(xrandr --listmonitors | grep Virtual | awk '{ print $3 }')
if [[ "${cmd}" == "2560/677x1440/381+0+0" ]]; then
res=$(gtf 2560 1440 60 | grep Modeline | sed s/Modeline\ //)
base=$(gtf 2560 1440 60 | grep Modeline | awk '{ print $2 }')
xrandr --newmode ${res}
xrandr --addmode Virtual1 ${base}
@jfeilbach
jfeilbach / get_dod_certs.sh
Created August 15, 2019 16:07
get the DoD certs including root certs. download, verify, install, and revoke
#!/bin/bash
# DoD Root Certificate install 19 July 2019
# to do: add Firefix import
# set cert numbers as variables
# combine fingerprint functions
# check all root CA fingerprints
# compare against CRL
SECONDS='0'
NC='\e[0m'
@jfeilbach
jfeilbach / ssl-dh-params.nse
Last active January 8, 2022 17:23
test Diffie-Hellman handshake using nmap
local nmap = require "nmap"
local shortport = require "shortport"
local sslcert = require "sslcert"
local stdnse = require "stdnse"
local string = require "string"
local math = require "math"
local table = require "table"
local tls = require "tls"
local vulns = require "vulns"
local have_ssl, openssl = pcall(require, "openssl")
@jfeilbach
jfeilbach / ssl-cert.nse
Created August 7, 2019 15:18
get tls cert details
local datetime = require "datetime"
local nmap = require "nmap"
local shortport = require "shortport"
local sslcert = require "sslcert"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
local tls = require "tls"
local unicode = require "unicode"