Creative Scripting for Hackers and Pentesters
Dolev Farhi, Nick Aleks

#Bash
#Black_Hat
#Linux
#Kali_Linux
#Network
#Defense
#Pentesters
⚙️ تسلط بر هنر offensive bash scripting در این کتاب بهصورت کاملاً عملی و hands-on آموزش داده میشه. تمرکز اصلی روی اینه که چطور دستورها رو به هم chain کنی، کارهای تکراری رو اتومات کنی و حتی سناریوهای living-off-the-land رو روی سیستمهای لینوکسی اجرا کنی.
🧠 در دنیای تست نفوذ، Bash تبدیل میشه به یک ابزار قدرتمند برای عملیات امنیت تهاجمی. در کتاب Black Hat Bash یاد میگیری چطور Bash رو برای اتوماسیون وظایف، ساخت ابزارهای اختصاصی، کشف آسیبپذیریها و اجرای حملات پیشرفته روی سرورهای لینوکس استفاده کنی. در نهایت یک مجموعه کامل از اسکریپتهای Bash میسازی که ساعتها کار دستی رو حذف میکنه. تنها پیشنیاز، آشنایی پایه با لینوکس هست.
🐧 اول با مبانی syntax در Bash شروع میکنی، بعد یک لابراتوار Kali Linux راه میندازی تا مهارتهات رو در تمام مراحل یک تست نفوذ تمرین کنی—از initial access تا data exfiltration. در طول مسیر یاد میگیری چطور OS command injection انجام بدی، به سیستمهای remote دسترسی بگیری، اطلاعات رو بهصورت stealth جمعآوری کنی و داخل شبکههای محدود حرکت کنی تا به دادههای حساس برسی.
🧰 موضوعات کلیدی کتاب شامل موارد زیره:
🚀 چه pentester باشی، چه bug bounty hunter یا دانشجوی امنیت، این کتاب بهت یاد میده چطور استراتژیهای امنیت تهاجمی رو سریع، دقیق و بهینه اتومات کنی—بدون اینکه نیاز به هیچ «جادوی خاصی» داشته باشی.
📚 فهرست مطالب
📝 نقد و بررسی
💬 «این یک منبع بسیار موردنیاز برای متخصصان امنیت تهاجمی است. داشتن کتابی که به متخصصان امنیت و سایبر یاد بدهد چگونه از قدرت Bash استفاده کنند فوقالعاده است.»
— Phillip Wylie
💬 «Black Hat Bash بهخوبی کاربر را وارد لایه پنهان دنیای هک میکند. این کتاب تعادل خوبی بین آموزش مرحلهبهمرحله و آزادی برای تجربه و توسعه مهارتها ایجاد میکند.»
— Matthew Jerzewski
👨💻 درباره نویسنده
👨💻 دولِو فارهی مهندس امنیت و نویسنده کتاب Black Hat GraphQL است. او در شرکت Palo Alto Networks بهعنوان مهندس امنیت ارشد فعالیت میکند و روزانه از Bash برای اتوماسیون تستهای امنیتی و تحلیل دادههای شبکه و اپلیکیشن استفاده میکند.
👨💻 نیک الکس سابقه فعالیت در تیمهای red team، تست نفوذ و توسعه نرمافزار دارد. او در بانک TD و شرکت ASEC بهعنوان Chief Hacking Officer فعالیت کرده و یکی از نویسندگان کتاب Black Hat GraphQL نیز هست.
Master the art of offensive bash scripting. This highly practical hands-on guide covers chaining commands together, automating tasks, crafting living-off-the-land attacks, and more!
In the hands of the penetration tester, bash scripting becomes a powerful offensive security tool. In Black Hat Bash, you’ll learn how to use bash to automate tasks, develop custom tools, uncover vulnerabilities, and execute advanced, living-off-the-land attacks against Linux servers. You’ll build a toolbox of bash scripts that will save you hours of manual work. And your only prerequisite is basic familiarity with the Linux operating system.
You’ll learn the basics of bash syntax, then set up a Kali Linux lab to apply your skills across each stage of a penetration test—from initial access to data exfiltration. Along the way, you’ll learn how to perform OS command injection, access remote machines, gather information stealthily, and navigate restricted networks to find the crown jewels. Hands-on exercises throughout will have you applying your newfound skills.
Key topics covered include:
Whether you’re a pentester, a bug bounty hunter, or a student entering the cybersecurity field, Black Hat Bash will teach you how to automate, customize, and optimize your offensive security strategies quickly and efficiently, with no true sorcery required.
Table of Contents
1. Bash Basics
2. Flow Control and Text Processing
3. Setting Up a Hacking Lab
4. Reconnaissance
5. Vulnerability Scanning and Fuzzing
6. Gaining a Web Shell
7. Reverse Shells
8. Local Information Gathering
9. Privilege Escalation
10. Persistence
11. Network Probing and Lateral Movement
12. Defense Evasion and Exfiltration
"[A] much needed resource for offensive security professionals. Having a book that teaches offensive security practitioners and cyber security professionals alike how to harness the power of the native Bash shell is amazing. Thanks to Dolev Farhi and Nick Aleks for writing this excellent resource!"
—Phillip Wylie, offensive security professional and host of The Phillip Wylie Show
"Black Hat Bash does a good job of getting the user interested in the soft-white underbelly of the hacking world. This book, from beginning to end, does a good job of walking a fine line between holding the reader's hand and letting them branch out, explore, and improve on the examples that are given throughout the book."
—Matthew Jerzewski, Cybersecurity Researcher III, Fortra
Dolev Farhi is a security engineer and author of Black Hat GraphQL (No Starch Press, 2023). He is a distinguished security engineer at Palo Alto Networks, where he uses bash daily to automate security tests and sift through network and application artifacts.
Nick Aleks has served as a distinguished security engineer at TD Bank and is the chief hacking officer at ASEC. He has extensive experience using bash scripting on red teams, in penetration tests, and in software development projects. Aleks is also coauthor of Black Hat GraphQL (No Starch Press, 2023).









