Skip to content

Instantly share code, notes, and snippets.

@bluec0re
bluec0re / snippet.js
Last active January 24, 2024 19:50
HTB lab annotate flag owners
function getLabId() {
return /\d+$/.exec(location.pathname)[0]
}
async function getActivity() {
const lab_id = getLabId();
let page = 1;
let data = await (await fetch(`https://enterprise.hackthebox.com/api/v1/product/labs/${lab_id}/activity?page=${page}`)).json();
const activities = data.data;
for (page++; page <= data.meta.last_page; page++) {
@bluec0re
bluec0re / highlight-and-copy.sh
Created July 10, 2018 12:20
Uses pygmentize and xclip to create pasteable (e.g. into Google docs, Word, Libreoffice, ...) code highlighting from the command line
#!/bin/bash
style='paraiso-dark'
lang=''
preview=''
options=''
while getopts 's:l:po:' opt;
do
case $opt in
@bluec0re
bluec0re / piccrypt.py
Created December 8, 2016 08:52
Little script to demonstrate different cipher modes applied on images
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Timo Schmid
# copyright: 2016
"""
Script to demonstrate different cipher modes
with based on an image
"""
from __future__ import print_function
import sys
@bluec0re
bluec0re / cert_clone.py
Created November 16, 2016 14:01
Python2 script to clone ssl certificates (chains). Requires M2Crypto.
#!/usr/bin/env python2
# encoding: utf-8
from M2Crypto import X509, EVP, RSA, m2
import sys
import argparse
def clone_to_req(crt, *args):
req = X509.Request()
req.set_version(crt.get_version())
@bluec0re
bluec0re / http_tunnel.py
Last active January 10, 2022 00:29
Tunnels every python code through HTTP proxies by patching socket.socket. Just import the module.
# -*- coding: utf-8 -*-
import socket
import os
# backup original function
_socket = socket.socket
class SocketProxyWrapper:
def __init__(self, socket, proxy):
/*
nfc_creditcard_reader by Jose Miguel Esparza (jesparza AT eternal-todo.com)
http://eternal-todo.com
Based on the PoC readnfccc by Renaud Lifchitz (renaud.lifchitz@bt.com)
Fixed to work with libnfc 1.7.4 by bluec0re
License: distributed under GPL version 3 (http://www.gnu.org/licenses/gpl.html)
#!/bin/bash
# enables reverse tether on android phones
# requires networkmanager
# tested & developed with CM12 (Android 5.1.1)
ADB=adb
# get by nmcli list
NM_CONN="048202e0-a62c-431b-8fc1-cf8fd552343e"
# the rndis device on your phone (adb shell ip link)
IF=usb0
@bluec0re
bluec0re / blur.py
Created July 20, 2015 16:30
Pixelates areas inside videos with opencv
#!/usr/bin/env python2
# encoding: utf-8
import cv2
import cv
import sys
video = cv2.VideoCapture("input.webm")
fps = video.get(cv.CV_CAP_PROP_FPS) / 2
from __future__ import absolute_import, print_function, unicode_literals
import jinja2
from lxml import etree, html
from lxml.html import clean
import logging
import sys
import zipfile
from preprocess import preprocess
import json
#!/usr/bin/env python3
# encoding: utf-8
# Licensed under GPLv3
# http://www.gnu.org/licenses/gpl-3.0.txt
# requires
# - wmctrl
# - vlc
# - irssi
# - terminal emulator with '-e' switch
# - bwm-ng (optional for bandwith display)