Jump to content




Unhackable Password Door (Simple)


45 replies to this topic

#1 Hancomat55

  • New Members
  • 6 posts

Posted 11 October 2012 - 02:43 AM

Well I hope you enjoy just put in your password where it says "Password", keep the parenthesis though.


while true do
os.pullEvent =os.pullEventRaw
term.clear()
term.setCursorPos(1, 1)
write("Please Enter Password: ")
input = read("*")
if input == "Password" then
redstone.setOutput("right", true)
sleep(3)
redstone.setOutput("right", false)
sleep(1)
os.reboot()
else
print("Incorrect! Try again later.")
sleep(1)
print("Shutting Down")
sleep(1)
os.reboot()
end
end

That is all :P/>

#2 wjykk

  • Members
  • 10 posts

Posted 11 October 2012 - 04:24 AM

I'd assume it's unhackable as long as you can't terminate the program and look through its source code. Otherwise, it's no better than the simplest solutions.

#3 Luanub

    Lua Nub

  • Members
  • 1,135 posts
  • LocationPortland OR

Posted 11 October 2012 - 04:33 AM

He has ctrl+t prevention so you can not terminate it.

You could however drop a disk drive next to the computer with a blank startup file on a disk and take a look at the code.

#4 MrZuribachi

  • New Members
  • 44 posts
  • LocationGermany

Posted 11 October 2012 - 12:14 PM

By attaching a disk drive at the computer and using a floppy disk with any startup (for example a startup showing "CraftOS 1.4" like the vanilla one), you just have to enter any crap into the computer and the computer will automatically reboot cause of the os.reboot-line. Instead I'd use shell.run("startup"), so the computer doesn't restart. Instead the startup will run up again and there will be no boot from any floppies attached. (Just my suggestion)

Edit: Read luanub's post as well, but with restating his arguement I aimed to give a better focus on the actual problem and a possible solution.

#5 1lann

  • Members
  • 516 posts
  • LocationSeattle

Posted 11 October 2012 - 01:48 PM

View PostMrZuribachi, on 11 October 2012 - 12:14 PM, said:

By attaching a disk drive at the computer and using a floppy disk with any startup (for example a startup showing "CraftOS 1.4" like the vanilla one), you just have to enter any crap into the computer and the computer will automatically reboot cause of the os.reboot-line. Instead I'd use shell.run("startup"), so the computer doesn't restart. Instead the startup will run up again and there will be no boot from any floppies attached. (Just my suggestion)

Edit: Read luanub's post as well, but with restating his arguement I aimed to give a better focus on the actual problem and a possible solution.
Can't you just use ctrl+s or ctrl+r then?

#6 MrZuribachi

  • New Members
  • 44 posts
  • LocationGermany

Posted 11 October 2012 - 02:10 PM

Look at the following line:
os.pullEvent = os.pullEventRaw
This prevents users from using any keys, like CTRL+S, CTRL+T, CTRL+R and whatever.

#7 GopherAtl

  • Members
  • 888 posts

Posted 11 October 2012 - 02:12 PM

No, it doesn't. It only prevents ctrl-t.

I keep hearing people say it blocks them all; does nobody actually test these things before repeating them?

#8 MrZuribachi

  • New Members
  • 44 posts
  • LocationGermany

Posted 11 October 2012 - 02:42 PM

Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.

#9 KevinW1998

  • Members
  • 93 posts
  • LocationAustria(German)

Posted 11 October 2012 - 03:34 PM

Normaly only ctrl+t is blocked!

#10 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 11 October 2012 - 03:35 PM

View PostMrZuribachi, on 11 October 2012 - 02:42 PM, said:

Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
That is a lie. A flat-faced lie. CTRL+S and CTRL+R are hardcoded into the java code. There is no way to prevent those from affecting your code.

#11 robhol

  • Members
  • 182 posts

Posted 11 October 2012 - 03:41 PM

If you -could- prevent CTRL-S and CTRL-R, there'd be no way to recover from a critical bug in your code, like an infinite loop.

