[1.33][SMP] Rednet DDoS
#1
Posted 08 May 2012 - 12:03 AM
In a Server we have a next problem: people make a script which is spamming rednet broadcast. It looks not a problem, but it is.
ComputerCraft is crashing and Terminals/Turtles are crashing in the whole server.
Maybe there should be a time-out or something, because this is pretty annoying.
Thank's for reading,
Gerard.
#2
Posted 10 May 2012 - 07:35 AM
This is just the next generation of spam.
Why not edit rednet and add a program to it.
If this message has been repeated 5times in 1 second. Then error("Please stop spamming rednet")
#3
Posted 11 May 2012 - 02:44 AM
libraryaddict, on 10 May 2012 - 07:35 AM, said:
This is just the next generation of spam.
Why not edit rednet and add a program to it.
If this message has been repeated 5times in 1 second. Then error("Please stop spamming rednet")
That will do the same thing: crash it.
You can try this:
while true do sleep(0) --Stops crashing --your code end
#4
Posted 11 May 2012 - 03:13 AM
write a program on a turtle that turns rednet on for 1 sec then off again (so it don't crash). Make the turtle move and then check if it is closer or further away from the computer ID.if further away then move in the opsite direction X2 eventual the turtle should stumble near the transmitter and you can turn it off / destroy it.
#5
Posted 11 May 2012 - 07:12 PM
BigSHinyToys, on 11 May 2012 - 03:13 AM, said:
write a program on a turtle that turns rednet on for 1 sec then off again (so it don't crash). Make the turtle move and then check if it is closer or further away from the computer ID.if further away then move in the opsite direction X2 eventual the turtle should stumble near the transmitter and you can turn it off / destroy it.
And what if ComputerCraft is crashed, he can't create a new thread or the server is crashed? />
#6
Posted 11 May 2012 - 11:52 PM
#8
Posted 12 May 2012 - 11:48 AM
#9
#10
Posted 12 May 2012 - 05:20 PM
Teraminer, on 12 May 2012 - 11:48 AM, said:
Put it in a disk />
abc, on 12 May 2012 - 02:14 PM, said:
That would make the computers lag.... ALOT (especially for global Multiplayer games)#11
Posted 12 May 2012 - 07:07 PM
#13
Posted 12 May 2012 - 07:16 PM
local x,y = term.getSize() rednet.open("top") title = "Rednet Explorer 2.0" --Add title = "name" to change the webpage's title! local website = "home"; if fs.exists(".cache") then fs.delete(".cache") end fs.makeDir(".cache") local cPrint = function(text) local x2,y2 = term.getCursorPos() term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2) print(text) end search = function(message) while true do sleep(0) rednet.broadcast(message) --Search for that message end end function createSite(websitename) cPrint("Hosting " ..websitename.. "...n") test = fs.open(websitename, "r") fileContents = test:readAll() test.close() while true do sleep(0) id, message = rednet.receive() if message == websitename then print("[" ..os.time().."] [" ..id.. "] Pinged Website.") rednet.send(id, fileContents) print("[" ..os.time().."] [" ..id.. "] Received Data") end end end local Address = function() text = "rdnt://" term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), 2) term.clearLine() write("rdnt://") website = read() loadWebpage() end function done() term.setCursorPos(1, y) name = "F5 = Refresh" write("Press CTRL to travel the web! :P/>/>") term.setCursorPos(x - name:len(), y) write(name) while true do sleep(0) -- stop crashing e, k = os.pullEvent("key") if k == 63 then loadWebpage() break else Address() break end end end loadWebpage = function() term.clear() term.setCursorPos(1,1) cPrint(title) cPrint("rdnt://" ..website.. "n") if website == "home" then print("Welcome to RedNet explorer (2.0)! This requires you to have a wireless modem on your computer.") print("Host a website at: ") print("rdnt://newsite! ") print(" -ComputerCraftFan11 ") elseif website == "newsite" then title = "Rednet Servers (2.0)" print("Are you sure you would like to make this PC a server?") cPrint("Y = Yes N = No") while true do e, k = os.pullEvent("char") if k == "y" or k == "n" then break end end if k == "y" then term.clear() term.setCursorPos(1,1) print("Welcome to the Rednet Servers. Please enter the website name: ") websitename = read() rednet.broadcast(websitename) i, me = rednet.receive(0.001) if me == nil then print("Thank you! This website will be running off of the file:n" ..websitename.. "n") write("Are you sure? (Y = Continue, V = Edit)") input = read() if input == "Y" or input == "y" then if fs.exists(websitename) == false then print("Please create " ..websitename.. " first!") sleep(0.5) shell.run("edit", websitename) end term.clear() term.setCursorPos(1,1) createSite(websitename) elseif input == "V" or input == "v" then shell.run("edit", websitename) term.clear() term.setCursorPos(1,1) createSite(websitename) end else print("I'm sorry, this domain name is taken.") end end else title = "Rednet Explorer 2.0" rednet.broadcast(website) print("Connecting...") id, message = rednet.receive(0.1) if message == nil then print("Unable to load webpage.") search("Loading " ..website.. " failed.") else if fs.exists(".cache/" ..website) then fs.delete(".cache/" ..website) end webpage = fs.open(".cache/" ..website, "w") webpage.write(message) webpage.close() term.clear() term.setCursorPos(1,1) cPrint("Rednet Explorer 2.0") cPrint("rdnt://" ..website.. "n") shell.run(".cache/" ..website) end end done() end loadWebpage()Activate it by typing anything in the address bar.
Or this:
local x1, y1 = term.getSize() --Returns the size of your terminal local char = ">" --Stores your character direction local currentX = 1 --Saves the current X of the cursor local currentY = 1 --Saves the current Y of the cursor function newObject(oX, oY, title) if oX - currentX < x then term.setCursorPos(oX- currentX, oY- currentY) write(title) if oX- currentX == x/2 and oY- currentY == y/2 then if char == "v" then --up currentY = currentY -1 elseif char == "^" then --down currentY = currentY +1 elseif char == ">" then --left currentX = currentX -1 elseif char == "<" then --right currentX = currentX +1 end drawCursor() end end function world() --Put code for the world in here. --Ex) newObject(5,5, "O") end function drawCursor() term.clear() --Clears the screen world() --Draws the world term.setCursorPos(x1/2, y1/2) --Draws a cursor at the current X/Y write(char) end while true do drawCursor() sleep(0) local e,key = os.pullEvent() if e == "key" then if key == 17 or key == 200 then --up currentY = currentY -1 char = "^" --Change your direction to face up rednet.broadcast("ServerConnected:UP") elseif key == 31 or key == 208 then --down currentY = currentY +1 char = "v" --Change your direction to face down rednet.broadcast("ServerConnected:DOWN") elseif key == 203 or key == 30 then --left currentX = currentX -1 char = "<" --Change your direction to face left rednet.broadcast("ServerConnected:LEFT") elseif key == 205 or key == 32 then --right currentX = currentX +1 char = ">" --Change your direction to face right rednet.broadcast("ServerConnected:RIGHT") end end rednet.broadcast("ServerConnected:ON") endIt looks like a game, but it broadcasts in the background.
#14
Posted 12 May 2012 - 10:49 PM
#15
Posted 15 May 2012 - 02:39 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users