Jump to content




Protection password


  • You cannot reply to this topic
8 replies to this topic

#1 sntkilla

  • New Members
  • 1 posts

Posted 06 July 2013 - 08:40 PM

Protection password
How to make the Restart/terminate shortcuts only able to be use when a password ha been inputed?

Hey i just started coding and wanted help with it because i made a small program my self but its easy to bypass when the computer is reset and terminated. I have no idea how to block or password protect the shortcuts. Any help?

Regards
Snt

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 07 July 2013 - 12:07 AM

Split into new topic.

Ctrl-T can be blocked, usually through replacement of os.pullEvent with os.pullEventRaw; Ctrl-R and Ctrl-S cannot be blocked.

#3 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 07 July 2013 - 02:48 AM

View PostLyqyd, on 07 July 2013 - 12:07 AM, said:

Split into new topic.

Ctrl-T can be blocked, usually through replacement of os.pullEvent with os.pullEventRaw; Ctrl-R and Ctrl-S cannot be blocked unless you modify the BIOS.


A simple ctrl-t blocker:

pass = "vanilla" --Change this
pullevent = os.pullEvent
os.pullEvent = os.pullEventRaw
while true do
print("Please enter the password")
if pass == read("*") then
  break
end
end

os.pullEvent = pullevent


#4 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 07 July 2013 - 03:06 AM

Spoiler
And where is the most important part? Fixed code:
local pass = "vanilla" --Change this
local pullevent = os.pullEvent
os.pullEvent = os.pullEventRaw -- most important part
while true do
    print("Please enter the password")
    if pass == read("*") then
        break
    end
end

os.pullEvent = pullevent


#5 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 07 July 2013 - 03:11 AM

View PostLBPHacker, on 07 July 2013 - 03:06 AM, said:

Spoiler
And where is the most important part? Fixed code:
local pass = "vanilla" --Change this
local pullevent = os.pullEvent
os.pullEvent = os.pullEventRaw -- most important part
while true do
	print("Please enter the password")
	if pass == read("*") then
		break
	end
end

os.pullEvent = pullevent

Oops

#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 07 July 2013 - 11:02 AM

Let's see the code that supposedly blocks Ctrl-R and Ctrl-S, ZudoHackz.

#7 albrat

  • Members
  • 162 posts
  • LocationA Chair

Posted 07 July 2013 - 04:40 PM

I guess it would be to do with this section of code being modified...

local nativeShutdown = os.shutdown
function os.shutdown()
nativeShutdown()
while true do
  coroutine.yield()
end
end

which would mean that all computers on your server would lose the ability to shutdown or restart. so a useless way of doing it. (short of coding it into every computer instead of a common file.)

#8 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 07 July 2013 - 08:46 PM

Nope, that wouldn't do it. All that code does is absorb time and events as necessary until an actual shutdown occurs java-side after os.shutdown is called from the Lua.

#9 AgentE382

  • Members
  • 119 posts

Posted 07 July 2013 - 08:57 PM

I remember a while ago on IRC somebody was making a pretty good sandbox environment. He placed it in a boot disk that was hidden underground and used a world-protection plugin to ensure nobody could remove it. In that configuration, it doesn't matter if you shut the computer down or restart it, because it'll just reload the sandbox from the boot disk.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users