Also, no offense, but this isn't useful, there are hundreds of scripts just like this except better. People need to stop posting completely basic "security systems".

#12 Doyle3694

  • Members
  • 815 posts

Posted 11 October 2012 - 03:47 PM

This is like "I just learned os.pullEventRaw(), nobody else know about it so I'ma put my code on teh forums with the pros so they can see how skilled I am", no offence, but really? If everyone discovering os.pullEvent() = os.pullEventRaw() Would post their program then the forum server would run out of disk space. seriously.

#13 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 11 October 2012 - 03:56 PM

We're not here to bash you exactly, but you did make one critical mistake: You flat out stated something that is known widely to almost all veteran coders here on the forums. You said that your program was unhackable. It is not. There is no such thing as an unhackable program through computercraft, because it has been designed to be such a way. If you could not terminatte or restart a program, this could cause massive problems with hackers, and so it has been made so that cannot happen.

#14 GopherAtl

  • Members
  • 888 posts

Posted 11 October 2012 - 04:50 PM

Just a sortof side note, that might help all the people who wish they could completely block ctrl-r, ctrl-s, and booting from floppies.

People think of hacking as just being the malicious people/programs that get into your computer and mess it up. But hacking is also what you have to do to get in and repair that broken computer.

So bottom line is no matter what you do, short of server mods that protect blocks, people will be able to hack your computers no matter what - but that means you will always be able to get back in the computer to fix it, too. The latter is crucial, and the two can't be separated, so you'll just have to live with the former.

#15 Exerro

  • Members
  • 801 posts

Posted 11 October 2012 - 04:59 PM

it is almost possible to prevent disk booting and if the door code is startup then rebooting doesn't matter...if you have a thing in your program where it deletes the disk startup if there is one then the only way to get through the doorlock is using ctrl-s then putting an unaffected disk in
maybe put this in your code so its not just like the daily crappy doorlock that people think will revolutionize computercraft (no offense meant)

#16 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 11 October 2012 - 05:50 PM

But you can't stop someone from using ctrl s, putting the disk in, then restarting the computer.

#17 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 13 October 2012 - 01:10 AM

View PostCranium, on 11 October 2012 - 03:35 PM, said:

View PostMrZuribachi, on 11 October 2012 - 02:42 PM, said:

Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
That is a lie. A flat-faced lie. CTRL+S and CTRL+R are hardcoded into the java code. There is no way to prevent those from affecting your code.

Is there a way to cause the computer to reboot on pressing CTRL, thus not allowing the 1 sec required for CTRL+ hotkeys..

#18 Hancomat55

  • New Members
  • 6 posts

Posted 13 October 2012 - 01:43 AM

View PostLeft4Cake, on 13 October 2012 - 01:10 AM, said:

View PostCranium, on 11 October 2012 - 03:35 PM, said:

View PostMrZuribachi, on 11 October 2012 - 02:42 PM, said:

Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
That is a lie. A flat-faced lie. CTRL+S and CTRL+R are hardcoded into the java code. There is no way to prevent those from affecting your code.

Is there a way to cause the computer to reboot on pressing CTRL, thus not allowing the 1 sec required for CTRL+ hotkeys..
I dont know, probably not because it is all scripted together. But you could try looking in the CC folder

#19 tommyroyall

  • Members
  • 136 posts

Posted 13 October 2012 - 03:57 AM

Easy Solution: Disk boot from the right side. Boot it up with a startup that says:
os.run("shell")
-- This will bypass anything set as a startup and head the user straight to the shell. There they can do whatever they want, hopefully in my case break this wretched lock :.


#20 Hancomat55

  • New Members
  • 6 posts

Posted 13 October 2012 - 04:43 AM

View Posttommyroyall, on 13 October 2012 - 03:57 AM, said:

Easy Solution: Disk boot from the right side. Boot it up with a startup that says:
os.run("shell")
-- This will bypass anything set as a startup and head the user straight to the shell. There they can do whatever they want, hopefully in my case break this wretched lock :.
That is a good one and i doubt it is possible to hack into





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users