> For the complete documentation index, see [llms.txt](https://www.5mukx.site/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.5mukx.site/rust-programming/rust-for-cyber-security-and-red-teaming.md).

# Rust for Cyber Security and Red Teaming🦀

<figure><img src="/files/14FNlCe4vMr1dfJnfkjL" alt=""><figcaption><p>Created by @5mukx</p></figcaption></figure>

> :warning: *The information you gather here is for education and research purpose only. The author does not responsible for misuse of these content & resources.* &#x20;

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 :-** <a href="#d06e" id="d06e"></a>

* [*Short Into about rust*](#id-743b)
* [*Advantages of using rust*](#id-5e7d)
* [*Rust for cybersecurity*](#id-20fa)
* [*Rust Resources for Cyber Security*](#id-3e58)
* [*Rust Books to master*](#id-205c)

## What is Rust and why you should learn ? <a href="#id-743b" id="id-743b"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:700/0*ZpAxSr7EUOgwbOQz" alt="" height="368" width="700"><figcaption><p>By <a href="https://stackoverflow.blog/2021/03/15/getting-started-with-rust/">StackOverFlow</a></p></figcaption></figure>

Rust is a [multi-paradigm](https://www.google.com/search?q=multi-paradigm) 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? <a href="#id-5e7d" id="id-5e7d"></a>

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 [Github](https://github.blog/2023-08-30-why-rust-is-the-most-admired-language-among-developers/).\
Microsoft statement of using Rust on Windows : [Microsoft Site](https://msrc.microsoft.com/blog/2019/11/using-rust-in-windows/).\
The Most Loved Programming language of all Time by [StackOverFlow](https://stackoverflow.blog/2021/03/15/getting-started-with-rust/).\
[Bare-metal Rust in Android](https://security.googleblog.com/2023/10/bare-metal-rust-in-android.html) by Google.

## Rust for Cybersecurity <a href="#id-20fa" id="id-20fa"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*51t-HyH4tQKKnDa-4aPN6g.png" alt="" height="175" width="700"><figcaption><p>Created in Canva by <a href="https://twitter.com/5mukx">Me</a></p></figcaption></figure>

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,\
[RustScan](https://github.com/RustScan/RustScan), [Feroxbuster](https://github.com/epi052/feroxbuster) , [LibAF](https://github.com/AFLplusplus/LibAFL), [L](https://github.com/AFLplusplus/LibAFL)[sniffglue](https://github.com/kpcyrd/sniffglue.git) , [goblin](https://github.com/m4b/goblin), [ripgrep](https://github.com/BurntSushi/ripgrep) 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 [**Blog**](https://www.linkedin.com/pulse/how-mastering-rust-can-advance-your-career-cybersecurity/).

### **Rust on Low Level and Malware Perspective .** <a href="#eb30" id="eb30"></a>

* **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. <a href="#id-3e62" id="id-3e62"></a>

* **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 <a href="#id-3e58" id="id-3e58"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*w1Dw8VngvmmKak442ty0Cw.png" alt="" height="175" width="700"><figcaption><p>Created in Canva by <a href="https://twitter.com/5mukx">Me</a></p></figcaption></figure>

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>**

* [**Rust Book with Quiz**](https://rust-book.cs.brown.edu/ch00-00-introduction.html): An unofficial documentation (an copy of [***Rust Book***](https://doc.rust-lang.org/book/) ) that has quizzes and question per topic ( Recommend Document).
* [**Take your first step with Rust**](https://learn.microsoft.com/en-us/training/paths/rust-first-steps/) : An Rust Beginner Documentation by Microsoft ( Recommend ).
* [**Rust for Windows**](https://learn.microsoft.com/en-us/windows/dev-environment/rust/rust-for-windows#introducing-rust-for-windows): An official Guide to getting start in Rust by Microsoft. ( Recommend )
* [**Easy Rust**](http://easy_rust/) : Learn Rust with Easy English. Topic wise Topic. If you want to learn about particular topic i recommend this documentation for reference.
* [**Rust Book**](https://doc.rust-lang.org/book/): An official rust documentation by the rust community. Learn all the topics in that documentation.

For Practicing i highly recommend [**Rustlings**](https://github.com/rust-lang/rustlings/) an rust program that teaches rust by solving them ‘learn rust by doing’.

> **MODULE 2 : \<Basic\Intermediate>**

* [**Microsoft’s Path**](https://learn.microsoft.com/en-us/training/paths/rust-first-steps/) : An complete path to become strong at Basics and Intermediate. ( Highly Recommend )
* [**Rust By Example**](https://doc.rust-lang.org/stable/rust-by-example/) : An Mini Documentation that Explains Rust with runnable examples that illustrate various Rust concepts and standard libraries ( Recommend )
* [**Rust Macros**](https://earthly.dev/blog/rust-macros/#:~:text=In%20Rust%2C%20macros%20are%20pieces,of%20a%20macro%20is%20println!%20) : Practical Examples and Best Practices. ( Highly Recommend )
* [**Asynchronous Programming**](https://rust-lang.github.io/async-book/): Learn the Basics of multi-threading programming. ( Highly Recommend )
* [**Windows API**](https://kennykerr.ca/rust-getting-started/) : Learn how to implement windows API with Rust. ( Highly Recommend )
* [**Into about Rust Ecosystem**](https://technorely.com/insights/exploring-rusts-ecosystem-a-dive-into-libraries-frameworks-and-tools) : From there you can choose what you need to do depend upon your use .( Recommend )

> **MODULE 3: \<Intermediate/Advance>**

Enter the world of Low-Level Programming!

* [**Writing OS in Rust**](https://os.phil-opp.com/) : Since you do not need to write the Kernel in rust but read the fundamentals like Heap Allocation , Async/Await , Paging . It the most common thing to learn in rust if you are coding an system level tools and projects like Mimikaz etc.
* [**Rust Atomics and Locks**](https://marabos.nl/atomics/preface.html) : Learn low-level concurrency looks like from a Rust perspective. Great book to learn about threads ,mutexes, references , interior mutability , memory ordering etc.
* Visit [**OffensiveRust**](https://github.com/trickster0/OffensiveRust) Repository where it contains Offensive . Analise and understand How its done, you will get an better idea !
* [**Web Frameworks**](https://blog.logrocket.com/top-rust-web-frameworks/) : [**Actix**](https://actix.rs/) and [**Rocket**](https://rocket.rs/) is an top web framework for Rust.

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

* [**OffensiveRust**](https://github.com/trickster0/OffensiveRust)
* [**Rust for malware development**](https://github.com/Whitecat18/Rust-for-Malware-Development)
* [**Rust Red ops**](https://github.com/joaoviictorti/RustRedOps)
* [**Black-hat-rust**](https://github.com/skerkour/black-hat-rust)
* [**awesome-rust-security**](https://github.com/ex0dus-0x/awesome-rust-security#offensive-security-and-red-teaming)
* [**Security Related Rust Projects**](https://github.com/rust-secure-code/projects.git)

## Top Books for Rust to Master <a href="#id-205c" id="id-205c"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*PiRz73BKTtpVdCDMQPMVAw.png" alt="" height="175" width="700"><figcaption><p>Created in Canva by <a href="https://twitter.com/5mukx">Me</a></p></figcaption></figure>

* [**Black Hat Rust**](https://kerkour.com/black-hat-rust) by Sylvain Kerkour
* [**Network Programming with Rust**](https://www.amazon.com/Network-Programming-Rust-memory-safety-concurrency/dp/1788624890) by Abhishek Chanda
* [**Zero to Production**](https://www.zero2prod.com/index.html?country=India\&discount_code=SEA60) in Rust by Luca Palmieri
* [**Command Line Rust**](https://www.amazon.com/Command-Line-Rust-Ken-Youens-Clark-ebook/dp/B09QFQ3Y64?ref_=ast_author_dp) by y [Ken Youens-Clark](https://www.amazon.in/Ken-Youens-Clark/e/B08DDCNNL3/ref=dp_byline_cont_book_1)
* [**Hands-On System Programming with Rust**](https://www.goodreads.com/book/show/58429656-hands-on-systems-programming-with-rust) by Ken Youens-Clark
* [**Rust Servers, Services and Apps**](https://www.amazon.com/Rust-Servers-Services-Prabhu-Eshwarla/dp/1617298603) by Prabhu Eshwarla
* [**Rust in Action**](https://www.amazon.com/Rust-Action-Tim-McNamara/dp/1617294551) by Tim McNamara
* [**Practical System Programming**](https://www.amazon.com/Practical-System-Programming-Rust-Developers/dp/1800560966) for Rust Developers by by [Prabhu Eshwarla](https://www.amazon.com/Prabhu-Eshwarla/e/B08RBSMC5F/ref=dp_byline_cont_book_1)

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 <a href="#fd50" id="fd50"></a>

* [**Low Level Learning**](https://www.youtube.com/watch?v=UdE8_V05BI8\&list=PLc7W4b0WHTAUAEAguiqpNa5H0QqXJIJI6\&pp=iAQB)
* [**Tech69**](https://www.youtube.com/watch?v=QbZokT-mN4U\&list=PLCLxMnnAnGilCT24uK6k0hiPoYMLIan29\&pp=iAQB)
* [**Michael Mullin**](https://www.youtube.com/@masmullin/playlists)

### YouTube channels to Learn Rust \<basics/core concepts?> <a href="#id-7f47" id="id-7f47"></a>

* [**Ryan Levick**](https://www.youtube.com/c/RyanLevicksVideos)
* [**Mithradates**](https://www.youtube.com/@mithradates)
* [**Trevor Sullivan**](https://www.youtube.com/watch?v=lTjGt17bQ3k\&list=PLDbRgZ0OOEpUkWDGqp91ODn0dk7LPBAUL\&pp=iAQB)

An List of Rust Course \[Free/Paid] through [**Class Central**](https://www.classcentral.com/search?q=+rust) .

### YouTube channels to Learn Rust \<intermediate/?> <a href="#id-1012" id="id-1012"></a>

* [Packt Publications Rust](https://www.youtube.com/@OfficialPackt/search?query=rust)-> Learn Rust Concepts by the Rust Authors
* [Jeremy Chone](https://www.youtube.com/@JeremyChone) -> Rust Tips and Tricks for Project Development Phases
* [Tsoding](https://youtube.com/results?sp=mAEA\&search_query=tsoding+rust#searching) -> You can watch his rust videos like how he codes rust .
* [Code to the moon](https://youtube.com/@codetothemoon/featured) -> A YouTube channel that delivers usage of rust in a different perspective

## Extra Tips for Learning Rust <a href="#id-6127" id="id-6127"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:449/1*lCV8OxKC0Bd1ZiqLCZVeSw.png" alt="" height="284" width="449"><figcaption><p><a href="https://practice.course.rs/why-exercise.html">Rust By Practice</a></p></figcaption></figure>

There is a repository exercise called Rust by Practice. you can do it to understand the topics learned . Link to [Documentation](https://practice.course.rs/why-exercise.html) and do the [Rustlings course](https://github.com/rust-lang/rustlings/) which contains small problems with errors . you need to fix in order to move to the next level.

\
My socials: [X](https://twitter.com/5mukx) , [GitHub](https://github.com/Whitecat18) , [Medium](https://smukx.medium.com) and my [Personal Blog](https://www.5mukx.site/).\
\
Thanks for reading = )&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.5mukx.site/rust-programming/rust-for-cyber-security-and-red-teaming.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
