Skip to content

Instantly share code, notes, and snippets.

@ziadoz
ziadoz / download.sh
Last active April 17, 2021 19:37
Download Websites with WGet
# WGet Manual: http://www.gnu.org/software/wget/manual/wget.html
# Link Checker: http://wummel.github.io/linkchecker/
# Archiving URLs: http://www.gwern.net/Archiving%20URLs
# Download Webpage: http://superuser.com/questions/55040/save-a-single-web-page-with-background-images-with-wget
# Output Directory: http://stackoverflow.com/questions/8986139/wget-output-directory-prefix
# WARC Files: http://www.archiveteam.org/index.php?title=Wget_with_WARC_output
# Add -r or --recursive to get the whole website.
wget -T 10 -e robots=off -E -H -k -K -p -nH -nd -P /path/to/dir [URL]
wget --timeout 10 --execute robots=off --adjust-extension --span-hosts --convert-links --backup-converted --page-requisites --random-wait --no-host-directories --no-directories --directory-prefix --mirror --html-extension /path/to/dir [URL]
@xeoncross
xeoncross / counter_test.go
Last active August 2, 2021 22:58
Singleton global counter map for safely keeping track of numbers by name (for debugging metrics) http://play.golang.org/p/9bDMDLFBAY
package main
import (
"fmt"
"sync"
)
// https://blog.golang.org/go-maps-in-action#TOC_6.
// http://stackoverflow.com/questions/1823286/singleton-in-go
@Corb3nik
Corb3nik / h1-212-writeup.md
Last active August 4, 2021 07:11
This is my writeup for the H1-212 CTF

h1-212 CTF Writeup

As an avid CTF'er, I was very much excited when I heard about the H1-212 CTF. Thus, letting my misguided priorities get the better of me, I decided to set my studies aside and try this HackerOne CTF 😄

It didn't take me too long though to realize that I suck at bug bounties and that this challenge wasn't going to be easy...

⚒️ The challenge 🛠️

@cauealvesbraz
cauealvesbraz / aws-iam-get-username-by-access-key.bash
Created January 5, 2019 18:10
AWS IAM Get UserName by Access Key Id
#!/bin/bash
# exit when the command fails
set -o errexit;
# exit when try to use undeclared var
set -o nounset;
accessKeyToSearch=${1?"Usage: bash $0 AccessKeyId"}
@m4ll0k
m4ll0k / chaos.py
Last active September 5, 2022 05:44
# github.com/m4ll0k (@m4ll0k2)
'''
Steps:
0. Make dir like chaos 'mkdir chaos'
1. Download this script in choas dir 'wget https://..'
2. Now: 'python3 choas.py |sort -u > dns_wordlist.txt'
'''
@wrburgess
wrburgess / gist:5528649
Last active November 24, 2022 15:29
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@nstarke
nstarke / nodejs-security-vulnerability-grep.sh
Last active January 25, 2023 05:44
Node.js Security Vulnerability Grep
# this command will return instances where the child_process module is loaded.
# that module is generally a good signal that the application is shelling out
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "require(\s*)\((\s*)'child_process'(\s*))" .
# this command will return instances where code is dynamically executed.
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "eval(\s*)\(" .
# this command will check common dangerous functions and report when strings are arguments
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "(setInterval|setTimeout|new(\s*)Function)(\s*)\((\s*)\".*\"" .
@amanelis
amanelis / nmap.md
Created February 4, 2013 07:02
A thorough guide to NMAP.

#NMAP Guide

  1. Basic scan to see what ports have a valid service running on them:

    nmap {host} nmap -v {host}

Pass the -v flag to print a little more information.

@chrisjacob
chrisjacob / README.md
Created February 14, 2011 14:31
Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout - a step-by-step guide.

Intro

Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout.

IMPORTANT

If you plan on switching between different branches (e.g. git checkout master-experiment then revert back with git checkout master) you will loose your child folder from this tutorial (because it's in your .gitignore and is not part of your master branch).

@haccer
haccer / scanio.sh
Last active July 17, 2023 02:02
PoC script to mass-locate vulnerable subdomains using results from Rapid7's Project Sonar
#!/bin/bash
# Usage : ./scanio.sh <save file>
# Example: ./scanio.sh cname_list.txt
# Premium
function ech() {
spinner=( "|" "/" "-" "\\" )
while true; do
for i in ${spinner[@]}; do
echo -ne "\r[$i] $1"