Elaborating on SSH
SSH (Secure Shell) ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine It is intended to replace rlogin and rsh, and provide secure encrypted communications between two untrusted hosts over an insecure network X11 connections and arbitrary TCP ports can also be forwarded over the secure channel ssh connects and logs into the specified hostname (with optional user name) The user must prove his/her identity to the remote machine using one of several methods depending on the protocol version used (see below) If command is specified, it is executed on the remote host instead of a login shell.
Key Components of SSH π
- SSH Client: This is the software on your computer that you use to start the secret tunnel.
- SSH Server: This is the software running on the remote computer that waits for your tunnel requests and lets you in.
The Tools Explained for Beginners π§°
-
1. Termius (Windows, Mac, Android)
- What it is:Termius is like a friendly, modern dashboard for managing all your secret tunnels (SSH connections). It has a graphical user interface (GUI), meaning you click buttons and type into boxes, which is usually easier for beginners.
- 1.Install it: Download and install Termius on your computer or phone.
- 2.Add a New Host: In Termius, you'll see a button or option to "Add New Host" or "New Connection.
- 3.Enter Server Details: Type in the address of the remote computer (like a website address, e.g., my-server.com or an IP address like 192.168.1.100) and the username you want to log in as (e.g., admin or myuser)
- 4.Connect! Click "Connect" or "Save & Connect." Termius will then prompt you for a password (if you use one) or use a "key" (more on that later).
- 5.You're In: Once connected, you'll see a black screen where you can type commands to control the remote computer.
How to use it (Simplified)
- What it is:PuTTY is a classic, straightforward SSH client specifically for Windows. It's also a GUI tool, so you interact with it by typing into fields and clicking buttons. It's often chosen because it's free and very reliable.
- 1.Download it: Get the PuTTY program from its official website. It's often just a single file.
- 2.Launch PuTTY: Open the downloaded PuTTY application.
- 3.Enter Server Details: In the "Host Name (or IP address)" box, type the address of your remote computer. The "Port" will usually be 22 (the standard SSH port).
- 4.Open: Click the "Open" button.
- 5.Login: A black window will pop up asking for your username and then your password.
- 6.You're In: After successfully entering your credentials, you'll be connected and can type commands.
How to use it (Simplified)
- What it is:OpenSSH is the built-in, default SSH tool for Linux and macOS computers. Unlike Termius or PuTTY, it's primarily a command-line interface (CLI) tool. This means you type commands into a text-based window called the "Terminal" (or "Command Prompt" on Windows, if you've installed it there).
- 1.Open Terminal: On Linux or macOS, simply open the "Terminal" application.
- 2.Type the ssh command: To connect, you use the ssh command followed by the username and the server's address:
How to use it (Simplified)
ssh your_username@server_address
For example: ssh john.doe@mycloudserver.netHere's a breakdown of its key features and options π
-
1. Basic SSH Connection & Options
-
At its core, ssh connects you to a remote machine.
How to connect
ssh username@hostname_or_IP
-
Example:ssh -p 2222 user@my-server.com (Connects to port 2222)
-
Example:ssh -l user my-server.com (Same as ssh user@my-server.com)
-
Example:ssh -v user@my-server.com
-
Example:ssh -f myuser@remote.com "firefox &" (Starts Firefox on the remote machine and sends SSH to the background)
-
SSH uses various ways to verify your identity to the server. The most common and secure methods for beginners are Public Key Authentication and Password Authentication.
- Password Authentication:The simplest method. You provide your password for the remote user. All communication, including the password, is encrypted.
- Public Key Authentication (Recommended):This is more secure and convenient for regular use.
- You generate a pair of keys:a public key and a private key.
- The public key is stored on the remote server (in ~/.ssh/authorized_keys in your home directory).
- The private keystays securely on your local computer (e.g., ~/.ssh/id_rsa).
- When you connect,ssh uses your private key to prove your identity without sending your password over the network.
- How to generate keys:ssh-keygen (just type this in your terminal and follow the prompts).
- How to use a specific key:ssh -i ~/.ssh/my_custom_key user@my-server.com
- Authentication Agent(ssh-agent & -A):
- ssh-agent is a program that holds your private keys in memory so you don't have to type your passphrase every time you use them.
- -A(Enable Agent Forwarding):This allows you to use your local ssh-agent keys when connecting from the remote server to another server. Use with caution, as it can be a security risk if the remote server is compromised.
- Example:ssh -A user@first-server (Now, from first-server, you can ssh to second-server using your local keys without re-entering passphrases).
-
When you connect to an SSH server for the first time, ssh will show you its "fingerprint" and ask if you want to accept it.
- known_hosts: Stores server "fingerprints" to verify you're connecting to the right machine.
- Security:If a fingerprint changes, ssh warns you β a sign of a potential attack.
-
While connected, type ~ (tilde) at the beginning of a new line, followed by:
- ~.:Disconnect immediately.
- ~?:Show all escape options.
-
SSH can "tunnel" network traffic securely.
- -L local_port:remote_host:remote_port(Local Forwarding):Access a service on the remote network through a local port on your machine.
- Example: ssh -L 8080:localhost:80 web.example.com (Access web.example.com's port 80 via your localhost:8080).
- -D local_port(Dynamic Forwarding / SOCKS Proxy): Turn your SSH client into a SOCKS proxy. All your selected application traffic goes through the SSH tunnel.
- Example: ssh -D 8080 user@proxy-server.com (Browse securely via proxy-server.com).
-
X11 is the system used by many Unix-like operating systems (like Linux) for graphical user interfaces (GUIs).
- -X: Show remote graphical applications on your local desktop.
- Example: ssh -X user@remote-gui "firefox" (Run Firefox on the remote server, see it on your screen).
- -Y: A less secure version of -X, use only if you fully trust the server.
-
Look in your ~/.ssh/ folder:
- -~/.ssh/config: Your personal settings for SSH (e.g., shorthand for servers).
- ~/.ssh/known_hosts: Saved server fingerprints.
- ~/.ssh/authorized_keys (on server): Where your public key goes so the server knows you're allowed to log in.
- ~/.ssh/id_rsa (etc.): Your private key (keep secret!).
We recommend reading more from ssh(1) - Linux man page
What is SQL?
Structured Query Language (SQL) is a programming language for storing and processing data in relational databases. Relational databases store data in tabular form with rows and columns representing different data categories and relationships between data values. SQL commands can be used to store, update, delete, search, and retrieve data from a database. Additionally, SQL can be used to maintain and optimize database performance.
Key Components of SQL π
- SDatabase:A structured collection of data, like a digital filing cabinet.
- Table:Where data is actually stored within a database, organized into rows and columns (like a spreadsheet).
- Row (Record): A single entry or record in a table (e.g., one customer's details).
- Column (Field): A specific category of data in a table (e.g., "FirstName", "Email").
- Primary Key: A column (or set of columns) that uniquely identifies each row in a table.
- Foreign Key:A column that links rows between two tables, ensuring data integrity.
The Tools Explained for Beginners π§°
-
To write and run SQL, you typically use a Database Management System (DBMS) or a SQL Client.
-
1. Online SQL Editors (No Installation Required!)
- What it is: Web-based tools that let you write and execute SQL queries directly in your browser, often with sample data. Perfect for absolute beginners to practice without setting up a local database.
- 1.Visit Website: Go to a site like W3Schools SQL Editor or SQLBolt.
- 2.Type Query: Write your SQL command in the provided editor area.
- 3.Run: Click a "Run" or "Execute" button.
- 4.See Results: The results of your query (or an error message) will appear.
How to use it (Simplified)
- What it is:Dedicated software installed on your computer to connect to, manage, and query various types of databases (MySQL, PostgreSQL, SQL Server, SQLite, etc.). They offer powerful features and a graphical interface.
- Install: Download and install the tool (e.g., DBeaver).
- 2.Connect to Database: Set up a new connection by providing database server details (host, port, username, password). You might first need to install a local database server (e.g., SQLite, MySQL).
- 3.Open Query Editor: Find the SQL editor window within the tool.
- 4.Write & Run: Type your SQL queries and execute them.
- 5.View & Manage: See query results, browse table structures, and manage database objects.
How to use it (Simplified)
- What it is:Text-based tools that come with database servers (e.g., MySQL, PostgreSQL). You interact by typing SQL commands directly into your terminal.
- Open Terminal: Launch your computer's terminal or command prompt.
- 2.Connect: Type the client command (e.g., mysql -u user -p or psql -U user -d database_name).
- 3.Enter Password: Provide your database user password.
- 4.Type SQL: Once connected, type your SQL queries directly and press Enter.
How to use it (Simplified)
Key Features and Options π
-
SQL is primarily about CRUD operations (Create, Read, Update, Delete) on data
- SELECT: Get data. SELECT * FROM Customers;
- INSERT INTO: Add data. INSERT INTO Products VALUES ('Monitor');
- UPDATE: Change data. UPDATE Users SET Email = 'new@example.com';
- DELETE FROM: Remove data (use with caution!). DELETE FROM Orders WHERE ID = 1;
- WHERE Clause:Filters data (e.g., WHERE Age > 30).
- JOIN:Combines data from multiple tables.
SQL Injection & Prevention π‘οΈ
-
A critical security concern in SQL is SQL Injection.
- What it is:A web security vulnerability where attackers insert malicious SQL code into input fields (e.g., login forms, search bars) to trick the database into executing unintended commands. This can lead to data theft, modification, or even database control.
- Prevention (Most Important for Developers):
- Prepared Statements / Parameterized Queries: This is the primary and most effective defense. It separates the SQL code from user-provided data, so the database never mistakes user input for commands.
- Input Validation: Strictly check and sanitize all user input, allowing only expected formats and content.
- Least Privilege: Configure database user accounts with only the minimum necessary permissions.
We recommend reading more from w3schools - SQL
What is picoCTF?
Imagine you're a digital detective, and there are hidden "flags" (secret codes) spread across various challenges. Your job is to find these flags by solving cybersecurity puzzles. That's essentially what picoCTF is!
- What is a CTF?CTF stands for "Capture The Flag." In cybersecurity, CTFs are competitive games where participants (individuals or teams) solve various challenges to find hidden "flags." These flags are usually unique strings of text (e.g., picoCTF{th1s_is_4_fl4g}).
- What is picoCTF specifically?picoCTF is a free, online cybersecurity competition specifically designed for beginners. It's created by experts at Carnegie Mellon University (CMU) and is often used by high school and college students, but anyone interested in learning cybersecurity can participate.
- What's its purpose?The main goal of picoCTF is to teach cybersecurity skills in a fun, hands-on way. Instead of just reading textbooks, you get to apply concepts by solving real-world-like problems. It helps you explore different areas of cybersecurity.
- How does it work?
- 1.Challenges:You log into the picoCTF platform and see a list of challenges.
- 2.Categories: Get data. SELECT * FROM Customers; Challenges are grouped into categories like:
- Cryptography: Breaking codes.
- Web Exploitation: Finding vulnerabilities in websites.
- Forensics: Analyzing digital evidence.
- Reverse Engineering: Understanding how software works.
- Binary Exploitation (Pwn): Finding flaws in programs to take control.
- General Skills: Basic command-line usage, scripting, and problem-solving.
- 3.Solving: Each challenge gives you a description and sometimes files or a link to a website. Your task is to use various tools and techniques to solve the puzzle.
- 4.Finding the Flag: Once you solve a challenge, you'll uncover a specific string of text β that's the flag!
- 5.Submitting: You submit the flag on the picoCTF platform to earn points.
- 6.Learning: If you get stuck, picoCTF often provides hints or write-ups (solutions) from past competitions, which are excellent learning resources.
- picoCTF account(picoctf.org)
- vscode(visualstudio)
- Python, Wireshark, SSH, php,(Depends on the type of problem)
- Cryptography
- Web Exploitation
- Reverse Engineering
- Forensics
Things to prepare
Type of problem
Virustotal?
VirusTotal is a free online service that analyzes suspicious files, URLs, domains, and IP addresses to detect malware using multiple antivirus engines and online scan services.
- How does it work?
- 1.You Upload or Submit:You find a suspicious file, a strange link (URL), or an IP address that you're worried about. You go to the VirusTotal website and upload the file or paste the link/address into the search bar.
- 2.VirusTotal's "Scan" Begins: Instead of using just one antivirus program, VirusTotal sends your submission to a huge number of different security companies. It's like asking dozens of experts for their opinion at the same time.
- 3.The Experts Report Back:Each of these antivirus engines and security services analyzes your submission. They check it against their own databases of known malware and malicious activity.
- 4.You See the Results:VirusTotal then compiles all of these individual reports into one easy-to-read page. It shows you how many of the different companies flagged your file or link as dangerous. For example, you might see "5 out of 70" engines detected something malicious.
- 5.Bonus Information:VirusTotal also provides extra context, like when the file was first seen, its "fingerprint" (hash), and what other people have said about it. This helps you get a better overall picture of the threat.
- virustotal.(virustotal.com)