albertobsd / keyhunt

privkey hunt for crypto currencies that use secp256k1 elliptic curve
MIT License
640 stars 349 forks source link

Server crash #235

Closed sssergy closed 1 year ago

sssergy commented 1 year ago

When receiving data from the client that differs from the public key, the server crashes. You need to add data filtering on the input. Otherwise, it can take a long time to wait for the bloom filter to load with each input error. Yes, and it is impossible to load keys from a file on the server or in the main program?

[+] Thread Key found privkey 2838b13505b26867
[+] Publickey 0232f894937d7b5f893b8862d48ed13ec37f56c2aa202c0a43a262f97174c25ac6 [+] Thread Key found privkey a838b13505b26867
[+] Publickey 02e7daa14feea7f3e6b77aa3ff75989ac171d9b3f7a263e70eab001849f2f18544 ParsePublicKeyHex: Error invalid public key specified (unexpected hexadecimal digit) root@7602:~/keyhunt# ./bsgsd -6 -n 0x100000000000000 -k 192 -t 64

albertobsd commented 1 year ago

ParsePublicKeyHex: Error invalid public key specified (unexpected hexadecimal digit)

Can you share what data send your client?

About load the keys from the program you can use keyhunt for that. but i guess that you want One key at the time no?

sssergy commented 1 year ago

ParsePublicKeyHex: Error invalid public key specified (unexpected hexadecimal digit)

Can you share what data send your client?

About load the keys from the program you can use keyhunt for that. but i guess that you want One key at the time no?

As a result of various experiments, a comma may leak out along with the key or even an incorrect result). This becomes a problem after loading the bloom filter 5 times a day. )) I'm trying different methods of generating keys, though so far at low ranges. And the keys just need to be loaded a lot. The client-server implementation spends a lot of time transmitting and receiving a response. To be honest, I use your program as a bloom filter on small ranges and get the result pretty quickly. But still, more than 200k keys a day do not come out, and this is very little. If there was an option to get data on stdin, then it would be great in general. I tried to figure it out myself, but the knowledge is not enough ...

albertobsd commented 1 year ago

But why are you sending an incorrect format of the data?

The format always need to be the next.

<publickey> <range from>:<range to>

If your client send another format then it will keep happening, try to use trim before sending your data.

Another thing why you said tha the times about transmitting and received the data are high? Those times should be near to zero or instantly.

sssergy commented 1 year ago

[+] Listening in 0.0.0.0:8181 Invalid input format from client, tokens 2 : 1 Invalid input format from client, tokens 2 : 1 [+] Thread Key found privkey 2838b13505b26867
[+] Publickey 0232f894937d7b5f893b8862d48ed13ec37f56c2aa202c0a43a262f97174c25ac6 Invalid input format from client, tokens 1 : MGLNDD_185.153.45.177_8181 ParsePublicKeyHex: Error invalid public key specified (unexpected hexadecimal digit)

This server looks directly to the Internet for me, It looks like this is the problem. Apparently other data comes from the network ... Although I tried to change the ports to others. But then again, this wouldn't be a problem if the server didn't crash when invalid data was entered.

albertobsd commented 1 year ago

My recommendation is only use that server on localhost up 127.0.0.1, your python script can be in the same server.

If your python script is well developed it never going to send wrong data to the server.

I will try to handle all those cases properly in the server.

sssergy commented 1 year ago

With the latest update there is no connection to the server. I did not understand, I launched the old version.

albertobsd commented 1 year ago

you can use netstat and filter the Open ports on your system, and check what address and port is beging used.