OPTICASSASSINS
#140180375Sunday, July 13, 2014 7:50 AM GMT

I have no idea what any of this, except the last 5 words mean.
Elopus001
#140197245Sunday, July 13, 2014 3:03 PM GMT

I think Crazyman32 knows how to do this. loadstring and a couple other commands involving _G in a ServerScriptService folder... :) Still testing.
Elopus001
#140198469Sunday, July 13, 2014 3:23 PM GMT

Wait. This seems like a bad idea. I don't want to be unable to test my games...
OPTICASSASSINS
#140200403Sunday, July 13, 2014 3:54 PM GMT

bob
Elopus001
#140230821Sunday, July 13, 2014 9:36 PM GMT

If there is an exploit that allows you to view scripts in workspace then make a script that moves everything from ServerScriptService to workspace.
Elopus001
#140232223Sunday, July 13, 2014 9:47 PM GMT

If it adds it there...I have no clue. Someone else should do this.
ManuelReload
#140235607Sunday, July 13, 2014 10:20 PM GMT

@Elopus001 what are you talking about?... he's not asking for you to move a modulescript to the workspace and read the source... he's asking you to get the source of a COPYLOCKED modulescript -- one you load by the Asset ID... via require(assetid)
Krauzz
#140238759Sunday, July 13, 2014 10:55 PM GMT

^LOL
ManuelReload
#140242726Sunday, July 13, 2014 11:41 PM GMT

wat m8?
Seranok
#140274978Monday, July 14, 2014 5:28 AM GMT

I updated my ModuleScript to return a table like so: return { test = function() end } This made it possible to get a reference to the ModuleScript: getfenv(require(165456864).test).script.Parent = Workspace oxcool1 discovered that you could then call :SavePlace and voila, you have the ModuleScript. So we tried this in the ModuleScript: script:Destroy() return { test = function() end } It is still possible to get a reference to the ModuleScript, but since you can't re-parent the ModuleScript you can't serialize it. The only other known possibility, which has been mentioned by numerous people, is to use string.dump to get the bytecode for methods of the ModuleScript. However it is easy to get around this by wrapping your functions or using metatables and the __call metamethod.
Seranok
#140275097Monday, July 14, 2014 5:29 AM GMT

Oh and oxcool1 suggested using ScriptContext.Error so if the ModuleScript errored you could get a reference to the script and then parent it to the Workspace. This won't work with the ModuleScript:Destroy() method.
Seranok
#140277000Monday, July 14, 2014 5:54 AM GMT

Update: It looks like ScriptContext.Error will never fire for ModuleScript. It will always fire with a reference to the script which ultimately called the ModuleScript function. So setting script = nil should suffice in making it impossible to ever get a reference to the ModuleScript. RenderSettings pointed out that :Clone() works on deleted objects, so as long as one has a reference to the ModuleScript, you can clone it, parent the clone to the Workspace, and call :SavePlace(). So if there is a method to get a reference to a ModuleScript, then its source can be stolen, plain and simple.
Seranok
#140277423Monday, July 14, 2014 6:01 AM GMT

How to write a secure ModuleScript [preliminary]: * Upload it on an account which has no active places. This will prevent an exploiter from joining one of the creator's places and then calling InsertService:LoadAsset to get the ModuleScript. * Make sure your ModuleScript sets script = nil and doesn't keep any references to iself. * Use local variable so that if the caller calls setfenv on the functions in your ModuleScript it will be unaffected. * Wrap your functions somehow so that string.dump won't be able to steal sensitive parts of your code.
Notunknown99
#140302965Monday, July 14, 2014 3:10 PM GMT

Are you going to RobloxLocked ModuleScripts required via assetId? That would prevent it from being parented, right?
Seranok
#140330222Monday, July 14, 2014 8:18 PM GMT

That's not necessary. Setting script = nil removes all references to the ModuleScript so the calling script reparent it.
Notunknown99
#140330498Monday, July 14, 2014 8:20 PM GMT

True, but it would remove the possibility for all ModuleScripts, and not just those whose creators are aware that they have to say script = nil.
Diitto
#159676838Wednesday, April 08, 2015 7:24 AM GMT

1) The string.dump function is currently broken in online mode(probably due to security reasons), so you can't steal that way. 2) It seems that in some update, ROBLOX removed doing getfenv(Function).script, so that's taken care of. Now, here's the issue. What if you wished to execute code safely on the client? You cannot require(assetId) via a LocalScript, and if you send the module, the reference could lead to module theft. Excuse me for the necro bump.
cntkillme
#159676961Wednesday, April 08, 2015 7:30 AM GMT

Why did you bump this, it's months old... And also #2 worked like 2 weeks ago, you're probably doing something wrong.
gskw
#159685416Wednesday, April 08, 2015 12:34 PM GMT

@cnt Really? That is a serious problem for Valkyrie...
gskw
#159685470Wednesday, April 08, 2015 12:35 PM GMT

Excuse my stupidity, setfenv() exists and nuking stuff is already taken care of.
NovusTheory
#159687202Wednesday, April 08, 2015 1:21 PM GMT

@Luc That key is fully visible to Fiddler. If you were to get data and then send a request with the changed value. It would update it on the server. Total Posts: 404 ---------- Not Found
eLunate
#159687464Wednesday, April 08, 2015 1:27 PM GMT

Lol gskw forgetting I already nuked all the external environments.
cntkillme
#159719526Wednesday, April 08, 2015 10:31 PM GMT

Yeah elunate is better than that :(
Diitto
#159719805Wednesday, April 08, 2015 10:35 PM GMT

@cnt 9 months old thread == 1 second old thread
cntkillme
#159719906Wednesday, April 08, 2015 10:36 PM GMT

@Diitoo 9 month old threads shouldn't be bumped unless the OP has more questions and doesn't want to create another thread.