feat: add vuln reproduction and detection scripts

This commit is contained in:
Renato Britto
2026-02-27 00:01:55 -03:00
committed by LORDBABUINO
parent 1f7ecf321c
commit fb5381d7b1
11 changed files with 3425 additions and 0 deletions

28
backend/script/mine_blocks.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# mine_blocks.sh — Mine N blocks on the custom Signet
set -euo pipefail
N="${1:-1}"
source "$HOME/.bitcoin/signet_keys.env"
MINER="/home/renato/Desktop/bitcoin/bitcoin/contrib/signet/miner"
GRIND="bitcoin-util grind"
CLI="bitcoin-cli -signet"
CURRENT=$($CLI getblockcount)
TARGET=$((CURRENT + N))
echo "Mining $N blocks (from $CURRENT to $TARGET)..."
BLOCK_TIME=$(date +%s)
for i in $(seq 1 $N); do
BLOCK_TIME=$((BLOCK_TIME + 1))
$MINER \
--cli="bitcoin-cli -rpcwallet=miner" \
generate \
--grind-cmd="$GRIND" \
--address="$MINER_ADDR" \
--min-nbits \
--set-block-time="$BLOCK_TIME" \
2>&1 >/dev/null
done
echo "Done. Block height: $($CLI getblockcount)"