Linux Basics for Hackers - Getting Started with Networking, Scripting, and Security in Kali - Linux Basics for Hackers Getting… (OccupyTheWeb)(Z-Library)
Linux
No Description
217
Views
0
Downloads
0.00
Total Donations
Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
Page
1
(This page has no text content)
Page
2
(This page has no text content)
Page
3
OceanofPDF.com
Page
4
PRAISE FOR LINUX BASICS FOR HACKERS “If you’re just getting started or working your way to expert level, getting a copy of this book might be one of the best things you can do to develop your cybersecurity skills.” —SANDRA HENRY-STOCKER, NETWORK WORLD “The information provided can help even a general user to get more comfortable with the Linux operating system without feeling overwhelmed by more complex, security-related topics and usage. While we could all benefit from more attention to security, Linux Basics for Hackers just might inspire the next crop of budding techies into the security rock stars of tomorrow.” —TIM EVERSON, THE ETHICAL HACKER NETWORK “Linux Basics for Hackers is immediately practical. Its quick-and- dirty approach to exploring and using a Linux system was welcome.” —JESSE SMITH, DISTROWATCH WEEKLY “A crisp, well-written, and highly effective introduction to Linux for budding pentesters and SOC analysts . . . an ideal first book on Linux
Page
5
for any aspiring red or blue team member, and reading it is well worth your time.” —CYBRARY “If you are starting out in computer science and want to get up to speed quickly on Linux- and Unix-like operating systems, working through this book will put you well ahead of your fellow students, and quickly.” —GREG LADEN, GREG LADEN’S BLOG OceanofPDF.com
Page
6
LINUX BASICS FOR HACKERS 2nd Edition Getting Started with Networking, Scripting, and Security in Kali by OccupyTheWeb San Francisco OceanofPDF.com
Page
7
LINUX BASICS FOR HACKERS, 2ND EDITION. Copyright © 2025 by OccupyTheWeb. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. First printing 29 28 27 26 25 1 2 3 4 5 ISBN-13: 978-1-7185-0354-0 (print) ISBN-13: 978-1-7185-0355-7 (ebook) Published by No Starch Press , Inc. 245 8th Street, San Francisco, CA 94103 phone: +1.415.863.9900 www.nostarch.com; info@nostarch.com Publisher: William Pollock Managing Editor: Jill Franklin ®
Page
8
Production Manager: Sabrina Plomitallo-González Production Editor: Jennifer Kepler Developmental Editors: Liz Chadwick and Jill Franklin Cover Illustrator: Josh Ellingson Interior Design: Octopod Studios Technical Reviewer: Artur Zielinski Copyeditor: Jennifer Kepler Proofreader: Allison Felus Indexer: BIM Creatives, LLC The Library of Congress has catalogued the first edition as follows: Names: OccupyTheWeb, author. Title: Linux basics for hackers : getting started with networking, scripting, and security in Kali / OccupyTheWeb. Description: First edition. | San Francisco : No Starch Press, Inc., [2018]. Identifiers: LCCN 2018030544 (print) | LCCN 2018032646 (ebook) | ISBN
Page
9
9781593278564 (epub) | ISBN 159327856X (epub) | ISBN 9781593278557 (print) | ISBN 1593278551 (print) | ISBN 9781593278564 (ebook) | ISBN 159327856X (ebook) Subjects: LCSH: Penetration testing (Computer security) | Kali Linux. | Hackers. | Operating systems (Computers) Classification: LCC QA76.9.A25 (ebook) | LCC QA76.9.A25 O325 2018 (print) | DDC 005.8--dc23 LC record available at https://lccn.loc.gov/2018030544 For customer service inquiries, please contact info@nostarch.com. For information on distribution, bulk sales, corporate sales, or translations: sales@nostarch.com. For permission to translate this work: rights@nostarch.com. To report counterfeit copies or piracy: counterfeit@nostarch.com. The authorized representative in the EU for product safety and compliance is EU Compliance Partner, Pärnu mnt. 139b- 14, 11317 Tallinn, Estonia, hello@eucompliancepartner.com, +3375690241.
Page
10
No Starch Press and the No Starch Press iron logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it. OceanofPDF.com
Page
11
To my three incredible daughters. You mean the world to me. And to the brave men and women warriors and cyberwarriors of Ukraine who have bravely resisted one of the world’s largest armies for over three years. Your skill and courage are inspiring to all of us. OceanofPDF.com
Page
12
About the Author OccupyTheWeb (OTW) is the pseudonym for the founder and primary writer for the hacker and pentester training website https://www.hackers- arise.com. He is a former college professor and has over 20 years of experience in the information technology industry. He has trained hackers throughout the US, including branches of the US military (Army, Air Force, and Navy) and the US intelligence community (CIA, NSA, and DNI), and he played a key role in the hacker community’s resistance to the Russian invasion of Ukraine. He is also an avid mountain biker and snowboarder. OceanofPDF.com
Page
13
About the Technical Reviewer Artur Zielinski is a penetration tester who mostly focuses on offensive security (penetration testing, ethical hacking, red teaming, OSINT, ICS/SCADA hacking, and biohacking). Zielinski also leads cybersecurity- related activities for children in schools (a day in the life of an ethical hacker, cybersecurity tournaments, and escape rooms), and he’s the father of three fantastic children. OceanofPDF.com
Page
14
BRIEF CONTENTS 1. Preface 2. Acknowledgments 3. Introduction 4. Chapter 1: Getting Started with the Basics 5. Chapter 2: Text Manipulation 6. Chapter 3: Analyzing and Managing Networks 7. Chapter 4: Adding and Removing Software 8. Chapter 5: Controlling File and Directory Permissions 9. Chapter 6: Process Management 10. Chapter 7: Managing User Environment Variables 11. Chapter 8: Bash Scripting 12. Chapter 9: Compressing and Archiving 13. Chapter 10: Filesystem and Storage Device Management 14. Chapter 11: The Logging System 15. Chapter 12: Using and Abusing Services 16. Chapter 13: Becoming Secure and Anonymous 17. Chapter 14: Understanding and Inspecting Wireless Networks 18. Chapter 15: Managing the Linux Kernel and Loadable Kernel Modules 19. Chapter 16: Automating Tasks with Job Scheduling 20. Chapter 17: Python Scripting Basics for Hackers 21. Chapter 18: Artificial Intelligence for Hackers 22. Index
Page
15
OceanofPDF.com
Page
16
CONTENTS IN DETAIL 1. PREFACE 2. ACKNOWLEDGMENTS 3. INTRODUCTION 1. What’s in This Book 2. What Is Ethical Hacking? 1. Penetration Testing 2. Military and Espionage 3. Why Hackers Use Linux 1. Linux Is Open Source 2. Linux Is Transparent 3. Linux Offers Granular Control 4. Most Hacking Tools Are Written for Linux 5. The Future Belongs to Linux/Unix 4. Downloading Kali Linux 5. Virtual Machines 1. Installing VirtualBox 6. Setting Up Your Virtual Machine 1. Installing Kali on the VM 7. Setting Up Kali 8. Installing Kali Through the Windows Subsystem for Linux 4. 1 GETTING STARTED WITH THE BASICS
Page
17
1. Introductory Terms and Concepts 2. A Tour of Kali 1. The Terminal 2. The Linux Filesystem 3. Basic Commands in Linux 1. Finding Yourself with pwd 2. Checking Your Login with whoami 3. Navigating the Linux Filesystem 4. Getting Help 5. Referencing Manual Pages with man 4. Finding Stuff 1. Searching with locate 2. Finding Binaries with whereis 3. Finding Binaries in the PATH Variable with which 4. Performing More Powerful Searches with find 5. Filtering with grep 5. Modifying Files and Directories 1. Creating Files 2. Creating a Directory 3. Copying a File 4. Renaming a File 5. Removing a File 6. Removing a Directory 6. Go Play Now!
Page
18
7. Exercises 5. 2 TEXT MANIPULATION 1. Viewing Files 1. Finding the Head 2. Finding the Tail 3. Numbering the Lines 2. Filtering Text with grep 3. Using sed to Find and Replace 4. Viewing Files with more and less 1. Controlling the Display with more 2. Displaying and Filtering with less 5. Summary 6. Exercises 6. 3 ANALYZING AND MANAGING NETWORKS 1. Analyzing Networks with ifconfig 2. Network Statistics with netstat and ss 3. Checking Wireless Network Devices with iwconfig 4. Changing Your Network Information 1. Assigning a New IP Address 2. Changing Your Network Mask and Broadcast Address 3. Spoofing Your MAC Address 4. Assigning New IP Addresses from the DHCP Server
Page
19
5. Manipulating the Domain Name System 1. Examining DNS with dig 2. Changing Your DNS Server 3. Mapping Your Own IP Addresses 6. Summary 7. Exercises 7. 4 ADDING AND REMOVING SOFTWARE 1. Using apt to Handle Software 1. Searching for a Package 2. Adding Software 3. Removing Software 4. Updating Packages 5. Upgrading Packages 2. Adding Repositories to Your sources.list File 3. Using a GUI-Based Installer 4. Installing Software with git 5. Summary 6. Exercises 8. 5 CONTROLLING FILE AND DIRECTORY PERMISSIONS 1. Different Types of Users 2. Granting Permissions 1. Granting Ownership to an Individual User
Page
20
2. Granting Ownership to a Group 3. Checking Permissions 4. Changing Permissions 1. Changing Permissions with Decimal Notation 2. Changing Permissions with UGO 3. Giving Root Execute Permission on a New Tool 5. Setting More Secure Default Permissions with Masks 6. Special Permissions 1. Granting Temporary Root Permissions with SUID 2. Granting the Root User’s Group Permissions SGID 3. The Outmoded Sticky Bit 4. Special Permissions, Privilege Escalation, and the Hacker 7. Summary 8. Exercises 9. 6 PROCESS MANAGEMENT 1. Viewing Processes 1. Filtering by Process Name 2. Finding the Greediest Processes with top 2. Managing Processes 1. Changing Process Priority with nice 2. Killing Processes 3. Running Processes in the Background 4. Moving a Process to the Foreground
The above is a preview of the first 20 pages. Register to read the complete e-book.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
# Linux Basics for Hackers - Getting Started with Networking, Scripting, and Security in Kali
## 【One-Line Pitch】
A hands-on, hacker-oriented introduction to Linux that teaches essential command-line skills, networking, scripting, and security techniques using Kali Linux—perfect for aspiring penetration testers and cybersecurity beginners who want to learn Linux through practical, offensive-security examples.
## 【Book Arc】
- **Opening (~0%–12%)**: Introduces the purpose of the book and walks through installing Kali Linux in a virtual machine, then covers fundamental filesystem navigation, basic commands, and the structure of the Linux directory hierarchy.
- **Early (~12%–28%)**: Dives into text manipulation tools (grep, sed, more, less, nl), file viewing techniques, and begins exploring network analysis with commands like ifconfig, netstat, and iwconfig.
- **Early-Middle (~28%–36%)**: Covers software management using apt and git, then transitions into file and directory permissions, including octal/binary representations, umask configuration, and special permissions.
- **Middle (~36%–48%)**: Explores process management with ps, top, nice, and renice commands, then introduces environment variables, PATH configuration, and the basics of bash scripting.
- **Middle-Late (~48%–60%)**: Develops more advanced bash scripting concepts, including control structures, functions, and practical hacking scripts, with real-world case studies like the Aloha POS credit card theft example.
- **Late (~60%–100%)**: Covers filesystem and storage device management, job scheduling with cron and rc scripts, and Python scripting basics for hackers, wrapping up with practical security applications.
## 【Key Takeaways】
- **Kali Linux is the hacker's operating system** (Early): The book uses Kali as its platform throughout, teaching Linux through the lens of penetration testing—every command and concept is framed around how hackers actually use it.
- **The filesystem is logical, not physical** (Early): Unlike Windows' C: drive, Linux uses a unified logical structure rooted at /, and understanding this hierarchy is essential for navigating and exploiting systems.
- **Text manipulation is a core hacking skill** (Early): Commands like grep, sed, and nl aren't just utilities—they're the tools you'll use to analyze configuration files, extract intelligence, and modify system behavior.
- **Network configuration is your disguise** (Early): Changing IP addresses, spoofing MAC addresses, and manipulating network information are presented as essential techniques for maintaining anonymity and evading detection.
- **Permissions control access and enable privilege escalation** (Middle): Understanding octal permission representations (like 644 and 755) and umask values is crucial for both securing systems and finding ways to break in.
- **Process management reveals system activity** (Middle): The ps command with aux switches shows all processes across all users, while nice and renice allow you to control resource allocation—critical for both performance and stealth.
- **Environment variables are stealth tools** (Middle): Setting HISTSIZE=0 prevents command history from being stored, and manipulating PATH can either break a system or hide malicious tools.
- **Scripting automates attacks** (Middle-Late): Bash and Python scripting transform manual reconnaissance into automated scanning, as demonstrated by the real-world case of scanning millions of IPs for vulnerable systems.
## 【Reading Tips】
- **Skim the installation chapter if you're experienced**: The VM setup and Kali installation walkthrough is thorough but basic—skip ahead if you already have Kali running.
- **Deep-read Chapters 2 and 3**: Text manipulation and network analysis are where the practical hacking skills really begin; these chapters contain the commands you'll use constantly.
- **Practice the permission calculations**: The octal/binary permission tables in Chapter 5 are worth memorizing—work through the examples until you can convert permissions without thinking.
- **Pay special attention to the scripting chapters**: The bash and Python sections build on each other, and the real-world hacking examples (like the Aloha POS case) show how these skills apply to actual attacks.
- **Do the exercises at each chapter's end**: The book includes practical exercises designed to reinforce each chapter's concepts—these are where the learning sticks.
## 【Coverage Limits】
This guide covers the book's progression from Linux fundamentals through networking, permissions, process management, and scripting. The excerpts do not cover the final chapters on job scheduling, Python scripting details, or filesystem/storage device management in depth, though these are noted in the book's structure.
##
Passage locations
Excerpt 1
6. Exercises 19. 16 AUTOMATING TASKS WITH JOB SCHEDULING 1. Scheduling an Event or Job to Run on an Automatic Basis 1. Scheduling a Backup Task 2. Using cron...
View in text
Excerpt 2
caution, though: be wary of using the -r option with rm, at least at first, because it’s very easy to remove valuable files and directories by mistake. Using...
View in text
Excerpt 3
pdate your repository. 4. Upgrade your software packages. 5. Select a new piece of software from GitHub and clone it to your system. OceanofPDF.com We can th...
View in text
Excerpt 4
rs-Arise!" Listing 8-1: Your “Hello, Hackers-Arise!” script Here, you also see a line that’s preceded by a hash mark (#). This is a comment, which is a note...
View in text
Recommended for You
{{#thumbnailUrl}}
{{/thumbnailUrl}}
{{^thumbnailUrl}}
{{/thumbnailUrl}}
Loading recommended books...
Failed to load, please try again later
Tip the Site
Scan the WeChat Pay or Alipay code to tip. No login required.
WeChat Pay
Alipay