mailramk Posted December 29, 2006 Share Posted December 29, 2006 Hi I was experimenting with unattended multiboot dvd with following operating systems.All these are completely unattended.Windows 2000 (Prof,Server,AdvServ) with SP4 integratedWindows XP with SP2 integratedWindows 2003 (STD,ENT) with SP2 integratedHirens Boot CD 8.6I 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 userreadpasswd:set passwd = ""clsprint "\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 passwordbuildpasswd:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswdset passwd = "$(passwd)$lastChar"goto buildpasswd#checks whether the password is correct or notcheckpasswd: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 titleEntete:set textColor= color[yellow on blue]set boldColor= color[yellow on blue]clsprint 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 menumenu:#if $ModeGraphique; then show image menu.csi menu.bmp; then goto MainKeyset textColor=color[blue on black]set TitreMenu = "Main Menu - Multiboot DVD"call Enteteset 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 chosenMainKey:getkeyif $lastKey == key[1]; then chain /2PRO.DATif $lastKey == key[2]; then chain /2SRV.DATif $lastKey == key[3]; then chain /2ADV.DATif $lastKey == key[4]; then chain /PRO1.DATif $lastKey == key[5]; then chain /3ENT.DATif $lastKey == key[6]; then chain /3STD.DATif $lastKey == key[7]; then memdisk /HIREN.IMAif $lastKey == key[r]; then rebootif $lastKey == key[R]; then rebootgoto menuFin:end Link to comment Share on other sites More sharing options...
martin26uk Posted February 25, 2007 Share Posted February 25, 2007 (edited) 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 errorsUse this if you want to change it to 3 attemptsif $vga; then if $vesa; then set ModeGraphique = 1; else set ModeGraphique = 0# Reads the password from the userreadpasswd:set passwd = ""clsprint "\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 passwordbuildpasswd:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswdset passwd = "$(passwd)$lastChar"goto buildpasswd#checks whether the password is correct or notcheckpasswd:set MD5 = "$passwd"set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"if icompare["$password_hash" "$MD5"]then goto menuelsegoto readpasswd2# Reads the password from the userreadpasswd2:set passwd = ""clsprint "\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 passwordbuildpasswd2:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswd2set passwd = "$(passwd)$lastChar"goto buildpasswd2#checks whether the password is correct or notcheckpasswd2:set MD5 = "$passwd"set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"if icompare["$password_hash" "$MD5"]then goto menuelsegoto readpasswd3# Reads the password from the userreadpasswd3:set passwd = ""clsprint "\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 passwordbuildpasswd3:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswd3set passwd = "$(passwd)$lastChar"goto buildpasswd3#checks whether the password is correct or notcheckpasswd3:set MD5 = "$passwd"set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"if icompare["$password_hash" "$MD5"]then goto menuelseset textColor= color[red on black]set boldColor= color[brightred on black]clsprint "\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]getkeyreboot; Edited February 25, 2007 by martin26uk Link to comment Share on other sites More sharing options...
phkninja Posted February 25, 2007 Share Posted February 25, 2007 you do know that MD5 is not crytographically secure anymore. Granted most people would not know how to break it, but a few here would Link to comment Share on other sites More sharing options...
martin26uk Posted February 25, 2007 Share Posted February 25, 2007 Any idea on how to set the password ??? Link to comment Share on other sites More sharing options...
phkninja Posted February 25, 2007 Share Posted February 25, 2007 its in the code if you look#checks whether the password is correct or notcheckpasswd:set MD5 = "$passwd"set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"if icompare["$password_hash" "$MD5"]then goto menuso generate an md5 hash of the password you want and change the line toset password_hash = "[YOUR PASSWORD HASH]" Link to comment Share on other sites More sharing options...
martin26uk Posted February 25, 2007 Share Posted February 25, 2007 MD5 - i've never heard of it before 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 notcheckpasswd:set MD5 = "$passwd"set password_hash = "925d7518fc597af0e43f5606f9a51512"I got 925d7518fc597af0e43f5606f9a51512 from an MD5 generator Link to comment Share on other sites More sharing options...
phkninja Posted February 25, 2007 Share Posted February 25, 2007 (edited) 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 = 0set password_hash = "f9d6a878e4c43a9cf80a43b9ec389827"# Reads the password from the userreadpasswd:set passwd = ""clsprint "\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 passwordbuildpasswd:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswdset passwd = "$(passwd)$lastChar"goto buildpasswd#checks whether the password is correct or notcheckpasswd:if icompare["$password_hash" "$passwd"]then goto menuelsegoto readpasswd2# Reads the password from the userreadpasswd2:set passwd2 = ""clsprint "\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 passwordbuildpasswd2:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswd2set passwd2 = "$(passwd2)$lastChar"goto buildpasswd2#checks whether the password is correct or notcheckpasswd2:if icompare["$password_hash" "$passwd2"]then goto menuelsegoto readpasswd3# Reads the password from the userreadpasswd3:set passwd3 = ""clsprint "\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 passwordbuildpasswd3:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswd3set passwd3 = "$(passwd3)$lastChar"goto buildpasswd3#checks whether the password is correct or notcheckpasswd3:if icompare["$password_hash" "$passwd3"]then goto menuelseset textColor= color[red on black]set boldColor= color[brightred on black]clsprint "\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]getkeyreboot;this removes the ability for variable clashes, and only has 1 password_hash assigned at the start for all checks Edited February 25, 2007 by phkninja Link to comment Share on other sites More sharing options...
martin26uk Posted March 1, 2007 Share Posted March 1, 2007 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 outBTW - 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 = 0set password_hash = "925d7518fc597af0e43f5606f9a51512"# Reads the password from the userreadpasswd:set passwd = ""clsprint "\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 passwordbuildpasswd:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswdset passwd = "$(passwd)$lastChar"goto buildpasswd#checks whether the password is correct or notcheckpasswd:if icompare["$password_hash" "$passwd"]then goto menuelsegoto readpasswd2# Reads the password from the userreadpasswd2:set passwd2 = ""clsprint "\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 passwordbuildpasswd2:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswd2set passwd2 = "$(passwd2)$lastChar"goto buildpasswd2#checks whether the password is correct or notcheckpasswd2:if icompare["$password_hash" "$passwd2"]then goto menuelsegoto readpasswd3# Reads the password from the userreadpasswd3:set passwd3 = ""clsprint "\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 passwordbuildpasswd3:getkeyset textColor= color[brightred on black]print "*"if $lastKey == key[enter]; then goto checkpasswd3set passwd3 = "$(passwd3)$lastChar"goto buildpasswd3#checks whether the password is correct or notcheckpasswd3:if icompare["$password_hash" "$passwd3"]then goto menuelseset textColor= color[red on black]set boldColor= color[brightred on black]clsprint "\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]getkeyreboot; Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now