Skip to content

Instantly share code, notes, and snippets.

View chapinb's full-sized avatar

Chapin Bryce chapinb

View GitHub Profile
$ fgrep Invalid\ user auth.log | head -n 5 | awk '{ print $10 }' 188.165.201.89
180.211.137.8
188.165.201.89
180.211.137.8
180.211.137.8
$ fgrep Invalid\ user auth.log | head -n 5
Sep 24 06:27:11 tracker sshd[29197]: Invalid user babs from 188.165.201.89
Sep 24 06:27:13 tracker sshd[29199]: Invalid user hostmaster from 180.211.137.8
Sep 24 06:30:10 tracker sshd[29265]: Invalid user prova from 188.165.201.89
Sep 24 06:30:45 tracker sshd[29267]: Invalid user contact from 180.211.137.8
Sep 24 06:34:20 tracker sshd[29269]: Invalid user contact from 180.211.137.8
$ fgrep "Accepted publickey" auth.log
Sep 29 18:49:39 tracker sshd[12509]: Accepted publickey for root from 209.151.35.27 port 32852 ssh2: RSA SHA256:+EQAdisZCdb274cIdoykPH9p5DAL/VUHLsiNm63eSiM
Sep 29 18:50:17 tracker sshd[12580]: Accepted publickey for root from 209.151.35.27 port 36726 ssh2: RSA SHA256:+EQAdisZCdb274cIdoykPH9p5DAL/VUHLsiNm63eSiM
@chapinb
chapinb / man page for ls
Created January 19, 2019 02:02
ls man page
$ man ls
LS(1) BSD General Commands Manual LS(1)
NAME
ls -- list directory contents
SYNOPSIS
ls [-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1] [file ...]
@chapinb
chapinb / base64_urldecode.sh
Created October 7, 2018 00:18
Quick python one-liner to decode URL safe base64 data that may be improperly padded
# $1 = file to parse
# $2 = file to write to
cat $1 | python -c 'import sys, base64; data=sys.stdin.read(); print base64.urlsafe_b64decode(data+"="*(4-len(data)%4))' > $2
@chapinb
chapinb / parse_gsearch.py
Created June 10, 2018 13:50
Quick demo script for parsing Google search strings from URL query string data
"""Quick script to open a text file of Google search URL query strings
and extract the typed search values.
Copyright 2018 Chapin Bryce.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@chapinb
chapinb / vshot.sh
Last active June 29, 2017 03:43
Modified vshot.sh script for use in the SANS SIFT 3 VM
#!/bin/bash
# vshot - The Volatile Shotgun
# by Devin Gergen ([email protected])
version="4.01"
#updates to come
# 1) extended volatilty tools
# 2) profile specific tools
# 3) -oshm option to use /dev/shm for ouput only (do not copy the memory image file to /dev/shm)
# 4) timeline support
@chapinb
chapinb / first-ten-minutes.sh
Last active January 8, 2021 06:52
First ten minutes on a server
# Based on blogpost https://www.codelitt.com/blog/my-first-10-minutes-on-a-server-primer-for-securing-ubuntu/
# Update and upgrade all
sudo apt-get update
sudo apt-get upgrade -y
# install packages
sudo apt-get install ufw fail2ban unattended-upgrades libpam-google-authenticator -y
# Setup ufw
@chapinb
chapinb / sample_replacement.py
Last active August 29, 2015 14:23
Sample Replacement
# This will do the bulk of the data based on the sample, you will have to add in headers and the accrual amounts. The script is not complete, but includes most of the info needed to get started/research
## Steps
# 1. define lists
# a. list of company names
# b. list of input data to iterate over int the for loop
# c. empty list to apply input data to after it has been processed in the loop
# 2. Iterate over input list
# a. replace values
# b.

Keybase proof

I hereby claim:

  • I am chapinb on github.
  • I am cbryce (https://keybase.io/cbryce) on keybase.
  • I have a public key whose fingerprint is 4799 6E37 B763 6C4C D1A2 DC66 BE16 B1E9 490F 9775

To claim this, I am signing this object: