Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'socket'
- puts "Starting Server"
- server = TCPServer.open(23)
- puts "Server Started"
- loop {
- puts "Waiting on connections"
- Thread.start(server.accept) do |client|
- puts "New connection #{client}"
- client.print('USER ID: ')
- print('USER ID: ')
- @userid = client.gets.chomp.to_s
- puts(@userid)
- client.print('PASSPHRASE: ')
- print('PASSPHRASE: ')
- @passphase = client.gets.chomp.to_s
- puts(@passphrase)
- if (@userid == "001" and @passphase == "pickles") then #TODO: Add in different usernames and passwords for different members of WLHQ
- client.puts("Ident confirmed. Welcome Agent.") #TODO: Add in agent names for different UIDs
- client.puts(" _ _ _ _ _ _ _ _ _____ _____ ")
- client.puts(" _ _ _| |_|_| |_ ___| |_|___| |_| |_ ___|_|___ ___| | __|")
- client.puts("| | | | | | _| -_| | | . | | _| | | | . | | |__ |")
- client.puts("|_____|_|_|_|_| |___|_|_|_ |_|_|_| |_|_|_|_|_|_ |_____|_____|")
- client.puts(" |___| |___| ")
- until client.eof? do
- client.print("$:> ")
- command = client.gets.chomp.to_s
- case command
- when "version"
- client.puts("WhiteLightningOS V0.1 Written by and for WhiteLightningHQ")
- when "exit"
- client.puts("Goodbye Agent")
- client.close()
- when "global thermonuclear war"
- client.puts("I win. Thanks for playing!")
- else
- client.puts("That's not implemented yet, only current commands are version, exit, and global thermonuclear war")
- end
- end
- else
- client.puts("Ident confirmation failed, system tracking enabled")
- client.close
- end
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement