Rust for Cyber Security and Red Teaming🦀

This blog covers about short Introduction of Rust and where you should start learning the basics to advance and how to implement it in Cyber Security, red teaming, Tool development etc.

Created by @5mukx

⚠️ The information you gather here is for education and research purpose only. The author does not responsible for misuse of these content & resources.

Hello everyone, It's been a while since I write an blog.

“It doesn’t matter if you come from C++, JavaScript, or even if you don’t know any programming language. Rust is a good choice for your first programming language.”

In this blog :-

What is Rust and why you should learn ?

Rust is a multi-paradigmarrow-up-right programming language that combines the blazing speed of C/C++, the memory safety of languages like Java, and the modern features of functional programming. This unique blend makes it an increasingly popular choice for a variety of applications, especially those demanding high performance and reliability.

Sure, but why, really?

Rust solves some of developers’ most frustrating memory management problems commonly associated with C and C++, but that’s not its only capability. Rust has Concurrency , No garbage collection , Cargo Package Manager, Zero-cost abstractions , Pattern matching, Type inference.

Rust is a rapid growing language with a bright future. It is being used by major companies like Microsoft , Amazon , Discord , Mozilla, Dropbox, and Facebook etc. and it is becoming increasingly popular in the embedded systems and web development spaces.

For More about rust here is an Blog that released by Githubarrow-up-right. Microsoft statement of using Rust on Windows : Microsoft Sitearrow-up-right. The Most Loved Programming language of all Time by StackOverFlowarrow-up-right. Bare-metal Rust in Androidarrow-up-right by Google.

Rust for Cybersecurity

Created in Canva by Mearrow-up-right

Since rust has become most popular among developers and hackers , writing malware on rust has increasing day by day. As you can see the fundamental tools are started rewritten on rust.

For Example, RustScanarrow-up-right, Feroxbusterarrow-up-right , LibAFarrow-up-right, Larrow-up-rightsniffgluearrow-up-right , goblinarrow-up-right, ripgreparrow-up-right etc..

Not yet, its just the beginning. Rust can be used writing your own shellcode , exploits, malwares, reverse shells fuzzing tools and many more. Rust can be an challenging task for reverse engineers.

For more content about rust for Cyber Sec . Check out this LinkedIn Blogarrow-up-right.

Rust on Low Level and Malware Perspective .

  • Threat actors chooses Rust for its speed and efficiency compared to other languages. This can allow them to develop malware that runs faster, consumes fewer resources, and evades detection by traditional security software.

  • Smaller binaries: Rust’s statically-typed nature and minimal runtime can lead to smaller binaries compared to interpreted languages. This can make malware harder to detect by size-based analysis.

  • Rust’s strong concurrency features allow for complex, multi-threaded malware that can perform multiple tasks simultaneously. This can make it harder to track and analyze the malware’s behavior.

  • Rust’s ownership system helps prevent memory leaks and dangling pointers, which are common vulnerabilities exploited in malware. This can make the malware more robust and resilient to attacks.

  • Embeddability: Rust can be embedded within other applications, making it difficult to identify and remove malicious code.

Rust on Frameworks, Web assembly Perspective.

  • Unbeatable Predictability: The predictability of Rust’s memory management eliminates memory-related crashes that can sometimes occur in languages with garbage collection. This can be invaluable for developing mission-critical systems or applications where downtime is unacceptable.

  • Beyond Traditional JavaScript: Although the frontend environment for Rust is still developing, frameworks for creating high-performance web apps such as Actix Web, Axum, and Rocket.rs are showing promise. They present a welcome substitute for frameworks based on JavaScript, offering a special fusion of control, safety, and performance.

  • Pushing the Boundaries with WASM: Fronted frameworks like Yew, Leptos, and Iced are pushing the boundaries of what’s possible with Rust in the browser, enabling the creation of performant and interactive web UIs. While they may not yet match the maturity of established JavaScript frameworks, these Rust options offer potential for developers seeking alternative approaches with inherent safety and performance benefits.

Compared to JavaScript, Rust can produce significantly faster binaries, especially when compiled to Web Assembly for the fronted. This can lead to a noticeably smoother user experience, particularly for computationally demanding tasks.

Rust Roadmap for Cyber Security

Created in Canva by Mearrow-up-right

So you have decided to learn rust but don't know where to get started ?!. Don’t worry you have came to the right place.

I am gonna separate the Study path as modules for Easy Journey and attain the perfect learning curve.

Learn the basis, understand the complex and develop some tools before using rust into security . why? because in order to break things you must understand how they works right !!

MODULE 1 : <BASICS>

For Practicing i highly recommend Rustlingsarrow-up-right an rust program that teaches rust by solving them ‘learn rust by doing’.

MODULE 2 : <Basic\Intermediate>

MODULE 3: <Intermediate/Advance>

Enter the world of Low-Level Programming!

[Additional] Visit These Repository for awesome security Lists about Rust:

Top Books for Rust to Master

Created in Canva by Mearrow-up-right

You can either Buy these hard-copy books or download the PDF version using google dork or at PDF Sites :) Since, I can’t provide the direct Link to these books due to copyright issues .

Some Rust YouTube Playlists I Recommend Cyber Stuffs

YouTube channels to Learn Rust <basics/core concepts?>

An List of Rust Course [Free/Paid] through Class Centralarrow-up-right .

YouTube channels to Learn Rust <intermediate/?>

Extra Tips for Learning Rust

There is a repository exercise called Rust by Practice. you can do it to understand the topics learned . Link to Documentationarrow-up-right and do the Rustlings coursearrow-up-right which contains small problems with errors . you need to fix in order to move to the next level.

My socials: Xarrow-up-right , GitHubarrow-up-right , Mediumarrow-up-right and my Personal Blogarrow-up-right. Thanks for reading = )

Last updated