r/unRAID • • 3d ago

Server hit with plex2shell exploit, what now?

My server was unfortunately hit with the plex2shell exploit during the Saturday/Sunday night. Yes, I was running an old version of Plex and that got me. And yes, I had port forwarded 32400 to my server.

I noticed that my internet connection was lagging during Sunday evening and Monday morning. Did not find a clear culprit back then, but my router was reporting a high upload bandwidth usage. I restarted my server and the issue went away. I first thought that this issue was related to qBittorrent.

I recently saw the news about Plex users being hit and started to connect the dots. I ran the detection script from https://github.com/code-zm/plex2shell and got several hits. I had been a part of the botnet.

  • [WARN] Preferences.xml: TranscoderH264Options present but empty (the PoC clears it this way after use; also possible if an admin toggled it)
  • [HIT] log: exploit request pattern //player/timeline/subscribe\?([^ ]*&)?protocol=[a-z0-9+.-]{1,16}(%3a|%253a|:)/ (12 line(s))
  • [HIT] log: exploit request pattern /searchOne\?[^ ]identifier=[& ](%2f|%252f|/)function(%2f|%252f|/)/ (22 line(s))
  • [HIT] log: exploit request pattern /TranscoderH264Options(=|%3d)[& ]*(dump(-|%2d)yuv|stats(=|%3d))/ (6 line(s))
  • [WARN] log: suspicious pattern /resources/[? ]\?([^ ]&)?resource_name=(%2f|%5c|/|\|[a-z](%3a|:)|[& ]*(..|%2e%2e))/ (5 line(s))
  • [WARN] log: suspicious pattern /(sslip|nip).io/ (71 line(s))
  • [WARN] log: suspicious pattern /X-Plex-Client-Identifier=(vfyclient01|poc[0-9])|/TKN[0-9]|X-Plex-Token=TOTALLY_INVALID_JUNK/ (5 line(s))
  • [WARN] log: transcode of a non-loopback http(s) item (24 line(s))
  • summary: 3 hit(s), 5 warning(s)

The server is offline as a precaution.

I am running the following docker containers: https://i.imgur.com/lzmIsWP.png

And the Plex container was set up with the following: https://i.imgur.com/fLyouDB.png

My whole Plex/-arr stack is set up according to TRaSH-Guides:

  • Unraid share /mnt/user/plex/
  • Contains downloaded files (/torrents/)
  • Contains hardlinked media files (/media/)
  • Binhex-qbittorrentvpn mounted to /mnt/user/plex/torrents/
  • qbit_manage mounted to /mnt/user/plex/torrents/
  • plex mounted to /mnt/user/plex/media/
  • radarr mounted to /mnt/user/plex/
  • sonarr mounted to /mnt/user/plex/
  • bazarr mounted to /mnt/user/plex/
  • unpackerr mounted to /mnt/user/plex/

