Skip to content

Instantly share code, notes, and snippets.

View rac3rx's full-sized avatar

Chris H. rac3rx

View GitHub Profile
@rac3rx
rac3rx / install_ansible.sh
Created December 20, 2022 21:15 — forked from zoredache/install_ansible.sh
install_ansible.sh Debian/Ubuntu
#!/bin/bash
set -euo pipefail
set -x
virtualenv_path=/usr/local/ansible/stable
# Install packages needed on a base Debian system
apt-get update
</dev/null DEBIAN_FRONTEND=noninteractive \
apt-get --yes install --no-install-recommends $(
@rac3rx
rac3rx / GoogleDorking.md
Created September 21, 2022 21:04 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@rac3rx
rac3rx / import_dod_certs_mac.sh
Last active April 19, 2022 21:26 — forked from dcode/import_dod_certs_mac.sh
Install and trust DoD CA certificates on Mac OS X. Tested on Catalina and Mojave. *NOTE*: This should also enable CAC if you didn't override the system drivers.
url='https://public.cyber.mil/pki-pke/pkipke-document-library/'
export CERT_URL=$(curl -s $url | awk -F '"' 'tolower($2) ~ /dod\.zip/ {print $2}')
#bundle=https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/certificates_pkcs7_v5-6_dod.zip
#export CERT_URL='https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/certificates_pkcs7_DoD.zip'
# Download & Extract DoD root certificates
cd ~/Downloads/
/usr/bin/curl -LOJ ${CERT_URL}
/usr/bin/unzip -o $(basename ${CERT_URL})
@rac3rx
rac3rx / add-dod-certs.sh
Last active April 14, 2022 01:28 — forked from AfroThundr3007730/add-dod-certs.sh
Import DoD root certificates into linux CA store
#!/bin/bash
# Import DoD root certificates into linux CA store
main() {
# Location of bundle from DISA site
url='https://public.cyber.mil/pki-pke/pkipke-document-library/'
bundle=$(curl -s $url | awk -F '"' 'tolower($2) ~ /dod\.zip/ {print $2}')
#bundle=https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/certificates_pkcs7_v5-6_dod.zip
# Set cert directory and update command based on OS
@rac3rx
rac3rx / Example_XCCDF_Loop.ps1
Created August 27, 2021 17:57 — forked from entelechyIT/Example_XCCDF_Loop.ps1
Looping through XCCDF XML with PowerShell
## set the path to the xml xccdf file.
$BenchMarkFilePath = '~\Documents\U_Windows_2012_and_2012_R2_MS_STIG_V2R6_Manual-xccdf.xml'
## load the content as XML
[xml]$Stigx = Get-Content -Path $BenchMarkFilePath -EA Stop
# start by parsing the xccdf security benchmark
if($Stigx){
$StigCollection = @()
# loop through the xccdf benchmark collecting data into an object collection
foreach ($rule in $StigX.Benchmark.Group.Rule){
# XCode Command Line Tools
>xcode-select --install
# Install Homebrew
>ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
>echo PATH=/usr/local/bin:/usr/local/sbin:$PATH >> ~/.bash_profile
>source ~/.bash_profile
>brew tap homebrew/versions
@rac3rx
rac3rx / get_dod_certs.sh
Created July 7, 2021 18:11 — forked from jfeilbach/get_dod_certs.sh
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'
@rac3rx
rac3rx / init-env.sh
Created February 19, 2021 00:02 — forked from wadouk/init-env.sh
cross compilation marvell asustor arm
# http://developer.asustor.com/tools
# from https://neerajcodes.wordpress.com/2017/08/06/intro-to-cross-compilation/
export CCHOST=arm-marvell-linux-gnueabi
export TOOLCAHIN=../$CCHOST/bin/$CCHOST
export CC=$TOOLCAHIN-gcc
export LD=$TOOLCAHIN-ld
export CPP=$TOOLCAHIN-cpp
export CXX=$TOOLCAHIN-g++
export AR=$TOOLCAHIN-ar
./configure --prefix=$(pwd)/target/ --host=CCHOST
@rac3rx
rac3rx / script-template.sh
Created December 18, 2020 11:19 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@rac3rx
rac3rx / new_node_project.sh
Last active June 12, 2020 22:36 — forked from sijpkes/new_node_project.sh
create new node project and github repo script
#!/bin/sh
# @Author: ps158
# @Date: 2017-04-24T13:08:28+10:00
# @Last modified by: ps158
# @Last modified time: 2017-04-24T13:41:13+10:00
# REF: https://www.wolfe.id.au/2014/02/01/getting-a-new-node-project-started-with-npm/
mkdir $1
cd $1
git init