📞
Contrxl
External Links
Theoretical Learning
Theoretical Learning
  • 🏡Home
  • 📰News & Information
  • Systems Administration
    • ⌨️Cisco
      • Networking Basics
        • Communication in a Connected World
        • Network Components, Types and Connections
        • Wireless and Mobile Networks
        • Home Networking Technologies
        • Communication Protocols
        • Network Media
        • The Access Layer
        • The Internet Protocol
        • IPv4 and Network Segmentation
    • 🎓Learning Links
    • 💻Microsoft
      • AZ-900
        • 1. Cloud Concepts
          • 1.1 Describe Cloud Computing
            • 1.1.1 Introduction - Cloud Computing
            • 1.1.2 What is Cloud Computing?
            • 1.1.3 The Shared Responsibility Model
            • 1.1.4 Define Cloud Models
            • 1.1.5 Define the Consumption based Model
            • 1.1.6 Summary - Cloud Computing
          • 1.2 Describe the Benefits of Cloud Services
            • 1.2.1 Introduction - Cloud Services
            • 1.2.2 Benefits of High Availability and Scalability
            • 1.2.3 Benefits of Reliability and Predictability
            • 1.2.4 Benefits of Security and Governance
            • 1.2.5 Manageability in the Cloud
            • 1.2.6 Summary - Cloud Services
          • 1.3 Describe Cloud Service Types
            • 1.3.1 Introduction - Cloud Service Types
            • 1.3.2 Describe Infrastructure as a Service
            • 1.3.3 Describe Platform as a Service
            • 1.3.4 Describe Software as a Service
            • 1.3.5 Summary - Cloud Service Types
        • 2. Architecture
          • 2.1 Core Architectural Components
            • 2.1.1 Introduction - Core Architectural Components
            • 2.1.2 What is Microsoft Azure
            • 2.1.3 Get Started with Azure Accounts
            • 2.1.4 Explore the Learn Sandbox
            • 2.1.5 Describe Azure Physical Infrastructure
            • 2.1.6 Describe Azure Management Infrastructure
            • 2.1.7 Create an Azure Resource
            • 2.1.8 Summary
          • 2.2 Compute and Networking
            • 2.2.1 Introduction - Compute and Networking
            • 2.2.2 Describe Azure VMs
            • 2.2.3 Create an Azure VM
            • 2.2.4 Describe Azure Virtual Desktop
            • 2.2.5 Describe Azure Containers
            • 2.2.6 Describe Azure Functions
            • 2.2.7 Describe Application Hosting Options
            • 2.2.8 Describe Azure Virtual Networking
            • 2.2.9 Configure Network Access
            • 2.2.10 Describe Azure VPNs
            • 2.2.11 Describe Azure ExpressRoute
            • 2.2.12 Describe Azure DNS
            • 2.2.13 Summary - Compute and Networking
          • 2.3 Azure Storage Services
            • 2.3.1 Introduction - Storage Services
            • 2.3.2 Describe Azure Storage Accounts
            • 2.3.3 Describe Azure Storage Redundancy
            • 2.3.4 Describe Azure Storage Services
            • 2.3.5 Create a Storage Blob
            • 2.3.6 Identify Azure Data Migration Options
            • 2.3.7 Identify Azure File Movement Options
            • 2.3.8 Summary - Storage Services
        • 3. Management and Governance
          • 3.1 Cost Management
            • 3.1.1 Introduction - Cost Management
            • 3.1.2 Describe Factors that can Affect Costs in Azure
            • 3.1.3 Compare Pricing and TCO Calculators
            • 3.1.4 Estimate Workload Costs
            • 3.1.5 Compare Workload Costs with TCO
            • 3.1.6 Describe the Microsoft Cost Management Tool
            • 3.1.7 Describe the Purpose of Tags
            • 3.1.8 Summary - Cost Management
          • 3.2 Governance and Compliance
            • 3.2.1 Introduction - Compliance and Governance
            • 3.2.2 Describe the Purpose of Microsoft Purview
            • 3.2.3 Describe the Purpose of Azure Policy
            • 3.2.4 Describe the Purpose of Resource Locks
            • 3.2.5 Configure a Resource Lock
            • 3.2.6 Describe the Purpose of the Service Trust Portal
            • 3.2.7 Summary - Compliance and Governance
          • 3.3 Tools for Managing Azure Resources
            • 3.3.1 Introduction - Tools for Managing Azure Resources
            • 3.3.2 Describe Tools for Interacting with Azure
            • 3.3.3 Describe the Purpose of Azure Arc
            • 3.3.4 Describe ARM and Azure ARM Templates
            • 3.3.5 Summary - Tools for Managing Azure Resources
          • 3.4 Monitoring Tools
            • 3.4.1 Introduction - Monitoring Tools
            • 3.4.2 Describe the Purpose of Azure Advisor
            • 3.4.3 Describe Azure Service Health
            • 3.4.4 Describe Azure Monitor
    • 📘Microsoft Portal Links
  • Cybersecurity
    • ❓Anonymity Tools
    • 💡OSINT
      • IP & Domain OSINT
      • Email & Username OSINT
      • Vulnerability OSINT
    • 📚Projects
      • ‼️A Simulation Study of DDoS
  • 🦈Hacking
    • ☁️Cloud Attack Vectors
      • Credential Harvesting
      • Privilege Escalation
      • Account Takeover
      • Metadata Service Attacks
      • Misconfigured Cloud Assets
      • Resource Exhaustion and DoS
      • Cloud Malware Injection Attacks
      • Side-Channel Attacks
    • Maintaining Persistence
      • Reverse and Bind Shells
      • Command and Control (C2) Utilities
      • Scheduled Jobs, Tasks and Custom Daemons
    • 💻Network-Based Vulnerabilities
      • Windows Name Resolution and SMB
      • DNS Cache Poisoning
      • SNMP
      • SMTP
      • FTP
      • Pass-the-Hash
      • Kerberos and LDAP-Based Attacks
      • On-Path
      • Route Manipulation
      • DoS and DDoS
      • NAC Bypass
      • VLAN Hopping
      • DHCP Starvation/Rogue DHCP Server
    • Pivoting
      • Post-Exploitation Scanning
      • Legitimate Utilities and LotL
      • Privilege Escalation
    • Specialised System Vulnerabilities
      • Mobile Devices
      • Internet of Things Devices
      • Virtual Machines
      • Containerised Workloads
    • ⚒️Tools
      • Burp Suite
        • Repeater
        • Intruder
        • Other Modules
      • GoPhish
      • Hydra
      • John the Ripper
      • Metasploit
        • Exploitation
        • Meterpreter
      • NMAP
      • Wireshark
    • 🖥️TryHackMe
      • Complete Beginner
        • 1. Complete Beginner Intro
        • 2. Linux Fundamentals
        • 3. Introductory Networking
        • 3.1 Network Exploitation Basics
        • 4. OWASP Top 10 Exploits
        • 5. Upload Vulnerabilities
        • 5.1 An Example Methodology
        • 6. Cryptography - Hashing
        • 7. Cryptography - Encryption
        • 8. Active Directory Basics
        • 9. What the Shell?
        • 10. Linux Privesc
        • 11. More Linux Privesc
      • Jr Penetration Tester
        • Walking an Application
        • Content Discovery
        • Subdomain Enumeration
        • Authentication Bypass
        • IDOR
        • File Inclusion
        • SSRF
        • XSS (Cross-site Scripting)
        • Command Injection
        • SQL Injection
        • Passive Reconnaissance
        • Active Reconnaissance
        • Protocols and Servers
        • Protocol and Server Attacks
        • Vulnerabilities
        • Exploiting Vulnerabilities
        • Linux Privilege Escalation
        • Windows Privilege Escalation
      • CompTIA Pentest+
        • Planning and Scoping
          • Pentesting Fundamentals
          • Red Team Engagements
          • Governance and Regulation
        • Tools and Code Analysis
          • Metasploit: Introduction
          • Wireshark: The Basics
          • Burp Suite: The Basics
          • Hydra
          • Python Basics
        • Attacks and Exploits
          • Phishing
          • Windows Local Persistence
          • Breaching Active Directory
          • Lateral Movement & Pivoting
    • Web Application Vulnerabilities
      • The HTTP Protocol
      • Business Logic Flaws
      • Injection-Based Vulnerabilities
      • Authentication-Based Vulnerabilities
      • Authorisation-Based Vulnerabilities
      • Cross-Site Scripting (XSS)
      • Cross-Site Request Forgery (CSRF/XSRF) and Server-Side Request Forgery (SSRF)
      • Clickjacking
      • Security Misconfigurations
      • File Inclusion Vulnerabilities
      • Insecure Coding Practices
    • Wireless Vulnerabilities
      • Rogue Access Point/Evil Twin
      • Disassociation/Deauthentication
      • Preferred Network List Attack
      • Wireless Signal Jamming
      • War Driving
      • Initialization Vector (IV) and Insecure Wireless Protocol
      • KARMA
      • Fragmentation Attacks
      • Credential Harvesting
      • Bluejacking and Bluesnarfing
      • RFID Attacks
Powered by GitBook
On this page
  • Background
  • Basic Commands
  • Shell Operators
  • Flags & Switches
  • Permissions
  • Common Directories
  • Terminal Text Editors
  • Downloading Files
  • Transferring Files from Host (SCP)
  • Serving Files from Host
  • Processes
  • Automation
  1. Hacking
  2. TryHackMe
  3. Complete Beginner

2. Linux Fundamentals

Second section in Complete Beginner learning path.

Background

More lightweight than Windows, first released in 1991. Powers things like websites, car entertainment & control panels, PoS systems and critical infrastructure/IoT sensors.

Linux is term for OS's built on UNIX. Ubuntu & Debian are common versions of Linux due to their extensibility. Kali is common among security professionals.

Basic Commands

echo: outputs any text provided to it (echo "Hello world!") whoami: tells you who you are currently logged in as ls: lists files & folders in current directory cd: change directory (cd /Desktop) cat: concatenate pwd: print working directory find: can be used to search the system for a specific file/files grep: can be used to search files for specific terms (grep "Hello" test.txt) touch: creates a file mkdir: creates a folder cp: copies a file or folder mv: moves a file or folder rm: removes a file or folder file: determines the type of a file

Shell Operators

&: runs commands in the background of the terminal &&: combine multiple commands into one line >: redirect output from a command and replace >>: redirect and append rather than redirect and replace

