Socket not found / Flush Hosts:too many connections error

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Socket not found / Flush Hosts:too many connections error

Postby robertmanlord » 10. December 2019 02:41

Hey I'm fairly new to all of this and am taking some courses online, having a blast so far!! However, this is the first software that has fully stumped me. No amount of research I've done (6+hrs a day for 4 days) has been able to get me up and running, replicating what the teacher is showing. I apologize if I lack some of the correct technical terminology, but I'll give my best attempt at describing the problem and what I've tried so far:
I'm on a kali linux HP pavilion..

IT initially started when my teacher was showing us how to use mysql with hydra to launch a passwords.txt file at the metasploitable server that I've been practicing on. All was fine, I'd logged in to the MariaDB server using #mysql -u root -p.
When I ran this command though, #hydra -l root -P passwords.txt mysql://'ipaddress', I got a series of errors saying "kali-home is blocked because of too many connection errors. Use flush-hosts to solve this issue. So, I ran flush hosts command, same thing. Started changing my my.cnf file to include "max_error_count=100000", "max_connections=100000", and several other options I saw reccomended. Tried using the .cnf directories to include those options because it was saying it didn't recognize those options (ERROR) when I went to start server.
At some point, after doing everything I could to put back together again my configuration files, I realized I was totally lost. Running #locate mysql.sock returns /var/lib/mysql/mysql.sock and
/var/mysql/mysql.sock, but neither of those work when I use them as the socket location, either in my.cnf, or in 50-server.cnf, or mysqld.cnf, whatever directory i use. Once or twice I managed to fix the socket problem, and got into the mariadb server, the Hydra command (#hydra -l root -P passwords.txt mysql://'targetipaddress'), I would AGAIN get the "KALI-HOME BLOCKED, TOO MANY CONNECTIONS, FLUSH HOST".

That led me to try to reconfigure, and losing connection with my mariadb server entirely. Tried to remove and purge mysql-* and mariadb-* then reinstalled.
Now, when i type mysql -u root -p, I can use=manlord and access my database.
I exited out of the MariaDB (manlord) database server, looks like this:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.3.20-MariaDB-1 Debian buildd-unstable
MariaDB{none} Database Changed
MariaDB[Manlord]


Exited MariaDB and again attempted to run #hydra -l root -P passwords.txt mysql://'targetipaddress' and Hydra gives me this..
Hydra v9.0 (c) 2019 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes.

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2019-12-09 20:25:47
[INFO] Reduced number of tasks to 4 (mysql does not like many parallel connections)
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 4 tasks per 1 server, overall 4 tasks, 308 login tries (l:1/p:308), ~77 tries per task
[DATA] attacking mysql://192.168.1.20:3306/
[ERROR] Child with pid 14485 terminating, can not connect
[ERROR] Child with pid 14488 terminating, can not connect
[ERROR] Child with pid 14487 terminating, can not connect
[ERROR] Child with pid 14486 terminating, can not connect
[ERROR] Child with pid 14492 terminating, can not connect
[ERROR] Child with pid 14491 terminating, can not connect
[ERROR] Child with pid 14490 terminating, can not connect
[ERROR] Child with pid 14489 terminating, can not connect
[ERROR] Child with pid 14493 terminating, can not connect
[ERROR] Child with pid 14495 terminating, can not connect
[ERROR] Child with pid 14494 terminating, can not connect
[ERROR] Child with pid 14496 terminating, can not connect
[ERROR] Child with pid 14500 terminating, can not connect
[ERROR] Child with pid 14497 terminating, can not connect
[ERROR] Child with pid 14499 terminating, can not connect
[ERROR] Child with pid 14498 terminating, can not connect
[ERROR] Child with pid 14501 terminating, can not connect
[ERROR] Child with pid 14504 terminating, can not connect
[ERROR] Child with pid 14502 terminating, can not connect
[ERROR] Child with pid 14503 terminating, can not connect
[ERROR] Child with pid 14505 terminating, can not connect
[ERROR] Child with pid 14508 terminating, can not connect
[ERROR] Child with pid 14507 terminating, can not connect
[ERROR] Child with pid 14506 terminating, can not connect
[ERROR] Child with pid 14512 terminating, can not connect
[ERROR] Child with pid 14510 terminating, can not connect
[ERROR] Child with pid 14509 terminating, can not connect
[ERROR] Child with pid 14511 terminating, can not connect
[ERROR] Child with pid 14514 terminating, can not connect
[ERROR] Child with pid 14513 terminating, can not connect
[ERROR] Child with pid 14516 terminating, can not connect
[ERROR] Child with pid 14515 terminating, can not connect
[ERROR] Child with pid 14520 terminating, can not connect
[ERROR] Child with pid 14518 terminating, can not connect
[ERROR] Child with pid 14519 terminating, can not connect
[ERROR] Child with pid 14517 terminating, can not connect
[STATUS] 40.00 tries/min, 40 tries in 00:01h, 277 to do in 00:07h, 4 active
[ERROR] Child with pid 14522 terminating, can not connect
[ERROR] Child with pid 14525 terminating, can not connect
[ERROR] Child with pid 14523 terminating, can not connect
[ERROR] Child with pid 14524 terminating, can not connect
CTRL+c to exit..it just keeps going like that.

I've seen that a couple times before, however, normally it is the "Kali-Home Connections blocked too many errors-flush hosts" error.

Before I attempt to edit anything else myself, (and get myself locked out of my mariaDB server AGAIN), here are my my.cnf configs



# The MySQL database server configuration file.
[mysql]
socket =/var/lib/mysql/mysqld.sock
port =3306
[server]
socket =/var/lib/mysql/mysqld.sock
port =3306

# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#


!/root/home.cnf/
--------------------------------------------------------
the !root/home.cnf/ was reccommended instead of the /etc/mysql/ options, so I tried it and it made no difference. my !root/home.cnf/ is this:


# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
[mysql]
port = 3306
socket = /var/lib/mysql/mysql.sock
[server]
port = 3306
socket = /var/lib/mysql/mysql.sock

!/etc/mysql/conf.d/mysql.cnf
--------------------------------------------------------------------------
When I try to run SQL Dict, I get (The Server Could Not Be Reached)

The Child with PID error is coming up atm, but before it was usually the 'flush hosts, too many connection errors' one.
Could anyone help me with this? Im suspecting its something simple involving my MariaDB/mysql server, that Im not setting it up right and thats why I can access it with mysql -u root -p, but can't actually use it for anything such as Hydra or SQL Dict without getting 1 of two errors.."Too many connection errors, Flush hosts", or "Child with pid ###### terminating, can not connect".

Any help would be greatly appreciated, I will gladly upload any systemctl info or try anything anyone thinks might help, at this point, im lost!
robertmanlord
 
Posts: 1
Joined: 10. December 2019 01:58
XAMPP version: apache2
Operating System: kali linux

Re: Socket not found / Flush Hosts:too many connections erro

Postby Nobbie » 11. December 2019 12:38

You seriously let go of a brut-force attack on your own MySQL server with "hydra", so of course your server broke down and now you're wondering about it? My goodness.

Yes, your Linux is now broken, nobody can fix that, the best thing is to reinstall at least MySQL, I would even reinstall the whole Linux. And after that, don't screw this up anymore.
Nobbie
 
Posts: 13171
Joined: 09. March 2008 13:04


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 17 guests