Jump to content




Password Lock Door


25 replies to this topic

#1 JackPriceBurns

  • Members
  • 5 posts

Posted 13 July 2013 - 04:20 PM

I have thought of what i think is quite a good and strong password lock door code and i was wondering is there anyway to bypass it i have disabled booting from disks so that cant be done the only way which i think is possible is to destroy and place the computer but we have factions protecting my land so is there a bypass for this code?

Current Code
os.pullEvent = os.pullEventRaw
x = 1
while true do
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local input = read("*")
if input == "password" then
  term.clear()
  term.setCursorPos(1,1)
  print("Password Correct")
  rs.setOutput("right",true)
  sleep(5)
  rs.setOutput("right",false)
else if input == "debug" then
  term.clear()
  term.setCursorPos(1,1)
  print("Entering Console Development Mode")
  error()
else if x == 4 then
  print("Password Entered Incorrect 3 Times")
  print("Locked For 1 Minute")
  sleep(60)
  x = 1
else
  print("Password Incorrect")
  x = x + 1
  sleep(2)
end
end
end
end


also if you are wondering why x starts as 1 not 0 its because apparently 0 is nil

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 15 July 2013 - 11:44 AM

Split into new topic.

0 isn't nil. Disabling disk booting is a very bad idea.

#3 apemanzilla

  • Members
  • 1,421 posts

Posted 15 July 2013 - 11:47 AM

I've seen ways to bypass these before; when I get home I'll test it.

#4 JackPriceBurns

  • Members
  • 5 posts

Posted 16 July 2013 - 11:33 AM

Whats bad about disabling Disk Booting?

#5 apemanzilla

  • Members
  • 1,421 posts

Posted 16 July 2013 - 11:48 AM

If you make an error, or can't get the password right, you're in trouble.

#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 16 July 2013 - 12:17 PM

Without disk booting, it is possible to permanently and irrevocably brick computers. Disabling disk booting must be done server-wide, so any player that creates a program to permanently disable computers (which is very simple if disk booting is disabled) could make any computer on the server useless.

#7 n1ghtk1ng

  • Members
  • 58 posts

Posted 16 July 2013 - 06:59 PM

Don't disable disk booting, there's a much simpler way. Will respond when back home.

#8 JackPriceBurns

  • Members
  • 5 posts

Posted 17 July 2013 - 03:13 AM

But if i dont disable disk booting then people could just bypass the password lock door so what should i do to make it so that computer doesn't get bypassed that way also if you forget the password 3 times then you get kicked off for 1 minute and i think thats a good idea but i could add something like everytime you enter it wrong 3 times then also the time gets * by 2 or something

#9 JackPriceBurns

  • Members
  • 5 posts

Posted 17 July 2013 - 03:19 AM

I just change where the Lock terminal Feature is because i realized its only on the 4th time you enter a password it locks

os.pullEvent = os.pullEventRaw
x = 1
while true do
if x == 4 then
  print("Password Entered Incorrect 3 Times")
  print("Locked For 1 Minute")
  sleep(60)
  x = 1
end
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local input = read("*")
if input == "password" then
  term.clear()
  term.setCursorPos(1,1)
  print("Password Correct")
  rs.setOutput("right",true)
  sleep(5)
  rs.setOutput("right",false)
else if input == "debug" then
  term.clear()
  term.setCursorPos(1,1)
  print("Entering Console Development Mode")
  error()
else
  print("Password Incorrect")
  x = x + 1
  sleep(2)
end
end
end

also if i set x = 0 at the start of the code then when it gets to the x = x + 1 it give a error saying something like error adding something to nil

#10 albrat

  • Members
  • 162 posts
  • LocationA Chair

Posted 17 July 2013 - 06:59 AM

For a neater debug exit... try printError() instead of print ()



if you place a disk drive under your computer ... that is the priority device for loading ... so place a disk drive under your computer and then place re-inforced stone around it, etc... that way the computer will only boot from your locking program.

There is also another security feature, nothing to do with your computer terminal... where is your door in relation to your computer terminal ? (I hope it is not to the right of your computer)

