Jump to content

Password Protect Multiboot DVD


mailramk

Recommended Posts

Hi I was experimenting with unattended multiboot dvd with following operating systems.

All these are completely unattended.

Windows 2000 (Prof,Server,AdvServ) with SP4 integrated

Windows XP with SP2 integrated

Windows 2003 (STD,ENT) with SP2 integrated

Hirens Boot CD 8.6

I had tried to password protect the boot menu which is scripted in CDShell.

I found a way in the following code which asks for a password before showing the boot options from dvd. If the password which is MD5 hashed is matched then only the menu is shown.

The code is as follows:(If any mistakes please reply me)

if $vga; then if $vesa; then set ModeGraphique = 1; else set ModeGraphique = 0

# Reads the password from the user

readpasswd:

set passwd = ""

cls

print "\n\n\n\n\n\n\n\n\n\n\n\n"

set textColor= color[brightgreen on black]

print c "Enter the Password:"

goto buildpasswd

#builds the password

buildpasswd:

getkey

set textColor= color[brightred on black]

print "*"

if $lastKey == key[enter]; then goto checkpasswd

set passwd = "$(passwd)$lastChar"

goto buildpasswd

#checks whether the password is correct or not

checkpasswd:

set MD5 = "$passwd"

set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"

if icompare["$password_hash" "$MD5"]

then goto menu

else

set textColor= color[red on black]

set boldColor= color[brightred on black]

cls

print "\n\n\n\n\n\n\n\n\n\n"

print c "\n\nInvalid password! "

print c "\n\n Press any key to restart............"

set textColor= color[white on black]

getkey

reboot;

# Function for setting the title

Entete:

set textColor= color[yellow on blue]

set boldColor= color[yellow on blue]

cls

print c "\n\n\n\n $TitreMenu \n\n"

set textColor= color[brown on blue]

print c "Created by Rama Krishna Reddy Chintalapani\n"

print c "\cxx aiodvd@gmail.com"

print r "\c0B\n"

print c "\cXXÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n\n"

return

# Function for displaying the menu

menu:

#if $ModeGraphique; then show image menu.csi menu.bmp; then goto MainKey

set textColor=color[blue on black]

set TitreMenu = "Main Menu - Multiboot DVD"

call Entete

set textColor=color[brightmagenta on blue]

print c "Install Windows\n\n"

set textColor=color[white on blue]

set boldColor= color[white on blue]

print c "\cXX 1) 2000 Professional with SP4 \n"

print c "\cXX 2) 2000 Server with SP4 \n"

print c "\cXX 3) 2000 Advanced Server with SP4 \n"

print c "\cXX 4) XP Professionel with SP2 \n"

print c "\cXX 5) 2003 Server Enterprise Edition SP1\n"

print c "\cXX 6) 2003 Server Standard Edition SP1 \n"

print c "\cXX 7) Hiren's Boot CD for Emergency \n"

print "\n"

set textColor=color[red on blue]

set boldColor= color[brightred on blue]

print c "\cXX R) Reboot \n"

set textColor=color[green on blue]

set boldColor= color[brightgreen on blue]

print c "\n\n\nEnter your choice... \n"

#Function which calls the boot sector on the option chosen

MainKey:

getkey

if $lastKey == key[1]; then chain /2PRO.DAT

if $lastKey == key[2]; then chain /2SRV.DAT

if $lastKey == key[3]; then chain /2ADV.DAT

if $lastKey == key[4]; then chain /PRO1.DAT

if $lastKey == key[5]; then chain /3ENT.DAT

if $lastKey == key[6]; then chain /3STD.DAT

if $lastKey == key[7]; then memdisk /HIREN.IMA

if $lastKey == key[r]; then reboot

if $lastKey == key[R]; then reboot

goto menu

Fin:

end

Link to comment
Share on other sites

  • 1 month later...

Looks good, just one thing - where do you create the password ?

Also this could be adapted to give the user 3 attempts to enter their password before it restarts incase of typo errors

Use this if you want to change it to 3 attempts

if $vga; then if $vesa; then set ModeGraphique = 1; else set ModeGraphique = 0

# Reads the password from the user
readpasswd:
set passwd = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd

#builds the password
buildpasswd:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd
set passwd = "$(passwd)$lastChar"
goto buildpasswd

#checks whether the password is correct or not
checkpasswd:
set MD5 = "$passwd"
set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"

if icompare["$password_hash" "$MD5"]
then goto menu
else
goto readpasswd2

# Reads the password from the user
readpasswd2:
set passwd = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd2

#builds the password
buildpasswd2:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd2
set passwd = "$(passwd)$lastChar"
goto buildpasswd2

#checks whether the password is correct or not
checkpasswd2:
set MD5 = "$passwd"
set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"

if icompare["$password_hash" "$MD5"]
then goto menu
else
goto readpasswd3

# Reads the password from the user
readpasswd3:
set passwd = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd3