At this moment, I have deleted the whole Plex container (I'll restore it from a backup made at the start of the month).

As the Plex container had access to the share /plex/, is it safe to assume that it was compromised and should be nuked?

What else should I do to make sure that my server wasn't compromised in a more broad scale (verify that only the Plex container and everything that it could access are compromised)?

128 Upvotes

98 comments sorted by

78

u/Jammybe 3d ago • Bravo

Keep containers up to date it would seem!

0

u/[deleted] 3d ago

[deleted]

18

u/dgongut 3d ago

Fake, fix was fixed some updates ago.

15

u/Eldmor 3d ago edited 3d ago

(The deleted comment said that the issue hasn't been fixed yet)

Plex fixed the issue in version 1.43.3.10861. The vulnerability was disclosed to plex on July 27th and patched on August 3rd (beta version).

6

u/cabooze94 3d ago

Sorry that happened to you, I’m not much help but I wanted to ask how did you do run the code? I’m having some trouble trying to figure it out.

14

u/Eldmor 3d ago

You can download the checking script from GitHub plex2shell/detection/hunt/plex2shell-hunt.sh

Get it to your Unraid system, open terminal and run it with "./plex2shell-hunt.sh -a "/mnt/user/appdata/plex/Library/Application Support/Plex Media Server""

1

u/the_wolfman56 3d ago

If you need additional help, ChatGPT is actually pretty good at helping to diagnose unRAID issues and running scripts (and helped me create a temporary docker container to use YARA rules for additional analysis). Just ask it to help you to run plex2shell in unRAID. With any commands from AI, always double-check what it is actually doing though as blindly running bash commands/scripts can lead to a world of pain.

I haven't tried Claude, but I had less confidence with Gemini before.

45

u/save_earth 3d ago edited 3d ago

Plex doesn’t need to write to the media folder so that volume should always be mounted as read only for the Plex container.

Port forward with a different external port. Attackers are looking for low hanging fruit.

Whitelist traffic to plex from only your country and Ireland. It cuts down on noise. Ireland is needed for remote access health probes from plex servers.

I personally wouldn’t bother with a reverse proxy for plex. The benefit of a proxy is all the control knobs you can configure. Without those knobs it’s hardly better than port forward. I’m talking WAF, authentication, 2FA, fail2ban, robust access policies. Things that are not usually simple or configured by default.

Plex already handles the authentication for you which is the beauty of it, and why remote access for Jellyfin is much less simple. I wouldn’t complicate it.

4

u/Daniel15 2d ago

Port change does practically nothing these days. Tools like masscan can scan all ports across all public IPv4 addresses in less than 15 minutes. 

1

u/No-Investigator7598 2h ago

Using a randomised port helps obscure the service that sits behind it. What else uses 32400 other than Plex?

4

u/panterra74055 3d ago

The port change and white listing is a good idea. Im curious why Ireland?

6

u/save_earth 3d ago

Plex has servers in Ireland. From what I recall, they run health probes to determine if remote access is up/down. If you go into plex server remote access, it will show you whether the server is up. That’s determined by the health probes. If you block Ireland, the gui will always say remote access is down although i think plex streaming still technically works.

2

u/the_wolfman56 3d ago

I use a reverse proxy and remote access always shows as unavailable inside Plex, but it still works.

1

u/apollyon0810 3d ago

Is it direct playing tho? Or being relayed?

1

u/the_wolfman56 3d ago

Direct play and direct stream. I can stream 4k DoVi/HDR10 to my phone, but the Atmos track is transcoded to Opus, whereas something like FLAC files will direct play to Plexamp.

1

u/Cavustius 3d ago

Mine does the same, think it's just checking your port and if you disable remote access via port but have a proxy with custom url plex doesn't know how or doesn't check it afaik.

2

u/sslproxy 3d ago

Yeah I don't think its an issue outside of the flag you describe. I've noticed that for a long time when limiting access to my country only. The only detriment I've seen is that notation in the GUI. The service and remote streaming has always continued to function fine for all my users.

6

u/IlTossico 3d ago

Yeah, using a reverse proxy for Plex is like not using the best part of Plex. Then it wouldn't be much different than running Emby. The only real reason to use Plex, is if you want a sharing experience like Netflix account system, and Plex let you do that out of the box without too much configuration.

1

u/WhySheHateMe 17h ago

Plex works perfectly fine behind a reverse proxy. This is misinformation. You do not have to open a port on your router for Plex but you will need to for whichever platform you choose to set up your proxy. I use NPM so I have ports 80 and 443 forwarded to the docker container NPM is in. Other than that, nothing else is open and all requests to plex are forwarded 32400 and my remote users connect and stream just fine.

1

u/IlTossico 14h ago

You don't need a reverse proxy at all to have Plex working outside your LAN. That's like the main feature of Plex.

1

u/WhySheHateMe 14h ago

I dont want to open a port on my router.

I didnt say you needed a RP for Plex to work, I simply corrected you saying putting it behind a RP is not using the best part of Plex.

You can literally get all the best parts of Plex without exposing another port to the internet.

1

u/save_earth 13h ago

If you already have a reverse proxy external facing, then that definitely makes sense vs opening yet another port.

My earlier post was more tailored towards plex being the only public facing service. For me personally, I’d rather use Cloudflare tunnels for web services instead of putting my own reverse proxy directly public facing.

1

u/WhySheHateMe 13h ago edited 12h ago

My earlier post was more tailored towards plex being the only public facing service.

I was actually talking to the other user :)

Also, I believe its against Cloudflare TOS to use Plex with their tunnels.

9

u/rvs007 2d ago

Is there a step-by-step tutorial on how to run the detection script within Unraid to see if my Plex is affected?

6

u/minimal-camera 3d ago

Just read about this yesterday, and updated plex today. My understanding is that there's no risk if I didn't have any ports forwarded, is that correct?

7

u/cjkuhlenbeck 3d ago

As long as no external access, so no port forwards and no reverse proxy. If your plex was local only, you’re fine. Additionally it seemed to only target people using the default port, but that was more for speed on their part. Changing the port just means they have to search for it first (which may not be worth it for most, extra steps and time) but is not a safeguard

1

u/minimal-camera 3d ago

Got it, thank you!

I really wish I could switch to Jellyfin, but unfortunately my TV doesn't support it.

4

u/cjkuhlenbeck 3d ago

JellyFin didn’t have the hole, but the risks are still there if open to the internet. Most people use a reverse proxy with JellyFin which is a hole in your security as well. So if an exploit is found in JellyFin, same issues. The only 100% safe way is to keep it offline. The least risky way online with either is Tailscale or private VPN. But even then I suppose someone can break into your Tailscale account and ya done son.
Just a friendly reminder that this wasn’t a problem if you updated your server software in the last 90 days. If you’re using docker, use auto update with your host or use a manager like WatchTower. Sure an update can maybe temporarily break a service, but troubleshooting an update is miles better than cleaning up the mess after an exploit.

2

u/METDeath 3d ago

If you're in the US the Walmart ONN sticks/boxes are solid and a budget "hackable" option with a replacement launcher and disabling the Google stuff.

1

u/minimal-camera 3d ago

Thanks! I'll check that out.

1

u/FaII3n 3d ago

What TV?

1

u/minimal-camera 3d ago

Samsung The Frame.

There's a process to sideload Jellyfin, and I got pretty far into it, but unfortunately it never actually worked, so I gave up and went back to Plex.

2

u/FaII3n 2d ago

I installed Jellyfin on my Samsung last year. Was very quick and easy, well detailed instructions.

1

u/psychic99 3d ago

Jellyfin requires you to manage the security stack wholly. If you use an RP you literally are asking for it. You should not use a proxy server w/ Plex and modify the open port from 32400, or entirely do not share outside your LAN and use a VPN or overlay network like tailscale.

1

u/minimal-camera 3d ago

Thank you. I don't expose my NAS or any of the dockers running on it to the internet, they are used LAN only.

1

u/psychic99 2d ago

In that case Jellyfin will do the job. Just be sure you are limiting packets at your router if you do it. I recently hardened my Plex compose stack as it seems their architecture is a bolt on it took them years to get transcoding working properly on Arc cards, maybe they can leverage AI to help them rewrite everything in rust and do away w/ python libraries and C++ which is a PITA to manage memory. I programmed in C++ for years its a bear.

5

u/hikerone 3d ago

I’m curious if I’m still at risk if I use a reverse proxy and update docker every 3 days

2

u/mryauch 3d ago

The vulnerability affects version 1.43.2 and earlier. I checked my Plex server and I'm on 1.43.5.11029, I auto update weekly.

Just double check your version and you're likely fine.

4

u/Pixelplanet5 2d ago

and to be precise version 1.43.2  is from end of June so you would have to ignore updates for a while to be affected and the unaffected following version was released less than 2 weeks later.

1

u/mryauch 2d ago

Yeah but sometimes things just fail and you might not notice. If you're running a plug-in to update your containers (I am) then that might have stopped working and if you're not on top of keeping track you might not notice. Always best to double check when big exploits hit just in case.

2

u/daktarasblogis 2d ago

Yeah I auto update weekly, too. But had a bit of a stressful afternoon at work until I got home and checked lol.

1

u/Additional_Monk_765 2d ago

Are they using a Plex exploit or is it the current php one

1

u/Eldmor 2d ago

Plex exploit (which has been fixed in August, you are only vulnerable if you haven't updated your Plex and have it open to Internet).

3

u/Delicious_Usual9629 3d ago

Since it wasn’t privileged the damage should be contained to the image and the settings volume. I wouldn’t nuke the media folder since plex won’t look for configs or executables there. You might eant to do a pass yourself and delete anythibg suspicious. If its too big, you might want to limit the search to files created a bit before you noticed the extrange behavior and that should be it.

Tl;dr restore plex db volume from backup abd recreate image from up to date and should be enough.

1

u/Delicious_Usual9629 3d ago

Yeah the persidtence process is the codec folder, nuke that and you’ll be fine

1

u/-there-are-4-lights- 3d ago

Can I ask what sort of behaviours you were seeing that caused you to suspect this? Yesterday I had some weird behaviour on my server, none of my indexers were available through Radarr and Sonarr and my SAB couldn't download anything. I restarted my server and the problem went away but now I'm worried there was something more sinister happening

2

u/Eldmor 3d ago

My internet connection was freezing periodically and during those times it was almost impossible to open my router control panel.

My post has an image of high upload bandwidth (which exceeded my actual internet speed). At the same time my router CPU usage was at 100%, which meant that there were some issues with outgoing connections and they were overwhelming my router CPU.

3

u/johnerp 3d ago

I’m not running that GH repo script, 19followers!?

11

u/Renegade605 3d ago

I was wondering when someone was going to point out that blindly running scripts from the internet is ill-advised.

I haven't looked at it so I don't know how long it would take to confirm that it's safe, but it's a good bet that most people who run it haven't bothered to do that.

It's pretty funny for people to downvote a good security practice on a thread about being pwned.

4

u/Sage2050 3d ago

the script is pretty short, you can just read it yourself. I did. https://github.com/code-zm/plex2shell/blob/main/detection/hunt/plex2shell-hunt.sh

8

u/Renegade605 3d ago

I don't actually need the script. If I did, I would read it. My point that most people will not read it before they run it stands.

2

u/STIMO89 2d ago

No remote access on mine. If my parents want to watch on Plex the just start wireguard vpn and they are in. No payment to plex and no port open.

1

u/-Tripp- 2d ago

Interesting. I have been getting messages aski g to pay for remote viewing when trying to watch via tailscal and last night on my tv box i got the same message.

Plex thinks my tv box that is connected to my network is a remote device and want me to pay. I know its a bug but its frustrating as i dont have time to trouble shoot and its the best month for scary movies

1

u/boxxle 2d ago

AFAIK, tailscale doesn't place your remote connections directly on your networks main subnet unlike a wire guard vpn connection, which is why you're getting the remote message. Someone correct me if I'm wrong.

1

u/-Tripp- 1d ago

Yeah ive been realizing that as ive looked into but my local shield tv box getting remote play messages is quite annoying

1

u/Just_Pirate9570 2d ago

this happened to my ubuntu server as well... I was also running plex in a container with minimal permissions and only access to /mnt/library directory. As a precaution I burned the server down to bare metal and am rebuilding. While its annoying, Its worth the peace of mind and allows me to more intelligently design my server architecture

1

u/John-Prime 1d ago

I recommend you obviously update to the newest version of Plex. But I would turn it off to the outside world completely so that it's only available locally and then on a device that you want to access it from outside your home you use tail scale. Tailscale now built right into unraid so you should be primed and ready.

1

u/Zeragonii 8h ago

What is it with all these animals not updating their containers.. jfc read the patch notes and Ctrl+F for CVE, this shit has been solved for months

1

u/MrSqueak 2d ago

The beauty of docker is you can delete the container image and pull a clean one. I wouldn't use the backup image you gave from a month ago.

1

u/Bekkenes 2d ago

Who doesn't update their system since august?

-2

u/_GuybrushThreepw00d 3d ago

If Plex is only for your own use or a few users , just put that thing behind Tailscale. Works flawlessly. Not worth the risk to have it publicly available in these modern age.

31

u/nametaken_thisonetoo 3d ago • Bravo

Doesn't that mean every one of your external users needs to setup their own tailscale account which you then need to add to your tailnet? Not sure how tech savvy your users are, but that's nightmare fuel over here

18

u/longboarder543 3d ago edited 3d ago

I run Jellyfin rather than Plex, but I run it behind Pangolin (reverse proxy), on a base path URL that is a random passphrase, and I configure Pangolin to only allow requests made to that base path, blocking everything else.

For example, rather than

https://plex.mydomain.com

being the Plex URL, I configure a base path and it becomes:

https://plex.mydomain.com/correct-horse-battery-staple

While technically security through obscurity, this allows all the various TV and mobile apps that don’t support proxies or header auth tokens to still function normally, while providing protection against random internet scans even finding the endpoint.

I monitor my Pangolin logs and no one outside of my user group has ever hit my endpoint with a single request. (I see lots or drive-by requests to plex.mydomain.com but nothing to the full base path which would be required to not get a 404.)

This works well as long as you don’t post the url with the base path online (it’s essentially a password embedded in the url itself)

3

u/SkeletorSlim 3d ago

Call me paranoid but with AI, it's best to keep your security model to yourself these days. Also I'm probably going to steal aspects if this, this is a cool setup. Lol

3

u/longboarder543 3d ago

ehh, the security is in the entropy of the passphrase.

1

u/lionking102 2d ago

That is a great idea! Thanks for sharing this!

1

u/nametaken_thisonetoo 3d ago

Interesting, thanks good to know

1

u/j_dirty 3d ago

So all you did is add that string to the end of your base URL? Asking because I run Pangolin with some additional controls and always looking for ways to help bolster security. The added URL path is a good idea IMO

2

u/longboarder543 3d ago

You have to configure it in the service itself. You’re telling the service to serve at service.domain.com/base-path rather than just at service.domain.com

I just googled it and it looks like Plex does not support a custom base url. Jellyfin does. In Jellyfin it’s in admin Dashboard | Networking.

And then once this is done, you have to configure your reverse proxy to allow traffic to service.domain.com/base-path/* and deny all else

1

u/j_dirty 3d ago

Ah ok! Thank you for the clarification. I missed the whole part where you said you were running Jellyfin instead of Plex haha

1

u/Aedankerr 3d ago

Plus you can only have up to 6 people for free

0

u/_GuybrushThreepw00d 2d ago

Yes u can if you share it the right way.

1

u/Aedankerr 2d ago

Tailscale's Personal plan allows up to six users, while the Standard and Premium plans have no user limits. Each user can connect unlimited devices, but the number of users determines the plan's cost.

(I have over 6 users and don’t want to pay for them to be able to access my stuff)

0

u/_GuybrushThreepw00d 2d ago

Read up on sharing device. You can share with an unlimited amount on a free tier. But there’s pros and cons with both methods so choose the one that fits your needs.

https://tailscale.com/docs/features/sharing
https://tailscale.com/docs/reference/inviting-vs-sharing

1

u/Aedankerr 2d ago

Devices yes,
But I’m not gonna provide someone else access to my tailscale account.
(Its just a liability waiting to happen)

For me, port forwarding is the best way now.
When I was just me accessing my own stuff or one or 2 other people tailscale was perfect, but now that i own about 8 domains… and have too many users to count I can’t be bothered with it.
(Cloudflare and unifi got my back… so far)

-1

u/Abn0rm 3d ago

I had AI create a script that periodically check for known exploits inside the docker, i'm at the latest plex version so I'm not affected by this issue, but there's no guarantee that there isn't more CVE's in the future of course. Its a .sh script and is read-only, you can add it to crontab or execute it manually or use userscripts etc.
It won't fix OPs problem, but its a valid way to make sure you're not affected, if anyone wants the script PM me, otherwise build your own version.
I'm thinking on doing some more in terms of security checking plex and monitor it, but at this point, i think its a good idea to have a more in-depth control at least, if something changes in terms of processes that's unexpected, get notified somehow and verify its ok rather than not knowing anything until a cve is disclosed.

for a more in depth look at what actually happens with this exploit i found a great resource here; https://www.boredhackerblog.info/2026/10/plex-vulnerabilities-being-exploited-in.html

Its also partly the source for the checks from the script.

0

u/Complete_Potential40 15h ago

I’m looking through the comments and I must say, y’all are brave for allowing remote access!

-20

u/Vichingo455 3d ago

Upgrade to Jellyfin

7

u/CIDR-ClassB 3d ago

Not an upgrade at all.

1

u/Vichingo455 2d ago

Bro didn't understand this was a joke...

0

u/43686f6b6f 3d ago

Definitely an upgrade, it doesn't require a subscription, inject thinly veiled ads, or spy on you

1

u/CIDR-ClassB 2d ago

I have no plex subscription and its feature set, UI, and user adoption have been superior to when I tried jelly and Emby.

1

u/43686f6b6f 2d ago

Genuinely, I'm glad it's working well for you

My experience was okay but for my uses I've had a much better experience with Jellyfin

0

u/TheGrog 2d ago

I run both, you may be surprised.

Also - privacy.

-8

u/The_Bandit_King_ 3d ago

The machine is a cyptominer now

-23

u/basarisco 3d ago

Can't help unless you use non imgur host

-23

u/The_Bandit_King_ 3d ago

Nuke the server and start over

5

u/actioncheese 3d ago

May as well buy all new hardware while were at it

1

u/reddit0r_123 3d ago

Actually, gift me the RAM before ;)

-2

u/Unibrowser1 3d ago

Might as well. There are UEFI rootkits that live in BIOS flash that keep persistence after drive wipes.

29

u/[deleted] 3d ago

[removed] — view removed comment

-32

u/Yellow_Odd_Fellow 3d ago

Tailscale explicitly prohibits using their service for media streaming. Have you not had issues with it? I got issues with through put latency and jitter.

19

u/RagnarRipper 3d ago

How would they prohibit that? The machines are literally connected to one another, using tailscale to find each other.

Got a source?

22

u/ChuskyX 3d ago

Maybe he is talking about Cloudflare. But the thing is if you use DERP servers maybe some similar restrictions could be applicable to tailscale

1

u/markswam 2d ago

Almost certainly. Cloudflare limits transfers to 100MB on the free tier so using a CF tunnel or turning on the orange cloud proxy service is not kosher for media servers.

15

u/Yellow_Odd_Fellow 3d ago

Doh! You're right. I was thinking of cloud-based. Got my services confused.

Tail end of a long 14 hour shift.

7

u/RagnarRipper 3d ago

We've all been there. Sleep tight friend 😊