#koth
1 messages Β· Page 7 of 1
In a way, it's very difficult for you to "defuse" an invisible rootkit, it's not easy... there are anti rootkits but most of them don't work
gg @young bramble
I think you got the critics from my github post. The Thing is most people don't have enough time to build a working rootkit for every koth kernel and like @steep agate said it is pretty hard to remove them. It is possible to remove less sophisticated rootkits but there are hiding techniques where I doubt the "defuse" of matheuz would work. Without Rootkits it is more a "live" fight between players and not a fight against a rootkit that may take a few days or more
I guarantee that "defuse" works, you will see it in my zine when it is released haha, I will also write in the zine some not very common detection methods
It's interesting research, but of course, as there will always be a bypass for an EDR/XDR, there will be a means of detection, the same with the trick I'm going to put in the zine
Use rootkits against strong opponents, but I think against normal players I don't know if it's worth risking using more advanced techniques
π can't wait π
yeah i am also interested with what trick you came up with
so much so that this trick, in a test with @fossil pecan , I managed to defuse his updated lkm rootkit, so it's really worth playing against opponents like this, as it forces you to learn more things
hey, I'm not touching /root/koth binary in any way
yeah but your using a custom koth binary for king
Just that name of my custom binary is also koth since I'm "playing" koth π compiled from koth.c
bruh
See, its cheating if I do anything with /root/koth binary or port 9999 which, I've not.
If you wish then, I can share you source code to koth.c
nah i thought you took over port 9999 using another binary, cause /root/king.txt had my name
sorry anw gg
kk lol i trust you
oki then
it was fun though playing with you, normally i see 1 king change but this game was fun!
lemme know if ya wanna play more, i didn't use any of my good tricks, too lazy haha
nah, time for my lunch lol
Are there any Macintosh KOTH boxes?
Doubt it.
I imagine there's no appeal, but eh
You can't run MacOs on none Apple hardware.
Hrm, not even on a VM?
Nope, it's against Apples EULA.
I see. I know quite a few players dislike the windows boxes
Costly, mac instance types on AWS are provisioned at a minimum cost of 24 hours, enforced by Apple's OS license requirements. So even when a mac target machine would be used for less than an hour for a KotH game, it would incur the cost of 24 hours.
Hey out of wonder which window manager you use?
it seems pretty good ngl
bspwm
thanks, I really appreciate it
Gave +1 Rep to @obsidian lark (current: #616 - 6)
Playing my first koth, hop in if you want to join
Getting smoked lol, cant figure out how to properly set up for an upload vulnerability
I'll share you something after the game ends.
I would really appreciate that
xD
and naryal2580, spamming his koth binary and causes the machine to halt : /
bruh I'm not sure at all what's causing machine to halt plus I execute the binary only once
while true; do ./koth; done &
./koth & disown π¦
this time makes me wonder why didn't matheuz play π€
actually, doing this would simply throw a lot of error on my face.
I liked the way you created the folder though, made me learn new thing
loads directly to memory maybe
I've found user's binaries on other games but never on koth lol, I feel I'm the only one who runs being so exposed lol
I would like to know too
koth is great, until you start looking threw the box and find folks messing around with cr4p rendering the usability of the box.
no bueno
playing valorant haha
what?
Last game i played, the password to usernames were changed making initial foothold near impossible
There is always more than one way to get into the machine, don't just rely on credentials
4-5 ways depending on the box
And that doesn't make the game impossible lol
Correct, but the ports which were open would be good indicators for gaining access. From logging in to API access, vftp, or funky ports with nc
I didn't understand your point lol
what was the box?
because i can confirm that without creds u can get a foothold on the machine
but yeah consider that most players change user passwords once root
The box was hackers, ironically so
My understanding of rules was you can patch and such. But not make changes to application functionality or service changes
huh
Same but not yesterday lol
You're free bug pts I'm in lol
well I did hunt for flags instead of root
Immediately shutdowned my pc
someone attacking other users or just trolling?
nope he ain't attacking me it a legal thing
idk how it works
xD
lmao π
cat /dev/urandom > /dev/ptsX where X is the shell you are in
nyancat > /dev/ptsX
thanks ! mate
ssh user@ip -T
what's this one?
gg @north wolf and the others that i can't ping
@civic vortex u are not supposed to delete /lib buddy 
I didn't, why you think I did?
because before u got king i could use chattr
and after u got it i tried chattr and got this
so idk what u using but it seems that u deleted /lib
I only assume someone did something after looking at command logs
I got king and go played my game
nah this looks like someone loaded a usermode rootkit without building it on the machine
check /etc/ld.so.preload next time
(and the env var)
hmmmm okey idk about it
for reference read the notice in my kirito rk on github. I encountered the same problem
im reading this thanks
Gave +1 Rep to @jovial field (current: #700 - 5)
there is a solution by using an older glibc here https://github.com/0xleft/elf/blob/master/build.sh so you dont have to build it on machine
sure this also works
i would still recommend statically linking the rk
because else you may break other binaries loading the older version of glibc and the newer version
staticaly linking glibc? π
at the same time
i compile my binaries on a ubuntu 18.04 vm and works fine with all koth and btg boxes
nah either you build on the machine itself and use it's glibc
or you statically link it or you bring the glibc required with you
and sure you can compile on a similar machine and get lucky
Next time do something to fetch command logs before blindly blaming people 
glibc is backwards compatable you can use a very old and it will work on most machines
hey /tmp/mk0 is easy to find lol
what i mean is maybe the old glibc is setting some flag like abc=1 and the newer is using abc in another context or uses another value
it just isn't good practice
fair enough
just saying there is a way to avoid compiling on target and staticaly linking glibc
π
sure thing definetly worth trying
you compile your own chattr using --static?
This happens because you need to compile your binary statically, otherwise it will obviously give errors with lib and compatibility
nope i already have it on my machine and curl it on the koth
okey i didn't know about this
execute: file chattr
[
@violet zealot
If you compile something on your machine, most likely, especially on koth machines that are very old, it won't work, you always have to compile chattr, etc., statically in order for it to work
okey so i have to curl the c program and then compile it on koth machines?
you have to compile your binaries statically
thx i'll check that for next games
nice
im trying to get as much documentation to write my own script
btw ur demonizedshell is pretty cool, didn't try all features
thanks! There are still more features to add, I'm just a little lazy to update some things haha, even so, it's a good script to learn persistence and use them.
TBH, I would just google the error message, reporting someone for that stupid issue looks like a skid
Hey, please do not be rude :>
Sorry, he/she reported me for something I didn't do, and did not apologize like nothing happened. As a human being, I will get mad
Did they report you? It looks like they addressed it appropriately and was informed kindly that what you did wasn't against the rules.
I appreciate that you can get upset but it's important to treat everyone respectfully here.
If you did nothing wrong, then the report will be denied after our team reviews it :)
Sure, I will keep that in mind
Hi Terraminator, can you please send the link to your github?
his username on github is the same as discord π
you can also click on my profile there is also a link to my github
Thank you!
gg @verbal viper
any one online? been waiting in lobby for 1 hour
@steep agate afk ?
yeah
Hey correct if I'm wrong should I be posting this here or at #site-bugs
I'm not a part of this game and still able to see the machine's ip
i think someone just fucked up the game with rootkit abuse or whatever
i doubt it maybe technical issues?
idk we had a few bugs during this game, while the king file was empty but someone was still king...
maybe someone missed with /root/koth binary?
well we can't say for certain maybe it is just a technical issue
maybe he did something?
i think the box brokent
broken*
@violet zealot the port 80 is borken no? 
Ive had a handful of machines just have either some ports that should be open, closed or all ports closed when some should be open
this is a lion machine (koth). I did play it quite few times. and I do remember that port 80 was open. now it is either down. or blocked by a firewall(which is again the rules in both ways).
Actually speaking of is chmodding the king.txt against the rules? People keep doing it but its not technically in the rules
u talking abt chattr binary?
Idk what chattr is
it allows you to block anyone from editing a file
even root
or admins
So just kill chattr should fix?
haha no
u need to unlock the file first
then you can remove the binary
Gave 1 Rep to m4lisio (current: #1024 - 3)
@violet zealot
once playing koth, they did this redirect traffic (which is certainly against the rules), it could have been the same thing that happened to you in that game
.
this is a known bug in koth
never encountered some dirty player like that xD
Damn 
This issue arises intermittently due to heavy traffic on /root/king.txt. This traffic overload can happen when loops that write or manipulate /root/king.txt run without a condition or a sleep. As a result, conflicts may arise over the rightful king.
If anyone's got issue with koth game, write it down here. I don't personally like to cry the moment someone does something horrible while playing I've just ignored it (except for the first time).
It helps us find the person really behind mischief than someone else being accused.
Please make sure you are reporting rule breakers to support@tryhackme.com
or the chat thingy on the bottom right, thank you for pointing where ro report.
Gave +1 Rep to @short tusk (current: #6 - 1219)
How is Matheuz locking the root.txt I can't modify it even if I have root perms
bash: king.txt: Permission denied
Prolly he's using chattr
How to counter this ?
the immutability bit from chattr most likely
How can I get my name in king.txt with the chattr activated ?
One of the attributes it can set is called the "immutable bit." When the immutable bit is set on a file, it prevents anyone, even the root user, from modifying or deleting that file.
So I can't put my name ?
First check if chattr is present in the system which chattr, then run chattr -i /root/king.txt; echo "younick" > /root/king.txt to remove immutable bit
If chattr is not in the system, upload your own to the box
Didn't wotk
work
Matheuz name is still in king.txt
Even after I removed the immutable bit
what was the error message
oh it's prolly a rootkit then
And how to counter this ?
Haha, check out dmesg! Mathuez is quite the clever cookie; he won't let his rootkit show up that easily!
type yeah
cat: /etc/ld.so.preload: No such file or directory
@obsidian lark
hmm, it hides from lsmod as well
So what should I do ?
So there's almost nothing you can do, other than enumeration within the box. Mathuez is good with kernel stuff, he's rks are almost unbeatable. But, you can still try, there are some places on the system where rootkit's data is visible ig. Tools like strace and ltrace can also help. Good Luck!
guys what can it be ?
prolly a loop
you gotta find the loop's pid and kill it or you can remove the binaries (only ones that are uploaded) the loop is using
but removing the binaries wont stop the process
letβs say the loop is using chattr, if we delete the chattr binary. The loop will produce a bunch of errors, breaking the whole process. (This is what iβve seen, im pretty sure it works)
I don't know, it would probably be wiser to hide the binary somewhere because you would have to rebuild chattr, or upload a statically compiled binary in the future. Someone else will just find a way to set (and remove,) the immutable bit, and you would most likely require chattr to remove it again.
Yeah hiding chattr, is a good way to persist king. If ppl have no idea where you lock /root/king.txt, then king is yours (most probably)
i mean sure if you loop is referencing an external binary like chattr and you remove it this will break the loop
but lets say you have a binary witch sets the attributes via iocl linux doesnt care a bit if the binary still exists. The process will still do its thing
good point. This also shouldn't be overlooked. Additionally, some could just run 'find / -name chattr 2>/dev/null' and it would work, assuming you haven't renamed your chattr binary.
haha! Great point
Rookie mistake there.
Wdym?
Not renaming chattr if you are hiding it.
chattr can be find using itβs size (bytes) if itβs the original busybox binary.
the are more ways to hide like changing timestamps
Oh, I didn't know about that method.
I use a custom ioctl binary as Terraminator mentioned
plus using a static bash will hide (bash scripts) from pspy/snoopy
I'll try these out in my next koth game.
Maybe creating our own loop that runs faster than the other player. Their command might log onto Snoopy, but if we can find a way to make our loop quicker, we'll have the upper hand.
thanks pall! did help me win a game.
Gave +1 Rep to @obsidian lark (current: #562 - 7)
some people just don't know how to lose a game
wym?
you found massco on a game? lmao
he stops services, moves/removes koth binary, and on top of all uses iptables to configure the firewall to not let other ips access the box
look at his terminal
damn what a weirdo
i just see a closed session so he could have just killed his shell
If there is someone breaking the rules in koth you can report it to support@tryhackme with the session id
ikr most players have reported him but still he's there lol
yeah @steep agate is cheating too but still here
Hey! I've reported quite a few times with evidence. However, still no response from THM
(im joking plz dont hit me)
nah mathuez is goated
damn that was fast...
in linux, poweroff does one single thing: Shutdown. And this is mentioned in the first rule of the game. Of course if you know how to read. It's not the first time we see Massco failing to obey the rules. I'm not mad at him, I was waiting for him to spawn reset, reboot, shutdown, flood the terminals or kill shells... but I was disappointed to see the methods he used after initial foothold, lack of fair-play and sometime lack of basic knowledge. For example you don't upload pwnkit if pkexec is not suid anymore. Just a waste of time
upload pwnkit and use your own hidden suid bit polkit/pkexec
Hmm, that works too. I didn't think about that.
suids are found easily I've recently found that giving capabilities to a binary can be a better method to have a hidden backdoor that is not suid but gives you root instantly
true
but capabilites are also easy to find if the person knows what they are looking for
Using find is going to find the suid bit on your hidden binary anyways, huh?
how many search for that ?
shadow generally does nowadays
some few ctfs on tryhackme use caps
Hackers machine on KotH has also a cap_setuid on python3.6 . This is where I got the idea of making my own password protected shell with setuid capability
who's a1mr?
he constantly logged me out from shell
im not saying hes cheating, just wondering what he did
i had to spam my commands again and again π«
never typed that fast on a keyboard
spacejam has a dangerours initial foothold as root on port 3000. he can kill all your shells from there if you don't patch it
he probably went 'netstat -anp | grep ESTABLISHED' and did 'kill -9 YOURSHELLPID'
yeah i didn't patch cuz i had like 5sec shell every time
when players don't know too many ways to protect king.txt, they are busy with other users's shells. This is a lack of fair-play
i just had to spam ssh root@ip > echo "mk0x" > king.txt
kicking my shell but didn't protect king file at all
5 seconds are more than enough to kill his sessions too. if you know how to spot them and extract their pids (even of hidden ones). or if you are using a webshell, you can even pkill bash;pkill sh
yup i knew what his pid session was but didn't have enough time so i gave priority on keeping king.txt than kicking his shell
You won, but I guess you did learn something from this. and next time you can be more prepared. In the end, it's not that important to win, but to learn and have more tools ready
I did once killed one user's shells because he sent /dev/urandom on all my terminals. And the one-liner script I wrote to kill all his shells every 5 or 10 seconds was something for the moment. But If paranoya hits you, or the user is so bad and toxic, you can easily change it to kill shells ever 1 second
yeah but i don't really want to add shell kicking to my script, cuz if nobody can log to the machine what's the point of playing koth ? π«
exactly. This is only for those players that just don't understand the rules or the fun of playing the game. Having the one-liner ready doesn't mean you should use it in every game. And BTW you need to adapt to what binaries you have available on each machine (netstat, ss,lsof, etc.)
lol would just have done something like cp /usr/bin/bash /tmp/jehsjyjcikmd && /tmp/jehsjyjcikmd
Yup i do the same
why?
because he propably is just spamming something like pkill sh and this won't hit me like this
and as soon as I have a few seconds I would try to either create persistence by pulling my persistence script or i would try to find and kill his sessions
am i not supposed to be asked a passphrase?
someone deleted public keys
i dont think so because the guy with me don't have any access
bad perms then?
Maybe adding this could work in the future
-oHostKeyAlgorithms=+ssh-rsa
why?
AFAIK, sometimes for older SSH's you need to specify type of key encryption. Default one could be something else than ssh-rsa (like some aes or hmac). I've seen it once or twice even in tryhackme boxes
Depends on whether the SSH Daemon has been configured to allow password auth
Oh, wait, you did specify a key. Missed that. Ignore me lmao
Oh, actually, this could still be the case.
Disabling password auth and rotating the keys so you're using an invalid one would give you an output like that.
ooooh okey maybe that's it
i'll try next time thx
hackers machine is regenerating the ssh key and credentials every time it spawns. You cannot have initial aceces with a saved ssh key for user gcrawford because it is different. You have to login in another way, get the encrypted key /home/gcrawford/.ssh/id_rsa ... then crack the passphrase for the key (ssh2john & john+rockyou) and after that you can use ssh -i id_rsa gcrawford@hackers with the cracked passphrase
The fastest way to pwn is through /backdoor in the web server. A custom fuzzer or ffuf will find the password way faster than hydra.
That's what im doing now, but honestly i find hydra pretty quick on this one
nah just try ffuf with more threads you get pwd in like 3-5 mins max
Hi there. Is it in terms of hardening correct to change found weak credentials on an service? Or is this prohibited?
Yeah it's correct. That's actually one of the most popular hardening technique here
@coral bloom How did you protect that king file xD didn't find any shell script or crontab.
Maybe there was something going on with chattr?
@north wolf GG
i don't understand how to root carnage
i thought i had the privesc but nothing works
gtfo find (shell)
depends on the user you have creds for.
For exemple find have the suid bit but only the user booba can use it
vim.tiny have the Suid bit also but only yooda can abuse it.
and lastely for the user Duku can use /usr/bin/netnetkit-ftp
I was doing the po koth and was bruting the pass for po but wasnβt working. It was fine bc I used hydra instead but can someone explain why it didnβt work
https
how?
how what?
https?
sorry im not getting it. It's https and not http
lol never seen a box have ssl in thm
@blissful swallow
@fair adderProblem with url i guess?
try adding --disable-tls-checks
and look
or try with the domain instead of ip
okay, will try all that next time i do panda koth
what arch dis do u use
(i see the arch logo thro the image u sent
also i like ur profile pic 
hahahaha that is kali with bsmw and i3. I dont got time to rice arch for pentesting
me too, (Elliot goated)
yeah my bad i did it wrong
@violet zealot /boot/koth.sh π€£
?
i only have 1 script and it's not that one
you sure about that?
then what's check and guardian lmao
pretty sure yeah
oh i see
but it's not mine
just let them in my script but i just curl them
mounting and unmounting can cause it the machine to break and lag
you want proof?
but yeah im just doing some test with my script, that's why when it broke i let u on the game
/bin/bash ./check mk0x
oh but that's what i said
/bin/bash ./guardian 10.8.15.228
@short tusk should be able to clearify but would think it is against the rules too
idk because many people change binaries permissions so i guess it's okey
before doing it too i got in a few games where i couldn't curl anything because of that
Just because people do it doesnβt mean itβs okay ahha
anyway if it's against the rules i'll change my script, i don't really care
absolutely
but when i see some of the remaining players (even top players) playing against the said rules and keep staying here im a lil confused
but yeah if u tell me to change it then np i'll change it
I'm okey with since just a simple command could solve it.
But idk if others are okey with
- every player from time to time break rules even if intentionally or not
@sharp siren why i couldn't kill ur shell?
I paided thm to not let anyone kill shell
xD
?
I just got ghost pinged, may I know why?
my bad
meow.sh doesn't sound familiar?
yeah?
he was referring to your script xD
how to break someone symlink on king file?
do we have to find the linked file or do we have another method?
unlink <path-to-symlink>
this blog can help too https://www.freecodecamp.org/news/symlink-tutorial-in-linux-how-to-create-and-remove-a-symbolic-link/
π€
echo -e "meow\nmeow" | passwd root
irony is that I found it here, a game without mk0
probably skoll he's a friend and i gave him my script (not the same one now but an older version)
@near lily
generally you can list symlinks with commands
cool, now I too have it.
gg
hehe
gl hf
u too π
anyone wanna join in
here's another one if you want https://tryhackme.com/games/koth/join/dda193be2662925a23f50f50
yea, whats the link
i was afk
who's killing my shells?
good game @sharp siren
GG
Do You Passively Farm Points If You Join Late or What's Happening With Scoring System? (Given That Noone Has Flag)
usually the last person to join the game will win if there is a tie
Isnt That Rigged? D:
it can be abused .... π€£ or dont go for ties. Usually when players are battling for king theres rarely a tie unless its intentional
but say no one got king or flags then last person to join wins..
idc lmao it's an old version
and honestly i don't hide that well my script, some people here may have it and it's okey
he thought he can escape matrix.


Every Flag Is Fixed For Every Challenge? I Played KoTH Food CTF As A Box And Now I Just Pwned The Flags D:
Also What's Up With Port 9999?
Port 9999 is the KoTH service π€£
Yes most boxes are the same as the previous time you played them, there's a few that change ports and credentials tho.. take good notes on the boxes you play and It will help you save time next time you play it
o7
anyone have an issue with symlink?
in previous matches i had this issue where i get an error saying the file /root/king.txt already exist
when i first implemented this technique to my script it was working but seems now it doesn't, even if i try it manually
probably reduced privileges.
maybe but it's not supposed to be the case
i did this box a couple of times now and always could use sudo on tha one
You do realise that you're meant to patch the box when you get in, right? 
That includes removing dangerous sudoers entries.
i.e., just because it let you do it last time, doesn't mean someone hasn't patched that vuln this time
yes?
I dont know any php so decided to remove it to push you to explore others ways to get a foothold
?
lol, you delete all web pages on the machine, just because "you dont know what is php"?
No I dont know how to patch it
anyway, this is against rules in public games
is it against rules? dont seem to find any thin
??
in rules
wtf
If you don't know how to fix a path to root, will you remove all users or everything on the machine?
no
the service is still up.
didn't stop the service
idk what I did against rules.
If i did somethign wrong sorry
but still not accessible for other users
I apologize
i didn't use iptables or smthign that blocks users accessiblity
the port that runs the web page is still active, but is not accessible to other users because there is simply no longer a point of entry into the web
is it against rules to delete web pages?
i see thnks not going to happend next time.
thanks for poiting it out
Gave +1 Rep to @steep agate (current: #148 - 47)
This is not directly in the rules, but clearly if you delete the web page, it will disrupt other players, making it inaccessible/unavailable, and this is against rules
I see i see
nobody got in so i excluded this case
@sharp siren if u don't know anything about php it's okey, u can find patched versions on wu
haha. Did figure out how to prevent rce in that machine, but thanks
I mean, these machines deploy from golden images. They ain't gonna change between sessions (autogens aside -- and only one or two have those) unless someone breaks in and changes them.
So either someone broke in before you, patched it, and hid their session, or someone opened up an extra vuln the last time you had the machine.
I would say the first option is significantly more likely, but...
is this against rules since changing Permissions on flags in against rules?
machine:Panda
yes.
wtf is happening, i get disconnected every time i do this command
and it happens everytime on this machine
and the food machine is broken, it's been like 15mins im waiting
yeah, me too. I guess someone was enumerating too hard, but after reset everything was ok.
i left the game at this point lmao
anyone has an idea about this issue?
this is definitely broken...
Are you trying to escalate to root?
I think root would need to run that systemctl to actually have proper suid bit set on /tmp/bash... Not π― sure tho since you are making a copy of bash. Have you tried running the systemctl command already? Did it add suid bit to /tmp/bash?
If so try /tmp/bash -p
how am i supposed to run it?
./systemctl
because i never had this error before, i just had to change the path and get root
does the restartserser binary restart the server?
idk about this, because it juste kick me out every time
it just connect me to serv2 as expected
Then do ls -la /tmp/bash what are the permissions
So then root needs to run this first ... Check cronjobs
By changing the path I'm not sure if you would be able to start any other services using that systemctl .... I see what you are trying to do tho... But you will also need to make sure root is going to be starting or stopping services..
???
What about if you run find / -perm -4000 2>/dev/null are there any other easy wins since someone else is already root
what is this sorcery
Or even getcap -r / to check capabilities
but what about this?
already did that
/tmp/bash -p
Yea but you are calling /bin/bash still
This happens because you are calling bash, which is in /bin, and not the one in /tmp
bruh
π€·ββοΈ
naaaaa π«
I've played against players who did loops to remove the king, lol
i can't connect to my session
i get kicked out
bruh ok...
never thought about that
bruh, killing sessions or removing all binaries when you can't king is the skiddie thing I've ever seen in koth 
i guess someone wants to be alone on the machine π«
@violet zealot soon I'm going to release something I made
@severe hazel i see u π
me too
send link for this game haha
join or spectate?
join
lmao haha @severe hazel
Man. I got ssh into fortune but I couldnβt exploit the pico SUID for some reason.
maybe someone removed u from sudoers
Was suid bit still set?
Yeah was still set. Nah donβt think anyone got in yet
I could... can you get that machine when its not KoTH
yeah i got Fortuna's password
yeah ok, never played with the rootpass before.. how does that one work?
Yeah did try sudo Pico but it didnt work
Is there any way to speed up the hydra scan? (KoTH Hackers) taking a very long time aha ||hydra -l gcrawford -P /usr/share/wordlists/rockyou.txt 10.10.228.111 ftp||
I was in the same room, I could've easily won but I thought the usernames were for http πππ
Anyone up for a private room
yup
Alr I'll make one and send u the link
@severe hazel bruh I'm trying to get rce and connection times out
Lmfao I had 2 ways to get rce and it can't reach back
Idk why
:8002
Doesn't it work on 8000
In the admin panel
It runs code it just can't reach my machine
idk, use 8002
nop,
Ah
and load reverse shell php
Now my VPN tweaking
Hahaah
Worlds against me
Oh it's my internet connection
It times out
Fuck bruh
I was so hyped
Ggs, that's all I can do without a proper rev shell
hello, today I'm playing Koth, after successfully becoming king (for the first time), another player first removed me then I joined again and I got a message from him on my ssh command line saying "You again, bye" and removed again, then changed the password for ssh... Anybody know how he did this??
It's actually easy, there are a few ways, one of them is when you are in normal SSH, without logging in without TTY, a person can redirect a command or message to your PTY: echo test > /dev/pts/1 for example
Here are some techniques that I put together for koth, this will help you a lot against players who already play or have played koth before
oh wow, thank you......
Gave +1 Rep to @steep agate (current: #139 - 49)
one more thing, if someone continuously removes you and also changes ssh password how do you get root back..?
using and creating persistence/backdoor on the machine
you can create your own script to create your persistence/backdoor on the machine
It is persistent, however, it is easy to find and remove
oh ok thanks again...
I have a tool that maybe can help you create ideas for your own persistence script: https://github.com/MatheuZSecurity/D3m0n1z3dShell
If you want to simulate this kind of player you can also check out this room to practice https://tryhackme.com/r/room/redisl33t .
Thanks
Gave +1 Rep to @broken pilot (current: #114 - 56)
Looks awesome. Can't wait to try it tomorrow
Can't give that much (max 1)
Woops
Gave 1 Rep to trapnatized (current: #112 - 57)
@fossil pecan @bitter tree good job guys
ya it's a good game, well played! π
I messed up so many times
Did you send the messages with wall
Thanks :) well played
How did you send these messages, I wanna knoe
OH
lemme gueds
Dev/tty
If you were on a pts could be with wall 'message' or could be echo 'message' > /dev/pts/#
- figlet for big font π
This was my first koth win, can yall tell me if this strategy is good: after getting root, create a user and chown the flag to the user
Tried to do it but there was no point plus my python pty was tweaking
don't edit/alter flags or perms on them (designed to be found at those levels of access)
but king.txt can be edited as you want
I see
I saw @steep agate talking about catching write syscalls with kernel modules. Super interesting
Also, can we stop services?
Except the 9999
no
Depends on which services ....
Ex. Apache2
main rule is "machine continues as designed" ... so except for patching vulns, or removing other players shells/scripts - keep everything as is and functional (allowed to remove chattr binary only)
If I create a new service for persistence, I think that would be fair game.. but services like apache2 I don't think you should stop em... Just get good at taking king and can leave the box wide open for everyone π
Ah okay
if another player adds a service for themselves as rev/web shell or something then you can (as patching them out) ... but anything "built into" the box should be kept alive (can be restarted if needed)
I'm sorry it was like my first game which I managed to get root
Yeah, you can stop @broken pilot hooking symlink syscalls (Oh you see what you do to her hahah this is interesting ) and F11snipe LKM for protect king. Then I will leave a code available to remove it from the machine and also make it unusable
hehe
this is super interesting
The room was space jam, so I don't think apache mattered too much
There could've been some xss in the contact form though
Do there's that
Can you stop em all tho π
You cannot stop any service on the machine (this also includes not removing binaries, not removing web pages, etc.)
Yep most definitely broke the last one
u can patch the rce
I'm sorry yall wont happen again
I'm still waiting to try out the new technique and see if I can bypass
np u are starting
I was too stressed out I couldn't think about that
One of them you can do, but the other you can't haha
some people here knows the rules but.... π
Turns out my win wasn't a win after all
I just fd the game up π€£
It's a part of learning
I personally stopped playing koth lol, if anyone has any questions about protecting king, or anything like that in koth, my dm will be free
talking about symlink, since 2 weeks ago (or smthg like that) i couldn't symlink king.txt at all
any idea?
Oh yeah about that, I tried fuser to see which pid ran it but it respawned after I killed it. Which script did that? Or I'd it a cronjob
rm king.txt; echo test > ... ; ln -s ... king.txt like this?
Some players play dirty and rm -rf / when they can't take king.... But can always plan for that and still keep the game alive
yup something like that
What kind of kamikaze tactic is thst lmfso
i just edited the one on ur github
I got a better one now π
What I mean is that there is a way to create an LKM that can prevent any symbolic links in the king.txt file for example
Therefore koth becomes more of a speed challenge
Defending koth, mb
Yea but u also need to plan for everything when doing this, because I can break the logic if I enumerate your lkm long enough
Is there enough time for that
yup but now everyone knows the machines, how to get in etc but im just waiting for the day when thm will (potentially) add new box
Always
Mhm interesting
In fact, using LKM for any protection in itself is something very strong haha
Yeah
and u are only 2 to use it so...
im learning kernel and tbh it's less difficult than i thought
doing some secmalloc in school too
You can't haha, my other LKM didn't have many cool features (I was too lazy to put a version of Koth's kernel for each VM, compile, change functions, etc.) It just simple version of my lkm
Any resources? I wanna stsrt learning too
matheuz gave me this one for learning kernel -> https://xcellerator.github.io/tags/rootkit/
I'll only play koth again when that happens one day haha
Well I want to go up against it ....
Catching syscalls sounds fascinating and I don't have any idea on how thsts done
But I wanna learn
sudo sysctl -w kernel.modules_disabled=1 , but that doesn't do much good, I'll give you an example, if someone loads any LKM or Rootkit before you run this command it won't work
but now im trying to understand the issue with my symlink, maybe @broken pilot could tell me more in dm? π
Yeah it won't
Also noob linux question, can you "log out a session" if you kill their shell process
I tried it in the box idk if it work
Sure shoot.
@fossil pecan verify
yep but they can connect back
π€£
Yeah fs
SyS_symlink / SyS_symlinkat you know it @fossil pecan hehe
oooh π
What if there's a cron job doing thst though. Like killing all bash instances and you run on a sh shell
with linux you can make all thinks haha, even spawn powershell.exe π
ππ€©
I mean I figured it should work but I haven't appreciated how straightforward linux is if you understand it
never do that, it's not against the rules though but imo it's just unfair
u are gonna be alone on the machine, so not much interest
Yea but won't hooking that break all symlinks...
Yeah I'm just asking if it would work
That's super unfair and I can't learn anything if I use it
Yea that's a valid tactic... Can easily be stopped tho
but yeah in fact u can write a script that kill all sessions every 5 sec
Just switching the shell π
Yup
Whats usually your approach for defending king, like your goto
Besides patching vulns, I mean the file itself
Me?
(Yes matheuz I've read your repo)
playing with chattr and other perms
Ah interesting
π€£
if you say so haha, but there is a way to protect king
with symlink, rename, read, etc
Normally I won't patch anything,,, I will make the box more vulnerable cuz I like the challenge of fighting for king .. my techniques are usually based on the opponents skill... So I might start off with chattr. If u unlock I'll move to next tactic... If you are writing rootkits to take king, I'm looking for flaws or things you didn't expect
Prerequisite: know your shit
It will come with time,,, you will start to know how certain players play and can adjust accordingly..
I first need to understand linux better
I have a beginner to intermediate understanding
A simple little trick that can help is to see the directories of all processes, for example the process of the other player using bash is 1337, so you can check the directory it is in: ls -la /proc/1337/cwd
or view all proc dir
ls -la /proc/*/cwd
Why 1337
I already got several scripts from @broken pilot like this haha
just example haha
Lol least you didn't do it like someone else .... @steep agate
ah cool haxor
and others players
I can't read lmfao sorry
My brain bugged
btw, when you upload a file to the machine, don't leave your files in any folder haha, delete them immediately
I'll keep that in mind
like this
It's not very difficult, I recommend you read the source code, understand and fix it
Alright when I stumble upon spacejam again I'll try
I couldn't find where the source was located tho
Do I check/proc/pid?
π€£ yea but those are mostly just static binaries and some trolls I bring to the box, nothing to important... Although u did manage to get my persistence script π
you can try next time using the trick I sent up there haha
Alr
π
Need to update my scripts anyways... Going to make em interactive so I can change stuff up on the fly
I wrote those when I first started koth π€£
Kinda like the last script you got from me π
that's me π
oh haha i have your "cat".sh π€£
i was thinking about this too
but yeah some people have it, but nothing wrong cuz 1 - i dont care and 2 - im changing it frequently
@steep agate i saw u
yeah, this make sense
If you ever want to practice dm me I'll jump in a private game and teach a few things I've learned
this time when lockbit was giving 5k$ to anyone getting a tattoo of their logo
open to it too
some people got lockbit tattoos π€£
yeeeaaah
and the leader once offered a big amount to anyone who can find his name
yeah
Playing koth has helped me learn a lot of new things.. I just jumped in not knowing much and lost alot, but I didn't quit so I just kept coming back until I could win, then just started working on sneaky techniques and improving my persistence..
tbh playing koth is really helping me in understanding linux, because u are up to use some commands that u dont need to use every day
Hahaha yea just read today that they know who he is and is offering same reward for any information on his whereabouts.... So do the police get the money now π€£π€£π€£π€£
Do you have a subscription to THM? If so you can create a private game to any machine you want to practice on and I can see what you know for protecting king and go from there
Yea I sent u a dm
other tool with help you a lot of is snoopy
command logger
Oooo I saw u were watching a game with f11 π€£
u can upload it on koth?
π€£
yeah, you can use it in koth too
Yea
i'll try it thx
There are a lot of cool tricks that you can use in Koth
yeah that's why im taking my time to learn all that
i was just recently focusing on my certifications
I'm going to do the vulnlab AD labs, to try CRTO later
I found this useful
$ file /proc/*/cwd
Yes, as I mentioned above, it is interesting to use this in koth
tbh, I got to know about it from the above chat, But it was fun deleting .m and .t directories on random places on the server lol. Wherever/whatever opponent lands their payload its not gonna be there on drive after a while!
haha nice, I have other really cool tricks too, for using koth
It'd be great if shared here, making it more fun!
I lost my last match but it was fun, because it was!
am I the only one who actually likes being defeated on koth? π
Wouldn't it be cool if I shared all my tricks π
that'd be my dream come true for real π
staff? i have a question. I'm playing a room called hogwarts, in king of the hill. There are only 2 ports, 22 and 9999. 22 port is open, but when i try to connect it says "connection closed by server"
How have you been connecting to it?
It's possible somebody has messed with the service
Nah, I think I know what the issue is.
I just need confirmation.
?
I recommend you use rustscan in hogwars machine, or use nmap with -p-
Would they not already have, if they got port 9999?
second
How are you connecting to port 22?
ssh ip
Is it an SSH service
yes, 22
wdym
someone may have closed all the services too
it's been 1 second
Just because port 22 is default for SSH, it might not be SSH running.
try to use rustscan
What does nmap say?
thanks to @stiff egret for that
Gave +1 Rep to @near lily (current: #1 - 2243)
Isn't that just standard practice for CTF's?
rustscan is so much faster than nmap, using nmap at hogwarts sometimes cannot identify all ports
yeah i just wanted to ping him
do you need ports?
But that's it, either you didn't scan correctly with nmap, or someone closed the machine's services
No, just service 22.
ssh
Let's see a screenshot, lol
btw, on hogwarts machine, you cannot join in ssh on 22 port
yuh
how then
there are only 2 ports
22 and 9999
As I said, try using nmap with more threads and on all ports, or use rustscan (which is much faster than nmap, and helps on the Hogwarts machine)
Well what do you know, lol.
nmap -p- -T4 hogwarts.thm
hogwarts.thm ?
just put ip instead of that
what does that do
It's easier to use rustscan, it will identify the ports in a matter of seconds lol
it'll scan ports ranging from 0 - 65535
yeah
is it an ad ?)
i think refas is new to this
i am
They are.
they?
nwm
its alr, rustscan is must faster than nmap and good for ctf purposes
ok
I'm trying to help you, if you don't want help I can't do anything π€·ββοΈ
that's all matheuz tryna tell u refas
yeah lol
what's the difference between nmap and rustscan?
If the player chooses to use nmap at Hogwarts, it will take a long time, and he will lose the advantage
*only for CTF's IMO.
.
rustscan is so much faster than nmap, it identifies the ports in a matter of seconds because it is faster, uses more threads, etc, but it only uses this in CTF, because it makes a lot of noise π
thx
@steep agate uses RustScan?
waoh waoh
what we got in here?!!
in CTF, yes
π€
is it a kali linux tool or a github?
HAHAHAHAHA
Use NimScan Bro..
π€
thx
Gave +1 Rep to @radiant sun (current: #390 - 12)


nah, im not studying another tool...

Tool? it's just a Tool bro.
oh yeah, I saw this project on github, but I never got to test it
study 
don't do it. 
gg @broken pilot
GG. I'll be ready for the next one π
anyone have any tips on learning how to solve King of the Hill challenges on THM?
I have repo about KoTH with tricks for defense king and patch machine
this might be useful for you
appreciate it π
Anyone wanna do some Koth while calling?
im down
Sure!
starts in 15 mins https://tryhackme.com/games/koth/join/6a557ef4869ccc84bdea02d8
Would you like a game?
Sure man, @obsidian lark you also down?
8 mins ^^ public game
present
@broken pilotCan I get link for this game?
https://tryhackme.com/games/koth/98405
^^^^
join link
ty β€οΈ
nobody is using LKM rootkit in this game lol, and someone just tried disabling LKM rootkit lolz
I did part of my script lol
cool!
GG
man the while loops are battling.
Last machine crashed cz of it
yeah, these are fireing like anythnig π
lol yea thats wild's loop
yea it was easy to break his loop just remove /tmp/.c/chatr
why use busybox's chattr while you can chattr via your custom bin? 
lmao
yea or a python script ... i have a few different ways to set/remove immutable bit..
exactly! that's my point.
is that snoopy?
ty
Gave +1 Rep to @broken pilot (current: #109 - 59)
pspy64
i kept killing every bodies pspy64... there was a few ppl watching processes
ofc me I'd copied it to /usr/bin π
I was busy watching ya'll π
did you get the nyancat at the end lol
nope, most probably its this; I didn't have a pty/pts idk tf's that
lmao its still running like anything π
lol yea i wasnt on pts so probably came through funny.... i have a game also but i need to figure out a way to let the ppl i send it too control the movements....
or make them trigger it themselves...
actually this isn't too hard I think
either you go with https://github.com/hxlxmjxbbxs/pwntty and execute your binary for the user (only works if the user got a pts)
or you just go and inject your game as a shellcode into a running process
this is a bit trickier
See also Weaponized shared library injection Shellcode injection 101 Emp3r0r Dynamic Linker/Loader - Make an ELF load specific libraries Intro Strictly speaking, this is not the process injection you are expecting. Abusing ld.so can help you get your shared object (library) loaded in future processes the ELF file might β¦
I would recommend trying to use ptrace
π
injected init process
yeah not that hard to do actually
I used that for a while to hide my main process
or you can spawn powershell too π