#builds the password
buildpasswd3:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd3
set passwd = "$(passwd)$lastChar"
goto buildpasswd3

#checks whether the password is correct or not
checkpasswd3:
set MD5 = "$passwd"
set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"

if icompare["$password_hash" "$MD5"]
then goto menu
else
set textColor= color[red on black]
set boldColor= color[brightred on black]
cls
print "\n\n\n\n\n\n\n\n\n\n"
print c "\n\nInvalid password! "
print c "\n\n Press any key to restart............"
set textColor= color[white on black]
getkey
reboot;

Edited by martin26uk
Link to comment
Share on other sites

its in the code if you look

#checks whether the password is correct or not

checkpasswd:

set MD5 = "$passwd"

set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"

if icompare["$password_hash" "$MD5"]

then goto menu

so generate an md5 hash of the password you want and change the line to

set password_hash = "[YOUR PASSWORD HASH]"

Link to comment
Share on other sites

MD5 - i've never heard of it before :blushing:

Ok it still doesnt work for me - i want to change the password to martin so heres what i've done

#checks whether the password is correct or not
checkpasswd:
set MD5 = "$passwd"
set password_hash = "925d7518fc597af0e43f5606f9a51512"

I got 925d7518fc597af0e43f5606f9a51512 from an MD5 generator

Link to comment
Share on other sites

should work fine. make sure you type "martin" as the md5 hash will change if there are capitals.

also try this instead (your variable names may be confilcting)

if $vga; then if $vesa; then set ModeGraphique = 1; else set ModeGraphique = 0
set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"

# Reads the password from the user
readpasswd:
set passwd = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd

#builds the password
buildpasswd:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd
set passwd = "$(passwd)$lastChar"
goto buildpasswd

#checks whether the password is correct or not
checkpasswd:

if icompare["$password_hash" "$passwd"]
then goto menu
else
goto readpasswd2

# Reads the password from the user
readpasswd2:
set passwd2 = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd2

#builds the password
buildpasswd2:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd2
set passwd2 = "$(passwd2)$lastChar"
goto buildpasswd2

#checks whether the password is correct or not
checkpasswd2:

if icompare["$password_hash" "$passwd2"]
then goto menu
else
goto readpasswd3

# Reads the password from the user
readpasswd3:
set passwd3 = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd3

#builds the password
buildpasswd3:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd3
set passwd3 = "$(passwd3)$lastChar"
goto buildpasswd3

#checks whether the password is correct or not
checkpasswd3:
if icompare["$password_hash" "$passwd3"]
then goto menu
else
set textColor= color[red on black]
set boldColor= color[brightred on black]
cls
print "\n\n\n\n\n\n\n\n\n\n"
print c "\n\nInvalid password! "
print c "\n\n Press any key to restart............"
set textColor= color[white on black]
getkey
reboot;

this removes the ability for variable clashes, and only has 1 password_hash assigned at the start for all checks

Edited by phkninja
Link to comment
Share on other sites

Cheers for the help - still no success. I cant help but wonder if this actually works? Think im going to admit defeat on this, i dont really need it - it was just a cool thing to try out

BTW - heres what i ended up if using, with martin as the password using a MD5 generator = 925d7518fc597af0e43f5606f9a51512 - if anyone gets it to work let me know ;)

if $vga; then if $vesa; then set ModeGraphique = 1; else set ModeGraphique = 0
set password_hash = "925d7518fc597af0e43f5606f9a51512"

# Reads the password from the user
readpasswd:
set passwd = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd

#builds the password
buildpasswd:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd
set passwd = "$(passwd)$lastChar"
goto buildpasswd

#checks whether the password is correct or not
checkpasswd:

if icompare["$password_hash" "$passwd"]
then goto menu
else
goto readpasswd2

# Reads the password from the user
readpasswd2:
set passwd2 = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd2

#builds the password
buildpasswd2:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd2
set passwd2 = "$(passwd2)$lastChar"
goto buildpasswd2

#checks whether the password is correct or not
checkpasswd2:

if icompare["$password_hash" "$passwd2"]
then goto menu
else
goto readpasswd3

# Reads the password from the user
readpasswd3:
set passwd3 = ""
cls
print "\n\n\n\n\n\n\n\n\n\n\n\n"
set textColor= color[brightgreen on black]
print c "Enter the Password:"
goto buildpasswd3

#builds the password
buildpasswd3:
getkey
set textColor= color[brightred on black]
print "*"
if $lastKey == key[enter]; then goto checkpasswd3
set passwd3 = "$(passwd3)$lastChar"
goto buildpasswd3

#checks whether the password is correct or not
checkpasswd3:
if icompare["$password_hash" "$passwd3"]
then goto menu
else
set textColor= color[red on black]
set boldColor= color[brightred on black]
cls
print "\n\n\n\n\n\n\n\n\n\n"
print c "\n\nInvalid password! "
print c "\n\n Press any key to restart............"
set textColor= color[white on black]
getkey
reboot;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...