If it is to the right of your computer, try this... make a lever, place it infront of the door, flick the lever. Voila computer not needed.

I have a door system setup with the door placed in the Open position, always open. I then have a redstone torch underground that powers the door. The door then closes. I also have underground a server computer with wireless modem that has a "allowed" list of two computers. These two computers are the door terminals with wireless modems. The door terminals get a correct password and they send a message to the door controller, which then opens the door for 5 seconds.

(if you supply power to the side of a block with a redstone torch on top of it ... it turns the torch off / opens the door)

breaking the computer means the door stays locked. dropping a Switch on the floor and turning it on, means the door is never going to open... voila locked untill the password is correct.

Sadly the fully working copy of my code is on a server i cannot access at the moment (ip changed and the admin guys are a bit busy to sort the server at the moment still on 1.4.7 minecraft. lol)

#11 JackPriceBurns

  • Members
  • 5 posts

Posted 17 July 2013 - 10:36 AM

Do you know anything else cool i can do with computer craft i mean the only think i think is cool is the lock door but thats like the only think i know a computercraft Computer can do

#12 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 17 July 2013 - 12:18 PM

The top of the computer is the first side it checks.

#13 albrat

  • Members
  • 162 posts
  • LocationA Chair

Posted 17 July 2013 - 01:57 PM

View PostLyqyd, on 17 July 2013 - 12:18 PM, said:

The top of the computer is the first side it checks.
eeps, I am still learning new things every day... lol Sorry about the mis-information on the bottom being the first side it checks. Thank you Lyqyd for correcting me. :)

