LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-18-2004, 07:42 AM   #1
dushkinup
Member
 
Registered: Feb 2004
Location: Alpha Quadrant, sol system, earth, asia, Israel.
Distribution: Computer I : Slackware 9.1 ; Computer II : Windows XP
Posts: 144

Rep: Reputation: 15
Cracking root password?


My brother is stupid and he lost his root password.
How do I run a bruteforce to crack it? (Fedora Core 1)
 
Old 03-18-2004, 08:25 AM   #2
Marc A
Member
 
Registered: Mar 2004
Location: Bxl Europe
Distribution: Debian/Ubuntu
Posts: 84

Rep: Reputation: 15
I don't really know and it's hard to answer 'cos it may help any people to access any PC.

I suggst reinstall the partition in question.

Besides, someone says you start the pc with knoppix, mount the partition read/write. Go into shadow and find the encrypted pass and suppress the file. Normaly at boot there shouldn't be a pass for root. If you can do that you could have thought it yourself : )
If this work, you can put a pass for root you keep and an admin profile for your brother to take care of his daily tasks.

Marc A
 
Old 03-18-2004, 08:49 AM   #3
dushkinup
Member
 
Registered: Feb 2004
Location: Alpha Quadrant, sol system, earth, asia, Israel.
Distribution: Computer I : Slackware 9.1 ; Computer II : Windows XP
Posts: 144

Original Poster
Rep: Reputation: 15
It's his computer so I don't even care if he throws it off the roof. I'll tell him that he needs to reinstall Linux.
 
Old 03-18-2004, 11:24 AM   #4
davholla
Member
 
Registered: Jun 2003
Location: London
Distribution: Linux Mint 13 Maya
Posts: 729

Rep: Reputation: 32
He can boot up using knoppix and get access that way. I can not remember exactly how but it is not that difficult.
 
Old 03-18-2004, 02:21 PM   #5
scuba
LQ Newbie
 
Registered: Mar 2004
Posts: 3

Rep: Reputation: 0
another way

There is another way to do it, which is quite simple actually.
I don't remember the exact details but I've got it written down at the office.
If it's necessary, reply, and I'll post it.
 
Old 03-18-2004, 02:31 PM   #6
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
Boot into single user mode and change it.
If he is using GRUB I think he needs to hit 'a' then put a -S or 'single' at the end of the line.

(it won't tell him what his old one is but it will allow him to change to one he knows.)

Last edited by Blinker_Fluid; 03-18-2004 at 02:32 PM.
 
Old 03-18-2004, 11:36 PM   #7
tyler_durden
Member
 
Registered: May 2001
Posts: 125

Rep: Reputation: 15
If you forgot you root you can also just boot with the fedora 1 cd.

Type "linux rescue" at the boot prompt.

once you get a shell type

chroot /mnt/sysimage

then type

passwd

reboot without the cd and you are good to go.
 
Old 03-19-2004, 06:01 AM   #8
naren
Member
 
Registered: Feb 2004
Posts: 66

Rep: Reputation: 15
mr Blinker_Fluid ,


i also got the same problem before but reinstalled linux on my pc...
please try to explain me to change the password using grub clearly..


bye
 
Old 03-20-2004, 02:26 AM   #9
vincery
LQ Newbie
 
Registered: Mar 2004
Location: Philippines
Distribution: Debian
Posts: 4

Rep: Reputation: 0
Lost password

First, try single user. If you don't see either a LILO or GRUB boot screen, try hitting CTRL-X to get one. If it's LILO, just type "linux single" and that should do it (assuming that "linux" is the lilo label). If GRUB, hit 'e", then select the "kernel" line, hit "e" again, and add " single" (or just " 1") to the end of the line. Press ENTER, and then "b" to boot.


You should get a fairly normal looking boot sequence except that it terminates a little early at a bash prompt. If you get a "Give root password for system maintenance", this isn't going to work, so see the "init" version below.


If you do get the prompt, the / filesystem may not be mounted rw (although "mount" may say it is). Do

mount -o remount,rw /



If that doesn't work (it might not), just type "mount" to find out where "/" is mounted. Let's say it is on /dev/sda2. You'd then type:

mount -o remount,rw /dev/sda2



If you can do this, just type "passwd" once you are in and change it to whatever you like. Or just edit /etc/shadow to remove the password field: move to just beyond the first ":" and remove everything up to the next ":". With vi, that would be "/:" to move to the first ":", space bar once, then "d/:" and ENTER. You'll get a warning about changing a read-only file; that's normal. Before you do this, /etc/shadow might look like:

root:$1$8NFmV6tr$rT.INHxDBWn1VvU5gjGzi/:12209:0:99999:7:-1:-1:1074970543
bin:*:12187:0:99999:7:::
daemon:*:12187:0:99999:7:::
adm:*:12187:0:99999:7:::



and after, the first few lines should be:

root::12209:0:99999:7:-1:-1:1074970543
bin:*:12187:0:99999:7:::
daemon:*:12187:0:99999:7:::
adm:*:12187:0:99999:7:::



You'll need to force the write: with vi, ":wq!". (If that still doesn't work, you needed to do the -o remount,rw, see above).


