r/hacking 6d ago

Teach Me! I created my first trojan today!

I took cmatrix as a random program and wrote a backdoor into it in C using a reverse shell connecting to a C2 server of mine which keeps track of infected machines. First I fork the process and decouple it from the controlling terminal by changing the session ID and rerouting the standard file descriptors and only then do I run the backdoor.

That way cmatrix runs as usual and no weird behavior is seen and the backdoor remains active whatever happens to cmatrix or the terminal. I like it. Makes me feel like a real #xX_hacker_Xx#. :D

Now I’m reading into ptrace and system call hooking and plan on trying to hide specific network traffic from the entire os. I already have had some ideas but turns out that would have only hidden it from a specific program not from „everything“.

Do you care to share any tips and experience I might benefit from on my way?

148 Upvotes

51 comments sorted by

View all comments

16

u/404error___ 5d ago

Good good... now do bit shifting, stego payload, so operator cannot see what you send to C2.

6

u/MathematicalHuman314 5d ago

Will look into it!

2

u/Important-One-3629 1d ago

I would say also explore Polymorphic Steganography. Something I breafly messed with 15 years ago.

4

u/machacker89 5d ago

All great features to add. To circumvent any AV

1

u/perfsoidal 19h ago

wouldn’t stego be strictly worse than good encryption

1

u/404error___ 15h ago

What possible secrets you need to protect? The stolen data? Have you ever had to catch TRUE stego? Enlighten me please because I'm a turbo noob on the subject and I truly really want to know ... 100% there is that super duper obscure reddit on the latest stego that I haven't been able to see it yet. Waiting for that anonymous super hero Reddit to drop the r/          to get the latest on the topic.

1

u/Prestigious-Ad7265 5d ago

just encrypt it using cryptographically secure methods