As to the ideas as to what to use the computers for... a login system, server based login system, Door control system, access attempt logging systems, control machines that require redstone input. Detect redstone inputs, program mining turtles... A cobblestone generator!! (just made one myself from 2 turtles and a short program that loops untill inventory is full on a diamond chest.

just a few ideas about what to use the CC for.. (plus there are peripheral addons that add player detection etc... (the server i play on has none of those yet though).

#14 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 17 July 2013 - 04:57 PM

@Disk booting
You could do it so.(It only saves the computer which is running this program):
local function ejectDisks()
  while true do
    for k,v in pairs(rs.getSides()) do
      disk.eject(v)
    end
  sleep(0)
  end
end

local function main()
--passwordScript here
end

parallel.waitForAny(ejectDisks, main)


#15 ZagKalidor

  • Members
  • 111 posts

Posted 17 July 2013 - 05:08 PM

Best way to hack a password protected door is to slam it down. Hehe - who needs computers if you got the ram...

I prefer Tesla-Coils - your dead while thinking of a passw.................
you dont even need doors

You put industrialcraft tesla coils out of reach in range around your house. put a disc-drive in reach, if you enter the right disc (with the right name on it), you will be asked a password or a code, both data will be sent to a remote computer and verified, if correct - remote computer deactivates tesla.

B.t.w. I never played on servers, is there no way to dig in someones house behind the door? Bedrock can't be placed to build a house, so why do i need a password protected door if i can dig inside your house? Or is this a no-go? no clue!! Please inform me.

#16 albrat

  • Members
  • 162 posts
  • LocationA Chair

Posted 17 July 2013 - 07:10 PM

View PostZagKalidor, on 17 July 2013 - 05:08 PM, said:


B.t.w. I never played on servers, is there no way to dig in someones house behind the door? Bedrock can't be placed to build a house, so why do i need a password protected door if i can dig inside your house? Or is this a no-go? no clue!! Please inform me.

I play on a server with 5 friends, we would not damage each others stuff... But I have been playing with the servers and clients on there. My base is erm. Modest in size, a floating castle from 72 blocks high at the base and extending to 130 ish high at the top I think, 64 x 64 base size. 1 big room where i do all my work, processing, storage and sorting of my quarries. A quad cobblestone generator. Recyclers, mass fabricators etc. We do not spawn items in. it's all hard work from nothing to where we are. ( nuclear reactors etc .. lol ) we all have Nukes... :P

My base is one of the smaller bases out of the 5 of us now. but I really can not be bothered to move to a new base / location. and it serves the needs of any base. (plenty of space)

Back to the question... Digging around the doors. First rule of security. Invest time and effort into making reinforced Stone, reinforced doors. (takes about 18 seconds of solid digging with a diamond pickaxe to remove) you can not remove them with anything other than a diamond pickaxe... not even tnt will not break them.

Where i build things that I do not want broken or accessed I build a little reinforced stone room... When I first setup a nuclear reactor... I was not sure about the destructive powers of it... so built a room with 3 reinforced blocks thick... I mistakenly got over zealous with the rods one day... 2x reinforced stone stops a nuclear explosion from a reactor. It left the outer shell of the room intact but irradiated everything around. lol.

one of the others on our server tested 4 "Nukes" and tried a reactor going critical. as a test on the reinforced stone... The 4 nukes were not as powerfull as the reactor going critical. So it just shows how strong the reinforced stone is... :)

Tesla coils are a bit too effective sometimes :P if you forget. ^_^

#17 ZagKalidor

  • Members
  • 111 posts

Posted 17 July 2013 - 07:32 PM

View Postalbrat, on 17 July 2013 - 07:10 PM, said:


Back to the question... Digging around the doors. First rule of security. Invest time and effort into making reinforced Stone, reinforced doors. (takes about 18 seconds of solid digging with a diamond pickaxe to remove) you can not remove them with anything other than a diamond pickaxe... not even tnt will not break them.

Ok, first of all, thankx for that reply, that is totaly off topic, i know that, but it's simply a question that is in my mind, since i use computercraft and CCsensors and stuff. Of course i made my own security system doors and because of that i always reasked the final need of that all, to come back to the question that is in my mind.

Why the hell should i programm a security door, that can be broken and easily entered? And coming back to your sense that i quoted above. Nevertheless it takes 18 seconds to break one block of reinforced stone. The thought behind for me is simply, - it can be broken - end. Nothing more and nothing less. See what i mean? Why build an expensive wall, when i can walk around it. Ok some people take their first steps in coding, doing such stuff, it was the same with me. But for me, the core sense is that a door can not be protected in our known ways. The only thing that would be save, would be a bedrock-piston door, but this is not existing.

View Postalbrat, on 17 July 2013 - 07:10 PM, said:

Tesla coils are a bit too effective sometimes :P if you forget. ^_^

Yeah, they are indeed, got killed by my own a several times, but for sure, this makes it that interesting. But honestly, if a person is really behind breaking into your house, he could nuke several layers of reinforced stone, until he sees the coils, and then nuke them too, but maybee there will be no house left in that scenario to break into.

My backthought is just, my home is never quite safe.

#18 albrat

  • Members
  • 162 posts
  • LocationA Chair

Posted 17 July 2013 - 07:56 PM

In the case of my castle... one nuke would remove it. lol. But it would also kill the server. Item drops from chests...

#19 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 17 July 2013 - 07:56 PM

Other mods do add possibilities that make locking programs actually meaningful, like MFFS. There are also block protection plugins and the like, though those can usually be defeated by turtles if turtles are enabled at all.

#20 albrat

  • Members
  • 162 posts
  • LocationA Chair

Posted 18 July 2013 - 05:20 AM

Client for my server

http://pastebin.com/Y77DKddS

Server for my Client

http://pastebin.com/JiQFgstb

Basically save them as "server" and "client" then call them by writing a startup file with "shell.run("server")" or "shell.run("client")" that way you can tell what you installed where.

there is a server thing you have to change. the admin in the users ... you can either remove the admin from the users or change the password. (currently "23super" ) so no users can disable the server. ** I wrote a back door into the server so an admin can shut down the CTRL + T terminate incase of maintenance. This means you can add more users by stopping the server and editing the users table. ** hence I say change the admin password as soon as you install it. (as a secondary security feature, choose a admin pc, get it's id number and change the adminid to that pc's number - only a adminid can disable the server's anti terminate)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users