Posts

Intentionally change hash of a file

The fastest way to change an executable's cryptographic hash (such as MD5, SHA-1, or SHA-256) without breaking its functionality is to append dummy data (like a single byte or string) to the end of the file. Because Windows Portable Executable (PE) files execute based on internal header offsets, extra trailing bytes are ignored during normal execution. Method 1: Windows PowerShell (Fastest, No Third-Party Tools) You can append a tiny string to the binary using built-in Windows commands: 1. Open PowerShell in the folder containing your .exe file. 2. Check the current hash (optional):powershell Get-FileHash .\yourfile.exe -Algorithm SHA256 Use code with caution. 3. Append extra data to the end of the file:powershell Add-Content -Path .\yourfile.exe -Value "0" -NoNewline Use code with caution. 4. Run Get-FileHash again to verify that the hash has completely changed. (Note: Using echo "text" >> yourfile.exe in PowerShell defaults to UTF-16 encoding, which also...

How to Configure Fail2Ban Safely on an Ubuntu Server Using firewalld and Docker

Setting up Fail2Ban is a great way to automatically block brute-force bots and malicious web scanners. However, copying a generic jail.local template off the internet often causes fail2ban.service to crash on startup—or worse, conflict with firewalld and lock you out of your own VPN. This guide explains the four most common Fail2Ban pitfalls on modern Ubuntu servers (such as Oracle Cloud Ubuntu images) and provides a copy-pasteable configuration that works safely out of the box. Why Generic Fail2Ban Configs Break Before installing, watch out for these four traps: Missing Log Files Crash Fail2Ban: If you enable [nginx-http-auth] or [nginx-badbots] when Nginx isn't installed on the host (or runs inside Docker without mounted logs), Fail2Ban refuses to start with: ERROR: Failed during configuration: Have not found any log file for nginx-http-auth jail Backend Mismatch ( systemd vs. auto ): Modern Ubuntu uses systemd journald for SSH logs ( backend = systemd ), while web ser...

OCI SSH and port forwarding

  How to Lock Down an Oracle Cloud (OCI) Ubuntu VM with SSH Keys, WireGuard VPN, and firewalld Public cloud servers are scanned by automated bots within minutes of going online. Leaving Port 22 (SSH) or internal web dashboards exposed to 0.0.0.0/0 invites constant brute-force attacks—and locking SSH down to a single home IP breaks every time your ISP rotates your dynamic IP address. This complete, production-tested guide walks you through hardening an Oracle Cloud Infrastructure (OCI) Ubuntu VM from start to finish: Enforcing SSH key-only authentication and blocking root login. Setting up a full-tunnel WireGuard VPN so your PC keeps full internet access from any network while connecting to a permanent private IP ( 10.8.0.1 ). Configuring firewalld and OCI Security Lists so Port 22 and internal dashboards (like OpenClaw or Ollama) are completely invisible to the public internet. Accessing localhost -bound dashboards securely via SSH port forwarding . Architecture Overview O...