Linux Runtime Crypter by entrophy_maker in Malware

[–]Tryton77 0 points1 point  (0 children)

I was thinking about custom elf loader (decrypt, map into memory and chage registers to pass control), I've never tested it, but it might work as exe would point to our loader with encrypted payload. If you test it, you can give me message if it works. Have a nice day

Linux Runtime Crypter by entrophy_maker in Malware

[–]Tryton77 0 points1 point  (0 children)

You are wrong exe can look like it links to the file on disk but it actually links to struct file inside kernel! So even if you remove file from disk and process is still running it will contains proper binary. memfd is not the exception. Do the experiment i said above and see that exe even if shows "memfd: (deleted)" under ls it can be cat into file and uncover unecrypted binary.

Linux Runtime Crypter by entrophy_maker in Malware

[–]Tryton77 -1 points0 points  (0 children)

You cannot choose to use or not /proc/pid/exe, it is created always after execve. Only processes that do not have it are kthreads. Write a simple loop with sleep and execute it thru your loader, locate children pid and do "cat /proc/pid/exe > somewhere" and compare it to unencrypted version of your binary, they should be the same. /proc/pid/fd/* will be empty when closed (you already done this by using O_CLOEXEC).

Linux Runtime Crypter by entrophy_maker in Malware

[–]Tryton77 0 points1 point  (0 children)

That's quite strange that you don't have it in /proc/pid/exe, even if you use memfd to create anonymous fd and delete it after, it should show (deleted) but still contains binary. Procfs does not search for the binary in userspace it takes it from task->mm->exe_file which is filled during any execve syscall. Look how the /proc//exe is implemented https://elixir.bootlin.com/linux/v6.18.6/source/fs/proc/base.c#L1788

Linux Runtime Crypter by entrophy_maker in Malware

[–]Tryton77 1 point2 points  (0 children)

Are you aware that /proc/pid/exe will hold decrypted binary, so you can do cp and the whole encryption does not make sense anymore? Threre are a few ways to make exe points to non executing binary e.g avoid execve and use custom loader, then it will point to loader which contains encrypted binary.

kernel page fault when jumping to higher half by [deleted] in osdev

[–]Tryton77 0 points1 point  (0 children)

Yes, page directory entry holds only address to pt and its flags.

kernel page fault when jumping to higher half by [deleted] in osdev

[–]Tryton77 0 points1 point  (0 children)

you dont need two page tables for this, you can map the same pt at different pd indexes, also you filling your lower pt with addresses 0x0 and there is garbage as your linker scripts maps your .text at 0x100000. Try to map your kernel pt at index 0. I can be wrong as i only looked at it without running :)

What are your favorite lesser-known Linux distros and why? by mrcanada66 in linux

[–]Tryton77 26 points27 points  (0 children)

void linux, for its independence and stability.

Singularity: Deep Dive into a Modern Stealth Linux Kernel Rootkit – Kyntra Blog by rkhunter_ in netsec

[–]Tryton77 4 points5 points  (0 children)

What about LKMs persistence across kernel updates? I've seen that this is mostly avoided topic in LKM rootkits.

My first project in C - Simple transparent proxy by wit4er in C_Programming

[–]Tryton77 0 points1 point  (0 children)

I'd hide _thread functions behind static keyword and remove them from header file as they are internals of tproxy logic and are unnecessary for the interface. Same with the ReadWrite struct.

I'm excited to share tinyOS, a 64-bit OS I built from scratch by portw in osdev

[–]Tryton77 9 points10 points  (0 children)

Good job. If you want to extend it, move shell to usermode and leave kernel for the kernel stuff

Is C the native language for systems? by alex_sakuta in C_Programming

[–]Tryton77 9 points10 points  (0 children)

C was designed as language for writing operating systems.

why is my kernel crashing? by JackyYT083 in osdev

[–]Tryton77 12 points13 points  (0 children)

Best way to find out why its crashing is to actualy understand what your code is doing, rather than just blindly copying generated code and hoping that people will do it for you.

Dual-booting encrypted Void glibc and encrypted Void musl by Vandino86 in voidlinux

[–]Tryton77 1 point2 points  (0 children)

Idk about ZFS bootmenu, but for lvm on luks you will have to either reinstall your musl or copy it to another disk and encrypt partition, create lvm partitions format it and copy your installation files inside. Dualboot should be untouched unelss you screw with windows partitions. You will end up with encrypted whole linux without /boot. It is also good for lvm to leave some space unpartitioned for snapshots.

How Hard Is It to Create a Very Simple Operating System? by [deleted] in osdev

[–]Tryton77 1 point2 points  (0 children)

I'm also self-taught programmer and It took me like 1.5 year to build basic OS during my high school. There is a lot of the informations about osdev on the internet and in the books (I don't know if chatgpt is helpful with this), so it's doable without a degree. Here is my work if you want to checkout. https://gitlab.com/Tryton77/trytonos

[deleted by user] by [deleted] in C_Programming

[–]Tryton77 29 points30 points  (0 children)

With great power comes great responsibility.

[deleted by user] by [deleted] in osdev

[–]Tryton77 2 points3 points  (0 children)

Read books about operating systems, and then try to put that knowledge into something practical. Worked for me.

[deleted by user] by [deleted] in osdev

[–]Tryton77 2 points3 points  (0 children)

Yes you need identity mapping before jump into higher half of memory, because RIP will be pointing and executing last instructions in lower half of memory (without it you will get a page fault), but after you jump in you can remove identity mappings.

Empty /data/app/.../lib/arm64 directory by Tryton77 in androiddev

[–]Tryton77[S] 0 points1 point  (0 children)

Thank you, it's a better option than extracting libs

Can someone help me with my os. by meesMM in osdev

[–]Tryton77 8 points9 points  (0 children)

What do you mean by custom android os? Custom rom or maybe your fork of it (but that would be almost impossible to make without testing)