Тёмный

How To: Reset Linux MySQL Root user password - NetSecNow Kali Linux 2.0 

NetSecNow
Подписаться 48 тыс.
Просмотров 16 тыс.
50% 1

Learn More at: www.PentesterUniversity.org
A quick tutorial on how to reset your lost root mysql password via terminal. Use Caution when editing ANYTHING SQL related! I am not responsible for you breaking your machines lol.
Links:
Website: www.LearnNetSec.com
Twitter: @LearnNetSec

Наука

Опубликовано:

 

9 ноя 2015

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 101   
@OMFGTrexKyle
@OMFGTrexKyle 8 лет назад
You think you can do some videos on rooting? And also I think you should try out a Linux called backbox it is a great distro for pen testers based off Ubuntu 14.04 I think you should take a look at it!
@emiliodwwdaa143
@emiliodwwdaa143 8 лет назад
Do you have a video how to crack all users on a website that are using cms ??
@startengine8838
@startengine8838 8 лет назад
u back!!!!!!!!
@NetSecNow
@NetSecNow 8 лет назад
indeed
@mohammedaljaberi1631
@mohammedaljaberi1631 8 лет назад
Are you planning to make CSRF video soon..? Because I'm really looking forward to learn it =D Thank you
@NetSecNow
@NetSecNow 8 лет назад
Yes very soon :-)
@emiliodwwdaa143
@emiliodwwdaa143 8 лет назад
How do you find the hashes lets say i found a website and ther eis login forms right, u know the username u want to get into, but how do u find the hash og the users password?
@NetSecNow
@NetSecNow 8 лет назад
We have a video on sql injection
@haNguyen-ir5nk
@haNguyen-ir5nk 8 лет назад
Are you gonna make new tutorial soon? What took you so long?
@NetSecNow
@NetSecNow 8 лет назад
Yes. Time is key. I'm hoping to make some more when work slows down.
@johndoh8119
@johndoh8119 7 лет назад
So when I get to the step where we enter `mysql -u root` I get the following error message, ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory") Seems like I'm doing something wrong. I dont particularly remember ever being prompted to set up a MYSQL server when installing Kali, maybe I never installed it and thats the problem ? Any help would be greatly appreciated
@johndoh8119
@johndoh8119 7 лет назад
Not sure if this will help deduce whats wrong but, when I enter localhost/dvwa/ into my search bar I get the following... System error - config file not found. Copy config/config.inc.php.dist to config/config.inc.php and configure to your environment. When I go to my dvwa directory and go to the config directory my file is... config.inc.php.dist Seems like dvwa is telling me to change that to `config.inc.php`, then configure my env but I'm hesitant to just start doing that without knowing the consequences.
@NetSecNow
@NetSecNow 7 лет назад
Hey John, Can you type in service mysql start and then service mysql status?
@johndoh8119
@johndoh8119 7 лет назад
Yeah so I'm able to start mysql with `service mysql start` then check the status and see it is running. I realized I hadn't copied the config file correctly, I got that working and was able to view the setup page. But now I am stuck on setting up the dvwa database. When i select create/reset database it says "Could not connect to the MySQL service. Please check the config file." There are three main issues I believe I have 1. PHP function allow_url_include: Disabled, so here it seems like I have to somewhow have allow_url_include=on but I cant find it in my sytem, just not sure on the path to edit the allow_url_include 2. PHP module gd: Missing, not sure what this means 3. reCAPTCHA key: Missing, then there is this as well 4. [User: root] Writable folder /var/www/html/dvwa/hackable/uploads/: No [User: root] Writable file /var/www/html/dvwa/external/phpids/0.6/lib/IDS/tmp/phpids_log.txt: No Then I Get this as well, quite a few errors I have to iron out, any help at all would be tremendously appreciated
@johndoh8119
@johndoh8119 7 лет назад
In regards to the first issue; I am currently searching through /etc/php/7.0 to find the config file where I Would change the php function on to allow_url_include.
@johndoh8119
@johndoh8119 7 лет назад
I know this is slightly off the topic of the video but I was initially watching your how to on setting up dvwa and got stuck on the mysql part, then figured that I was just wasnt copying config.inc.php.dist config.inc.php in the config file. So like I said my issue now is resolving all the setup requirements to actually start using dvwa
@farazqureshi3275
@farazqureshi3275 8 лет назад
Great Tutorial Thanku !!!!!!
@NetSecNow
@NetSecNow 8 лет назад
Faraz, Thank you for the kind feedback! Be sure to check out my blog at learnnetsec.blogspot.com
@atlantisairsoft122
@atlantisairsoft122 8 лет назад
After trying to restart mysql I got the message "Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details" What do I do from here?
@czarinamaedelacruz-gabriel1697
I have the same error.... Is there any solution for this?
@NetSecNow
@NetSecNow 8 лет назад
+Czarina Dela Cruz Are you guys root when doing this?
@czarinamaedelacruz-gabriel1697
Yes I am
@NetSecNow
@NetSecNow 8 лет назад
+Czarina Dela Cruz so are you doing service mysql stop then start?
@fireballs17
@fireballs17 8 лет назад
ay big dude would you ever help with my android and getting at the very least the hash for my pass.
@fireballs17
@fireballs17 8 лет назад
+chris Szy btw dont know if this is allowed sorry.
@giacomoantonioli4985
@giacomoantonioli4985 7 лет назад
I've been doing right what you've said but when I restart it gives me 'job for mysql.service failed because the control process exited with the error code. ' Now it doesn't neither restart or start normally, what should I do?
@NetSecNow
@NetSecNow 7 лет назад
Were you root when you did it?
@giacomoantonioli4985
@giacomoantonioli4985 7 лет назад
Yes im always root
@NetSecNow
@NetSecNow 7 лет назад
+Giacomo Antonioli what happens when you service start mysql
@giacomoantonioli4985
@giacomoantonioli4985 7 лет назад
ql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> update user set password=PASSWORD("KondorMitnick") where user='root'; Query OK, 4 rows affected (0.01 sec) Rows matched: 4 Changed: 4 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye root@kali:~# service mysql restart Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. root@kali:~# service mysql status ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled) Active: activating (start-post) since Thu 2016-09-08 12:23:22 HST; 33s ago Process: 7919 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 7922 (mysqld_safe); : 7923 (mysql-systemd-s) CGroup: /system.slice/mysql.service ├─7922 /bin/sh /usr/bin/mysqld_safe ├─8268 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --... └─control ├─7923 /bin/bash /usr/share/mysql/mysql-systemd-start post └─8375 sleep 1 Sep 08 12:23:22 kali systemd[1]: Starting MySQL Community Server... Sep 08 12:23:23 kali mysqld_safe[7922]: 160908 12:23:23 mysqld_safe Can't lo.... Sep 08 12:23:23 kali mysqld_safe[7922]: 160908 12:23:23 mysqld_safe Logging .... Sep 08 12:23:23 kali mysqld_safe[7922]: 160908 12:23:23 mysqld_safe Starting...l Hint: Some lines were ellipsized, use -l to show in full. root@kali:~# service mysql restart ^C ^C root@kali:~# service mysql status ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled) Active: deactivating (stop-sigterm) Process: 7923 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=killed, signal=TERM) Process: 7919 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 7922 (mysqld_safe) CGroup: /system.slice/mysql.service ├─7922 /bin/sh /usr/bin/mysqld_safe └─8268 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --... Sep 08 12:23:22 kali systemd[1]: Starting MySQL Community Server... Sep 08 12:23:23 kali mysqld_safe[7922]: 160908 12:23:23 mysqld_safe Can't lo.... Sep 08 12:23:23 kali mysqld_safe[7922]: 160908 12:23:23 mysqld_safe Logging .... Sep 08 12:23:23 kali mysqld_safe[7922]: 160908 12:23:23 mysqld_safe Starting...l Hint: Some lines were ellipsized, use -l to show in full. root@kali:~# service mysql start
@NetSecNow
@NetSecNow 7 лет назад
+Giacomo Antonioli I'll try an emulate this when I get home later.
@anderslowgren4034
@anderslowgren4034 8 лет назад
I tried the update user set password=PASSWORD(“yournewpasswordhere”) where user='root'; command but it tells me ERROR 1054 (42S22): Unknown column ("yournewpasswordhere") where user='root'; How do i fix this?
@NetSecNow
@NetSecNow 8 лет назад
don't use quotes inside the parentheses
@supercombinecp860
@supercombinecp860 8 лет назад
Hey AfterBurn, were/are you associated with the military in anyway? I noticed the way you pronounce the word "One" like "Wun"
@NetSecNow
@NetSecNow 8 лет назад
:-D tee hee
@ravikrishna6344
@ravikrishna6344 8 лет назад
+NetSecNow how to identify cross site scripting from the" http response " if u have any screenshots explain please
@jackhackerB52
@jackhackerB52 7 лет назад
thx pro you tha man
@bobgg1318
@bobgg1318 8 лет назад
hey i really need some help. i saw your "instal and configure TOr with PRoxychains" video and i was curious how to activate your tor after you turn your pc off and back on. i booted my laptop and i typed in " service tor status" said it was (dead). Also i was following your video and everything went smoothly but then i tried it on my own and i typed "proxychains iceweasel www.ipchicken.com" it said that it kept timing out over and over and then it said that www.ipchicken.com does not exist. let me know if you need any more info. im sorry i didnt type in exactly what it said in the terminal but i cant copy and paste it in the comment box..
@NetSecNow
@NetSecNow 8 лет назад
Hi. how can I help?
@NetSecNow
@NetSecNow 8 лет назад
+Bob Gg I wrote a script called tor-buddy to help with this. check it out on my website.
@bobgg1318
@bobgg1318 8 лет назад
+NetSecNow i just got everything set up man thanks i appreciate it. i have one last question. I know you said that to stop tor-buddy you click ctrl+c but what do you click to start it back up again? same buttons?
@NetSecNow
@NetSecNow 8 лет назад
+Bob Gg ./tor-buddy.sh to start it :-)
@NetSecNow
@NetSecNow 8 лет назад
+Bob Gg CD to where ever you extracted it to. then run it.
@litle_candice
@litle_candice 7 лет назад
its showing that error 2002 can't connect
@NetSecNow
@NetSecNow 7 лет назад
Make sure that your mysql service is running service mysql start
@bobgg1318
@bobgg1318 8 лет назад
Alright I fixed it.. But now when I run the "proxychains iceweasel www.ipchicken.com" I says "|s-chain| --127.0.0.1 :9050--4.2.2.2 :53-
@NetSecNow
@NetSecNow 8 лет назад
+Bob Gg Try using the tor buddy script, but set the rfresh rate higher. Sometimes you just pick up a bum proxy that's all
@ozzye76
@ozzye76 8 лет назад
hi mate thank u again for the great video ,, pls do u can make video about how to hack wifi WPA 2
@eliasqudah
@eliasqudah 6 лет назад
no
@scottsmith1056
@scottsmith1056 8 лет назад
Are you planning on uploading some new videos?
@NetSecNow
@NetSecNow 8 лет назад
Hi. Yes certainly. Work has been crazy lately. I should have some more out in a couple weeks
@scottsmith1056
@scottsmith1056 8 лет назад
***** What kind of videos do you have planned? Are you going to make a video on the latest and greatest Kali update? Thank you.
@NetSecNow
@NetSecNow 8 лет назад
+Scott Smith Yes, the newest update. Some other tools I've been researching, etc.
@scottsmith1056
@scottsmith1056 8 лет назад
***** I look forward to seeing them. Thanks for the great videos! :)
@NetSecNow
@NetSecNow 7 лет назад
I don't know if you follow our blog, but We have officially started our online school with pre-registrations. Check it out at ww.learnnetsec.com
@thefr7942
@thefr7942 4 года назад
thanx
@Filho_do_Abismo
@Filho_do_Abismo 4 года назад
bro, when I type the command: update user set password = PASSWORD ("mynewpass") where user = 'root'; the following message appears: Query OK, 0 rows affected (0.000 sec) Row matched: 0 Changed: 0 Warnings: 0 And after that, when I try to log in with my new mysql root user password, this error keeps popping up: ERROR 1045 (2800): Access denied for user 'root' @ 'localhost' (using password: YES) For some reason apparently, when I try to enter a new password for the root user, it has no effect. You may notice this by seeing the following message after resetting the password: Query OK, 0 rows affected (0.000 sec) Row matched: 0 Changed: 0 Warnings: 0 No rows change effects after entering the password reset command.
@solidsn2011
@solidsn2011 8 лет назад
Are you gonna do the online school in the end?
@NetSecNow
@NetSecNow 8 лет назад
Yes, that is the plan at some point. Hopefully after I move
@NetSecNow
@NetSecNow 8 лет назад
Yes, that is the plan at some point. Hopefully after I move
@NetSecNow
@NetSecNow 8 лет назад
Yes, that is the plan at some point. Hopefully after I move
@NetSecNow
@NetSecNow 8 лет назад
Yes, that is the plan at some point. Hopefully after I move
@OMFGTrexKyle
@OMFGTrexKyle 8 лет назад
Are you still going to make videos??! 😨
@NetSecNow
@NetSecNow 8 лет назад
of course!
@supercombinecp860
@supercombinecp860 8 лет назад
+NetSecNow yay!
@NetSecNow
@NetSecNow 8 лет назад
+SuperCombine CP Hi :-)
@supercombinecp860
@supercombinecp860 8 лет назад
+NetSecNow o hai thare :) i hopes you make some moar videos soon. I installed a wordpress virtualbox and was able to mess around with that. I also learned how to use netcat!! Makkin fifos and stuff. :P
@NetSecNow
@NetSecNow 8 лет назад
+SuperCombine CP Nice!
@johndoh8119
@johndoh8119 7 лет назад
I didn't get any errors but after I change the password and log into the mysql database using `mysql -u root -p` I dont go right into a `mysql` prompt I just get this, root@kali:/# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5 Server version: 10.1.22-MariaDB- Debian 9.0 Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> Weird thing is that if I enter the incorrect password it even brings me to this page, something aint right lol. Any suggestions ?
@NetSecNow
@NetSecNow 7 лет назад
Crazy! Do you have the latest version of DVWA?
@johndoh8119
@johndoh8119 7 лет назад
Hey there, you had replied to one of my comments asking if I had the most recent version of DVWA. As of today, yeah I believe so, I went to dvwa homepage and clicked download. I did think it was suspicious then when I went into my teminal that it was in my downloads as "DVWA-master.zip" not like it was in your video which read as"DVWA V1.9" or what have you. I deleted the Kali VM that had the original issues so I'm starting fresh.
@johndoh8119
@johndoh8119 7 лет назад
I assume I do, I went directly to DVWA.co and downloaded the master zip. WHen I unzipped it it became a directory, "DVWA-master" is that good or bad? I think it is suspicious as it doesnt read as "DVWA v2.4" or whatever it probably should be.
@johndoh8119
@johndoh8119 7 лет назад
Here are my Kali specs btw Linux kali 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) x86_64 GNU/Linux
@johndoh8119
@johndoh8119 7 лет назад
So I'm still getting the same issue. root@kali:/# mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 10.1.22-MariaDB- Debian 9.0 Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed MariaDB [mysql]> update user set password=PASSWORD("mynewpassword") where user='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 ##So I find it odd that it only reads "Rows matched: 1 Changed: 1 Warnings: 0" unlike yours MariaDB [mysql]> flush privileges; Query OK, 0 rows affected (0.00 sec) MariaDB [mysql]> exit Bye root@kali:/# root@kali:/# service mysql restart root@kali:/# service mysql status ● mysql.service - LSB: Start and stop the mysql database server daemon Loaded: loaded (/etc/init.d/mysql; generated; vendor preset: disabled) Active: active (exited) since Tue 2017-05-16 13:32:15 EDT; 8s ago Docs: man:systemd-sysv-generator(8) Process: 2986 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS) May 16 13:32:15 kali systemd[1]: Starting LSB: Start and stop the mysql database server da May 16 13:32:15 kali mysql[2986]: Starting MariaDB database server: mysqld already running May 16 13:32:15 kali systemd[1]: Started LSB: Start and stop the mysql database server dae root@kali:/# root@kali:/# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 10.1.22-MariaDB- Debian 9.0 Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> You can see here that unlike in your video I am not put directly into the "mysql>" prompt, I know that I am using MariaDB so maybe thats why. What's even more perplexing is in my syntax above you can clearly see that I've changed the password to "mynewpassword", despite this when I enter in some random characters, like I entered "Ilovepizza" and it sent me into root@kali:/# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5 Server version: 10.1.22-MariaDB- Debian 9.0 Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> exit Bye Now I honestly was never prompted anytime in the setup of Kali to enter a username or password for mysql. Maybe I missed something in the setup? I know there is a domain prompt and another type of prompt related to the possible issue but it never asked me, "Set up a mysql username and password" while doing the boot up for Kali. I mentioned that I started on a new Kali VM so this was the first thing I after starting up Kali again. I DL DVWA then immediately went in to change the password using your video.
@StrikerShorts07
@StrikerShorts07 8 лет назад
u again ..not uploadin videos...!!! wtd.
@NetSecNow
@NetSecNow 8 лет назад
?
@NetSecNow
@NetSecNow 8 лет назад
+Hussne Mubarak Thats actually not true. it's been roughly 2 months, and I've been working on some projects
@StrikerShorts07
@StrikerShorts07 8 лет назад
K..
@bustermondrupkramer7159
@bustermondrupkramer7159 8 лет назад
Netsecnow i need your help check your email i have writed somthing to u
@NetSecNow
@NetSecNow 8 лет назад
I saw it. But like I say in most of my videos, I'm not able to help people break into their lost accounts. It's against the law.
@bustermondrupkramer7159
@bustermondrupkramer7159 8 лет назад
+NetSecNow Ok i see but then do you know anyone that can help ?? please let me know if u know anyone ;)
Далее
Password Hacking in Kali Linux
24:22
Просмотров 771 тыс.
Understanding Active Directory and Group Policy
51:56
Beginner's Guide to sqlmap - Full Course
36:16
Просмотров 139 тыс.
Penetration Testing Using Armitage.
21:56
Просмотров 31 тыс.
Здесь упор в процессор
18:02
Просмотров 392 тыс.