Bitcoin Forum

Bitcoin => Project Development => Topic started by: ckz666 on November 18, 2014, 05:52:28 PM



Title: b(i)tc(oin)-lookup - a quick and dirty bash-script
Post by: ckz666 on November 18, 2014, 05:52:28 PM
hello all,

i was bored and wrote this little script on my old Macbook to waste my time and to see if it can find any hit (i know that this is almost impossible)  ;D

Code:
#!/bin/bash
#
#
# b(i)tc(oin)-lookup
#
# generate a bitcoin address including privatekey with vanitygen and check for received coins in
# (local)blockchain.
# you can use any blockexplorer/blockchain api, but i prefer local blockchain (like insight) for speed.
# don't spent found coins!


banner()
{
clear
echo "       #############################"
echo "      ##     b(i)tc(oin)-lookup  ##"
echo "     ##          by ckz666      ##"
echo "    #############################"
echo
echo "     coin me if u like it ;)"
echo "1CKZ666MXRwjhFjQpMTgDxKjYCU2fadMDi"
echo
}

if [[ ! -f vanitygen ]]
then
banner
echo "- vanitygen not found!"
echo
exit
fi

banner

count0=0
count1=0
btccount=0

while :
do

vani=$(./vanitygen 2> /dev/null -q 1)
addr=$(echo $vani | sed -e s/[[:space:]]Privkey:.*// -e s?.*Address:[[:space:]]??)
priv=$(echo $vani | sed -e s?.*Privkey:[[:space:]]??)
btc=$(curl -s http://localhost:3000/api/addr/$addr/totalReceived)
count0=$(($count0+1))

if [[ $btc > 0 ]]
then
count1=$(($count1+1))
btccount=$(($btccount + $btc))
echo "$addr:$priv-$btc" >> btcoins
fi
echo -ne " Found $count1 hits with $btccount satoshi's => Try $count0 - $addr $btc \033[0K\r"
done

you need vanitygen (catch it here https://github.com/samr7/vanitygen (https://github.com/samr7/vanitygen)) in the same dir as this script.

Have fun with this ;)