Skip to content

Instantly share code, notes, and snippets.

View sbassett29's full-sized avatar

Scott B sbassett29

  • Chicago
View GitHub Profile
@sbassett29
sbassett29 / validateSFSMD5s.py
Last active May 21, 2021 19:08
Some python to validate SFS file md5 digests
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Validate SFS download files and md5 sigs en masse
Author: sbassett29
License: CC0
"""
import hashlib
import re
import requests
@sbassett29
sbassett29 / js_sec_grep.sh
Last active May 11, 2021 19:41
A q&d Node/JS "dangerous functions" grep
#!/usr/bin/env bash
###############################################################################
# Author: [email protected]
# License: Apache 2 <https://opensource.org/licenses/Apache-2.0>
# Description:
# Simple js security search
# - http://blog.blueclosure.com/2017/09/javascript-dangerous-functions-part-1.html
# - https://github.com/wisec/domxsswiki/wiki/Direct-Execution-Sinks
# - https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md
###############################################################################
@sbassett29
sbassett29 / sshkv.sh
Last active March 1, 2023 16:20
Quick way to consistently verify ssh key fingerprints of remote hosts
#!/usr/bin/env bash
################################################################################
# Author: [email protected]
# License: Apache 2 <https://opensource.org/licenses/Apache-2.0>
# Description:
# Quick way to consistently verify ssh key fingerprints of remote hosts
################################################################################
set -euo pipefail
# validate arguments
@sbassett29
sbassett29 / index.php
Last active October 29, 2020 21:41
Quick and Dirty StopForumSpam bulk IP search and stats
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@sbassett29
sbassett29 / searchRefs.py
Last active February 4, 2020 21:52
Search for various domains and urls in article references on Wikimedia projects
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Search for various ref domains and urls on Wikimedia projects
Author: sbassett29
License: CC0
Usage examples:
./searchRefs.py example.com
./searchRefs.py example.com/some/url
./searchRefs.py https://example.com/some/?arg=1
@sbassett29
sbassett29 / code_line_count.sh
Last active February 26, 2021 22:08
Opinionated code line count tool for Wikimedia code repo dirs
#!/usr/bin/env bash
################################################################################
# Author: [email protected]
# License: Apache 2 <https://opensource.org/licenses/Apache-2.0>
# Description:
# Opinionated code line count tool for code repo dirs
################################################################################
set -euo pipefail
# vars
@sbassett29
sbassett29 / docker.bash
Last active February 14, 2020 22:03
Some helpful? docker bash commands
# License: CC0
# slightly more sane pretty-print for more obnoxiously-named Docker images
docker images --format \"table {{.Repository}}\t{{.ID}}\t{{.Tag}}\t{{.CreatedSince}}\" | awk 'NR==1 {print \$1\":\"\$2\" \"\$3\":\"\$4\":\"\$5} NR > 1 {print \"...\"substr(\$1,length(\$1)-35,36)\":\"\$2\":\"substr(\$3,0,8)\"... :\"\$4\" \"\$5\" \"\$6}' | column -t -s ':'
# an ok way to reverse-engineer an image to a docker file
docker history --no-trunc --format "{{.CreatedBy}}" $1 | tail -r | sed '/^$/d' | sed 's/^\/bin\/sh -c #(nop) *//g' | sed 's/^|[0-9]/RUN/g' | sed -e $'1s/^/FROM\\\n/' | tr -s ' '
@sbassett29
sbassett29 / WikimediaArticleSearch.py
Last active February 14, 2020 22:01
Some quick python3 to search a wikimedia project article title (single language) across a given project class (wikipedia, wiktionary, etc.)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Article title check across Wikimedia projects
Author: sbassett29
License: CC0
"""
import argparse
import json
import requests