Flags & Switches

Commands have various arguments that can be provided, these arguments are provided using a hyphen and then a specific keyword known as a flag or switch. For example, ls -a will use the argument "-a" to display all files in a location, including hidden ones.

Commands that accept switches will have a --help or -h option which will show all the possible options a command will accept as well as showing a brief description and an example of how to use it.

Permissions

Using ls -lh shows permissions for files. Three columns are displayed which determine what actions are and aren't allowed, the columns show read (r), write (w) and execute (e).

Common Directories

/etc: one of most important directories, stores system files used by the OS. Holds a file called sudoers which shows the users and groups with permissions to run as root. Passwd and shadow are also held here which show how the system stores passwords (encrypted with sha512).

/var : short for variable data, stores data frequently accessed or written by system services and apps. Log files from running services are typically written here in /var/log.

/root : the home folder for the "root" system user, important to remember that for "root" the home directory is this instead of /home.

/tmp : short for temporary, volatile directory used to store data that is only needed once or twice. This folder is wiped once the computer is restarted. Tmp can be written by all users by default.

Terminal Text Editors

Nano: use nano filename to create or open a file using nano. Lines can be navigated using the up or down arrow keys and pressing enter creates a new line. Nano covers most things a text editor needs like searching, copy/pasting, skipping to a line number and checking your current line number. All nano commands are listed at the bottom and are triggered by pressing CTRL + a key (CTRL is denoted using ^)

VIM : much more advanced editor. Much harder to use but is highly customisable, highlights syntax, works on all terminals.

Downloading Files

The wget command allows files, scripts, programs or pictures to be downloaded directly from the terminal as long as you have the address of the resource you wish to download. To download a file named "file.txt" assuming yo know the address the command would appear as:

wget https://www.mysite.com/file.txt

Transferring Files from Host (SCP)

SCP (Secure Copy) allows secure copying of files over SSH. SCP lets you copy files and directories to and from your system and a remote system. The command to transfer a file from your machine to a remote machine would look like:

scp file.txt user@192.168.1.1:/home/user/transfer.txt

This uses a few variables; the IP of the host (192.168.1.1), the user on the remote system (user), the name of the file on the local system (file.txt) and the name we want the file to have on the remote system (transfer.txt). Reversing this allows us to transfer data from a remote host to your local host, like:

scp user@192.168.1.1:/home/user/file.txt transfer.txt

Serving Files from Host

Ubuntu machines come with python3, this provides the HTTPServer module which turns your machine into an easy to use web server to serve files which can be downloaded with curl or wget. HTTPServer will serve files in the directory that you run the command by default. To start HTTPServer use the command:

python3 -m http.server

Once this is running you can download using the computers IP address and the name of the file. This requires you to use the exact name and location of the file you wish to download, there is no indexing. To download we can use:

wget http:/127.0.0.1:8000/file

Processes

To view a list of running processes, use the ps command. This shows the process status code, how much CPU is being used and the name of the program. To see processes that run from other users and those that don't run from a session like system processes we use ps aux.

The top command can be used to see real time stats about processes running on the system.

To stop a process running we can use kill [PID] e.g. kill 209. Signals that can be sent to killed processes are:

  • SIGTERM : kill process and allow cleanup

  • SIGKILL : kill the process, no cleanup

  • SIGSTOP : stop or suspend a process

systemctl allows interaction with the systemd daemon. systemctl uses the format systemctl [option] [service]. To tell Apache to start we would use systemctl start apache2. systemctl allows four options:

  • Start

  • Stop

  • Enable

  • Disable

Automation

To have certain actions take place after system boot, cron can be used. cron can be interacted with using crontabs.

A crontab is a special file with formatting recognised by the cron process to execute each line. crontabs require:

  • MIN : minute to execute at

  • HOUR : hour to execute at

  • DOM : day of month to execute at

  • MON : month of year to execute at

  • DOW : day of week to execute at

  • CMD : actual command to use

To back up a users documents every 12 hours we could use:

0 */12 * * * cp -R /home/user/Documents /var/backups >/dev/null 2>&1

Last updated 4 months ago

🦈
🖥️