[Exploit] Precision Server Crash and Fix

Using the precision tool you can crash a server by putting a prop really far out side of the map. Gmod has a fix for this by removing props, but a prop put too far crashes the server.

To see this exploit you can do it one of two ways, the first is using the push or pull. Set the number of the push/pull really high and right click or hit reload on a prop. The second is to use the move tool and set the snap distance really high. Then move the prop.

See an example image and the fix here: http://www.douglashuck.com/garrys-mod-precision-server-crash-and-fix/

Rotation fix is here (Thanks to unrezt): http://www.douglashuck.com/garrys-mod-precision-server-crash-and-fix-pt-2/

As much as I’m happy when people give out fixes for crashes.

Don’t you think multiple spamming on multiple servers of your link is stupid? I get helping people, but joining random DarkRP servers to spam your links into OOC is going a bit too far.

I haven’t put my link anywhere aside from on Facepunch and on a workshop comment thread. You can hold me responsible for other people trying to get the message across.

lol pantho go fix your servers instead of complaining its awful how they all keep crashing …
i never saw him spam anything on your server.


Some guy claiming the link is his website and spamming it like hell, and you posting here shortly after made me think it’s probably related.

Either way if it is you then stop being annoying. If it isn’t then stop your friends being annoying. Since it was before you posted this page, and has been happening for 3-4 days I’d assume it’s someone you gave the link to. Or are there other ways to find this website?

Anyway to be helpful you should add the stacker exploit to the list of popular crash exploits, same as easy precision really with setting offsetx/y/z.
Capping those will fix it easily enough. Just throw something like:

if offsetx >= 300 OR offsetx <=-300 then return end
if offsety >= 300 OR offsety <=-300 then return end
if offsetz >= 300 OR offsetz <=-300 then return end

Into tool left click.

[editline]23rd January 2013[/editline]

Also Mr Troll, I fixed 3 crash exploits today. Although I’ll be honest they where stupidly stupid and shouldn’t have worked on the server in the first place.

Don’t mean to offend but I checked the file with diffchecker before I uploaded the fix to my server, it looks legit. Thanks for the heads-up, we need more white-hat gents like you.

Edit: Thanks above for pointing out the stacker crash. Assuming the crash is caused by spawning a prop in a ridiculous place, fix it by changing line 84 in the stacker tool from

[lua]if !Ent:IsInWorld() then
return false //Who put just break here? Seriously? Giving the player no hint he/she’s not supposed to do that?


[lua]if !(Ent:IsInWorld() and util.IsInWorld(NewVec)) then
return false


lines 53-55 as well, just to be safe;

local OffsetX = math.Clamp(self:GetClientNumber( “offsetx” ), -300, 300)
local OffsetY = math.Clamp(self:GetClientNumber( “offsety” ), -300, 300)
local OffsetZ = math.Clamp(self:GetClientNumber( “offsetz” ), -300, 300)

Another bug with precision tool (the one on the workshop anyways); if you check the rotation box and set the rotation amount to zero it will crash.

Ill try this out, if it checks out ill update. Thank you.

Pantho. Your just acting dumb now. Stop talking. If someones spamming your server you can just ban them, problem solved, its not me. Also there are two threads the second is on another exploit from 3 days ago. The site did not exist 4 days ago.

Thank you, thank you, thank you, thank you, and thank you more. I’ve been searching for how these fucks have been crashing my server. <3

Is it possible to crash the server just by somehow spawning props outside of the world? If so, I’m adding protection against that now, good that these things see the light of day.

Make sure you use v2.

The key is really far out. Garrys mod handles props spawned just outside the map by deleting them. Go to far and it crashes. I don’t think it would be easy to protect against that with lua because you would have to run checks on any prop being moved not just spawned. The tool here moves a prop far outside the map not spawning it. Well made tools are the only protection we should need.

Please post your fix, when you make it.

Edit: Faceguy, Did you fix the rotation error?

and, are you fixing stacker too? :stuck_out_tongue:

Ill fix stacker tmrw. If someone could link me to the workshop most people use, that would be awesome.

The only one on the workshop :C

Eh, still added a little protection, just in-case.

Little simple one line that may or may not help. Like faceguydb said, the values are quite high.

if not util.IsInWorld(trace.HitPos) then return false end

Replace trace with whatever your hooks use.

The productivity in this thread astounds me, for some reason.

I’ll try to contribute any crash that I can help fix as well.

I am not trying to come off as a douche but from what I found testing the crash is in the engine and only happens when a crazy far value is chosen. I think the only way to prevent this is to never move it there and the only way to do that with lua is to do a check when running setpos if that is even possible. I am not sure but I think the set position function isn’t a function written in lua, only called by lua.

This might be something garry could easy fix but I wouldn’t hold my breath on it, all of the default gmod stuff doesn’t have a problem only the crap we make.

You could possibly overload SetPos with another function which checks the position before moving the entity - this would be a blanket fix for the issue but this would likely conflict with addons like Gravity Hull which rely on the same trick. If you’re not running any addons like that then the fix would look something like; (not tested)

[lua]local oldsetpos = Entity.SetPos
Entity.SetPos = function(self, pos)
if not util.IsInWorld(pos) then return false end
oldsetpos(self, pos)

Might want to overload the setpos function for physics objects too - i think they have a separate function for the same thing.

Uh I’d thank the person that came on to my server and told me there was a critical exploit and how to fix it but that’s just me.

[editline]24th January 2013[/editline]

Oh, shut up. Why can’t you appreciate that someone brought it to your attention.

ByB servers are shit now anyway last time I checked. constant lag and crashes, paid admins, and the ones that dont pay are just plain shitty admins period.

I think you have a lot more to worry about than someone telling you how to fix something

And yet I’m the one posting productively inside this thread, instead of trying to bring up the same old repeated shit stirring to try and destroy a decent thread? Hope you’re proud of yourself.

Also, I know this is widely known and fixed in most gamemodes. A lot of these tools are used on other servers (As in, not DarkRP servers), so you might want to mention the removing constraints before a prop breaks.
I’ll just dump Falcos hook below.

[LUA]hook.Add(“PropBreak”, “drp_AntiExploit”, function(attacker, ent)
if IsValid(ent) and ent:GetPhysicsObject():IsValid() then

I believe he was referring to the false accusations of me spamming your server because I fixed some exploits. However, enough with the bashing from both of you, it is not productive no matter who it is coming from.

The previous hook is in the workarounds lua for darkrp if I am not mistaken. If we find a gamemode where that exploit is a problem it’s better off having the gamemode developer fix it then server owners. There’s fewer gamemode’s with building and constraints then servers.

With that said if anyone does know of a gamemode exploitable in that way, making it know would help to get the developer to patch it.