Another trick is to add "init=/bin/bash" (LILO "linux init=/bin/bash" or add it to the Grub "kernel" line). This will dump you to a bash prompt much earlier than single user mode, and a lot less has been initialized, mounted, etc. You'll definitely need the "-o remount,rw" here. Also note that other filesystems aren't mounted at all, so you may need to mount them manually if you need them. Look in /etc/fstab for the device names.



=====================
Mark Vincent Verallo
 
Old 03-20-2004, 10:35 PM   #10
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
Quote:
Originally posted by naren
mr Blinker_Fluid ,


i also got the same problem before but reinstalled linux on my pc...
please try to explain me to change the password using grub clearly..


bye
step by step instructions:
Power on machine when you get to the grub screen where it is counting down and asking you to select the kernel you hit the 'a' key
this will drop you to a screen where you can modify kernel arguments add 'single' to the end of the line and press 'enter'
You will then boot into single user mode where you can type 'passwd root' and then enter a password you know.

Hope that helps
 
Old 03-21-2004, 12:33 PM   #11
flashingcurser
Member
 
Registered: Jan 2003
Distribution: many win/nix/mac
Posts: 259

Rep: Reputation: 32
Use this


 
Old 03-21-2004, 11:20 PM   #12
witeshark
Member
 
Registered: Jan 2004
Location: Miami FL
Distribution: Mac OS X 10.4.11 Ubuntu 12.04 LTS
Posts: 429

Rep: Reputation: 30
Lightbulb

Quote:
Originally posted by flashingcurser
Use this


Well it's there for the viewing and doesn't exceed the kind of kind of cracking simple guess work can do more slowly. But I don't like it. At some point, any way that a password becomes replaceable/crackable etc without a reinstall renders it useless, and just a temporary delay in unauthorized access... It's why the encryption and master password in Mac is so tight, lose it and your data is gone - 99% of password security is a personal memory function. No written paper, no phone numbers, no birthday backward or crap like that.
 
Old 03-22-2004, 05:30 PM   #13
KneeLess
Member
 
Registered: May 2003
Distribution: Debian GNU/Linux 3.0 Sid, OpenBSD 3.5
Posts: 190

Rep: Reputation: 30
A bruteforce of any 8 character or more password with john could take weeks. With a CRAY-2.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SMB shares, password cracking scott4957 Linux - Security 1 10-23-2005 08:38 AM
windows share password cracking scott4957 General 9 10-23-2005 07:24 AM
ZIP/RAR password cracking software?? mlu Linux - Software 2 10-12-2005 02:50 AM
theoritical password cracking abunsair Linux - Security 21 07-18-2005 09:57 AM
ssh password cracking dan0r Linux - Security 2 01-10-2005 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration