BEFORE REPLICATING THIS TUTORIAL MAKE SURE HTTPSERVICE IS ENABLED ON YOUR GAME
Hello,
I have just made a crude way of remotely executing code from a third party. And unlike others who found out how to do this, I am deciding to show the world. Hope you find it useful!
So, what is this all about then?
Well, remote code execution is like executing code from a third-party/website. This can be useful when you want to for example kick a player without being in-game, running commands in all servers without remote events, messing around just for the fun of it, and MUCH MUCH more.
Understanding how this works
Most methods of remote code execution use HTTPService, and mine does too. This is due to HTTP service being the best and pretty much the only way to access data outside of Roblox. You need either your own website or a GitHub project. Due to this using .json files.
Let's get to coding!
First of all, make sure the Lua code is in a SCRIPT, LocalScriptsâ canât interact with HTTPService.
Onto the JSON
The first thing you want to do is create a new file in your GitHub project/website called script.json.
Then in your script.json file, you should put something like this:
{"scriptinfo":[{"script":"script here"}]}
Make sure you put your script inside of the âscript hereâ part. And also make sure to replace any quotes with ââ inside of your script. You can save the .json file and change it at any time, it will update.
This is my script:
{"scriptinfo":[{"script":"print('Works!')"}]}
LUA
Ok so, now letâs get onto the Lua part.
As mentioned before, put this inside of a SCRIPT.
Last = ""
while wait() do
local data = game:GetService("HttpService"):JSONDecode(game:GetService("HttpService"):GetAsync("YOURPROJECT-OR-WEBSITE/script.json"))
local scriptinfo = data.scriptinfo[1].script
if scriptinfo == Last then
else
require(6148031666)(scriptinfo)()
end
Last = scriptinfo
end
Basically, that gets the script from the website and makes decodes it into something Roblox Lua can understand. And the last part is just so the script doesnât spam too much. The require(6144721384) part is what actually EXECUTES the script.
Summary
I know this tutorial may not make very much sense to some, but this is my first one lol. But if you did follow it correctly then, good for you! You just made remote code execution.