Whoops, paste error. I've fixed it above. The top of the script should look like this:
#!/usr/bin/ruby -w
require 'net/http'
require 'json'
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
#!/usr/bin/ruby -w
require 'net/http'
require 'json'
#!/usr/bin/ruby -w
passphrase = 'oops i forgot'
$rpc_pass = "some-password"
def test(passphrase)
puts passphrase.inspect
request = Net::HTTP::Post.new("/")
request.basic_auth "", $rpc_pass
request.body = { method:"walletpassphrase", params:[passphrase, 1] }.to_json
response = Net::HTTP.new("localhost", 8332).request(request)
if response.code == "401" ; puts "Incorrect RPC user/pass" ; exit 1 ; end
ret = JSON.parse response.body
if ret["error"].nil? ; puts "\nFound it! #{passphrase.inspect}" ; exit ; end
return if ret["error"]["code"] == -14 # wrong passphrase
raise "WTF? #{ret.inspect}"
end
def scramble(passphrase)
characters = " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
list = []
# transpose adjacent chars
(passphrase.length - 1).times do |i|
testphrase = passphrase.dup
testphrase[i] = passphrase[i+1]
testphrase[i+1] = passphrase[i]
list << testphrase
end
# delete one char
passphrase.length.times do |i|
testphrase = passphrase.dup
testphrase = testphrase[0,i] + testphrase[(i+1)..-1]
list << testphrase
end
# substitutute one char
passphrase.length.times do |i|
characters.chars.each do |c|
testphrase = passphrase.dup
testphrase[i] = c
list << testphrase
end
end
# insert one char
(passphrase.length + 1).times do |i|
characters.chars.each do |c|
testphrase = passphrase.dup
testphrase.insert(i, c)
list << testphrase
end
end
return list.uniq
end
list1 = scramble(passphrase)
list1.each { |i| test i }
list1.each { |i| scramble(i).each { |j| test j }}
puts "No luck."
exit 1
C:\Users\Antonio\AppData\Roaming\ProtoShares>brute
"the psw "
C:/Users/Antonio/AppData/Roaming/ProtoShares/brute.rb:8:in `test': uninitialized
constant Net (NameError)
from C:/Users/Antonio/AppData/Roaming/ProtoShares/brute.rb:60:in `block
in'
from C:/Users/Antonio/AppData/Roaming/ProtoShares/brute.rb:60:in `each'
from C:/Users/Antonio/AppData/Roaming/ProtoShares/brute.rb:60:in `
'
C:\Users\Antonio\AppData\Roaming\ProtoShares>
puts wallet
#!/usr/bin/ruby -w
require 'net/http'
require 'json'
passphrase = 'oops i forgot'
$rpc_pass = "some-password"
def test(passphrase)
puts passphrase.inspect
request = Net::HTTP::Post.new("/")
request.basic_auth "", $rpc_pass
request.body = { method:"walletpassphrase", params:[passphrase, 1] }.to_json
response = Net::HTTP.new("localhost", 8332).request(request)
if response.code == "401" ; puts "Incorrect RPC user/pass" ; exit 1 ; end
ret = JSON.parse response.body
if ret["error"].nil? ; puts "\nFound it! #{passphrase.inspect}" ; exit ; end
return if ret["error"]["code"] == -14 # wrong passphrase
raise "WTF? #{ret.inspect}"
end
def scramble(passphrase)
characters = " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
list = []
# transpose adjacent chars
(passphrase.length - 1).times do |i|
testphrase = passphrase.dup
testphrase[i] = passphrase[i+1]
testphrase[i+1] = passphrase[i]
list << testphrase
end
# delete one char
passphrase.length.times do |i|
testphrase = passphrase.dup
testphrase = testphrase[0,i] + testphrase[(i+1)..-1]
list << testphrase
end
# substitutute one char
passphrase.length.times do |i|
characters.chars.each do |c|
testphrase = passphrase.dup
testphrase[i] = c
list << testphrase
end
end
# insert one char
(passphrase.length + 1).times do |i|
characters.chars.each do |c|
testphrase = passphrase.dup
testphrase.insert(i, c)
list << testphrase
end
end
return list.uniq
end
list1 = scramble(passphrase)
list1.each { |i| test i }
list1.each { |i| scramble(i).each { |j| test j }}
puts "No luck."
exit 1
#!/usr/bin/ruby
require "net/http"
require "json"
$rpc_pass = "rpc-pass"
words = ['pass1', 'pass2', 'pass3', 'pass4']
max_words = 4
def test(passphrase)
puts passphrase.inspect
request = Net::HTTP::Post.new("/")
request.basic_auth "", $rpc_pass
request.body = { method:"walletpassphrase", params:[passphrase, 1] }.to_json
response = Net::HTTP.new("localhost", 8332).request(request)
if response.code == "401" ; puts "Incorrect RPC user/pass" ; exit 1 ; end
ret = JSON.parse response.body
if ret["error"].nil? ; puts "\nFound it! #{passphrase.inspect}" ; exit ; end
return if ret["error"]["code"] == -14 # wrong passphrase
raise "WTF? #{ret.inspect}"
end
(1..max_words).each do |n_words|
words.repeated_permutation(n_words).each { |p| test p.join }
end
puts "No luck."
#!/usr/bin/ruby
require "net/http"
require "json"
$rpc_pass = "rpc-pass"
words = ['pass1', 'pass2', 'pass3', 'pass4']
max_words = 4
def test(passphrase)
puts passphrase.inspect
request = Net::HTTP::Post.new("/")
request.basic_auth "", $rpc_pass
request.body = { method:"walletpassphrase", params:[passphrase, 1] }.to_json
response = Net::HTTP.new("localhost", 8332).request(request)
if response.code == "401" ; puts "Incorrect RPC user/pass" ; exit 1 ; end
ret = JSON.parse response.body
if ret["error"].nil? ; puts "\nFound it! #{passphrase.inspect}" ; exit ; end
return if ret["error"]["code"] == -14 # wrong passphrase
raise "WTF? #{ret.inspect}"
end
(1..max_words).each do |n_words|
words.permutation(n_words).each do |perm|
[" ", ""].repeated_permutation(perm.count + 2).each do |j|
test(["", *perm, ""].zip(j).join)
end
end
end
puts "No luck."
#!/usr/bin/ruby -w
start = "pass"
finish = "word"
def test(phrase)
print phrase, "\t"
system("./bitcoind", "walletpassphrase", phrase, "20")
case $?.exitstatus
when 0
puts "Found it! #{phrase}"
exit 0
when 127
puts "bitcoind not found in current dir"
exit 1
when nil
puts "Aborting"
exit 1
end
end
(0..20).each do |length|
[1,2,3,4,5,6,7,8,9].repeated_permutation(length) do |digits|
test(start + digits.join + finish)
end
end