<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Steven Wael on Medium]]></title>
        <description><![CDATA[Stories by Steven Wael on Medium]]></description>
        <link>https://medium.com/@stevenwael371?source=rss-0f01b65c0ca7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8fjngmNZsGYJZByZo5Y-1Q.jpeg</url>
            <title>Stories by Steven Wael on Medium</title>
            <link>https://medium.com/@stevenwael371?source=rss-0f01b65c0ca7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:43:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stevenwael371/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Part 3: Every System Tells On Itself: Packages, Logs and Regex]]></title>
            <link>https://medium.com/@stevenwael371/part-3-every-system-tells-on-itself-packages-logs-and-regex-ed58001c8904?source=rss-0f01b65c0ca7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed58001c8904</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Steven Wael]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 13:19:45 GMT</pubDate>
            <atom:updated>2026-11-21T13:19:45.821Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Failed logins, crashed services, midnight requests: Linux writes it all down. Here’s how to read it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2p5-82q9ttfM53hEPmMtA.png" /></figure><p>Here’s something nobody tells beginners: a Linux machine remembers almost everything that happens to it.</p><p>Who logged in. Which page was requested. Which service crashed at 3 AM. All of it is written down somewhere. Your job is knowing where to look.</p><p>Adam’s next assignment was to prepare his own environment for an assessment and then work out what had happened on the lab server before he arrived.</p><p><strong>Adam:</strong> “Alex, I need a tool for my next lab. How do I install it?”</p><p><strong>Alex:</strong> “On Ubuntu and Debian, you use a package manager called APT.”</p><p><em>Everything in this series is for authorized lab machines only. Sample outputs are illustrative; yours will differ.</em></p><h3>1. Installing the right tools</h3><pre>sudo apt update<br>sudo apt install nmap<br>sudo apt remove nmap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqJgXp1wNXZH-L81aNQ1Mw.png" /></figure><p><strong>Adam:</strong> “So apt update upgrades everything?”</p><p><strong>Alex:</strong> “No, and that’s a classic mistake. It only refreshes the <em>list</em> of available packages. Upgrading is a separate step.”</p><p><strong>Adam:</strong> “Where does APT get these packages from?”</p><p><strong>Alex:</strong> “Repositories: software sources defined here.”</p><pre>/etc/apt/sources.list<br>/etc/apt/sources.list.d/</pre><p>The first holds the main repository configuration. The second usually holds extra repositories.</p><h3>2. Trust, but verify</h3><p><strong>Alex:</strong> “Downloading software isn’t just fetching a file. You’re deciding to trust whoever published it.”</p><ul><li><strong>Repository:</strong> provides the packages.</li><li><strong>GPG keys:</strong> help verify that repository metadata and packages are authentic.</li><li><strong>APT:</strong> downloads and installs them.</li></ul><p>Adding and removing a PPA:</p><pre>sudo add-apt-repository ppa:example/ppa<br>sudo apt update<br>sudo add-apt-repository --remove ppa:example/ppa</pre><p><strong>Alex:</strong> “Never add a random repository because a tutorial said so. One bad source can compromise your whole machine.”</p><h3>3. Following the evidence: Linux logs</h3><p><strong>Adam:</strong> “Can Linux tell me what happened before I connected?”</p><p><strong>Alex:</strong> “That’s exactly what logs are for.”</p><p>Most traditional logs live here:</p><pre>ls /var/log</pre><pre>auth.log   apache2   ufw.log   fail2ban.log   syslog</pre><ul><li><strong>Authentication logs:</strong> login and authentication activity.</li><li><strong>Apache logs:</strong> web server activity.</li><li><strong>UFW logs:</strong> firewall activity.</li><li><strong>Fail2ban logs:</strong> events from its intrusion-prevention actions.</li></ul><p>Apache keeps two key files: access.log (every HTTP request) and error.log (errors and operational problems).</p><pre>tail -n 3 /var/log/apache2/access.log</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-BxtqoM_O2BHVtjVUs4fw.png" /></figure><p>To watch new entries arrive live:</p><pre>tail -f /var/log/apache2/access.log</pre><p>Log rotation keeps old files archived so logs don’t grow forever.</p><h3>4. Finding needles with Regex</h3><p><strong>Adam:</strong> “The file has thousands of lines. I can’t read them all.”</p><p><strong>Alex:</strong> “Don’t. Search for a <em>pattern</em> instead of an exact word. That’s what regular expressions are for.”</p><p>The building blocks:</p><ul><li>\w a word character, \W a non-word character</li><li>\d or [0-9] a digit, \D a non-digit</li><li>\s whitespace, \S non-whitespace</li><li>. any character</li><li>^ start of a line, $ end of a line</li><li>\. \? \! \$ literal dot, question mark, exclamation mark, dollar sign</li><li>\d{2} exactly two digits, \s{3} exactly three whitespace characters</li></ul><p>Lines starting with three digits:</p><pre>grep -E &#39;^[0-9]{3}&#39; access.log</pre><p>All failed logins:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tY-kvswd-nYJS--g_NLMPA.png" /></figure><p><strong>Alex:</strong> “Regex pays off when you’re analyzing large logs or processing collected data.”</p><h3>5. Saving your findings</h3><pre>hostname -A &gt;&gt; my_task.txt</pre><ul><li>hostname -A prints the machine’s FQDNs.</li><li>&gt;&gt; appends to a file.</li><li>&gt; overwrites (or creates) a file.</li></ul><p><strong>Adam:</strong> “So I can keep adding findings without losing the old ones?”</p><p><strong>Alex:</strong> “Yes. Documentation is part of a professional assessment. If you didn’t write it down, it didn’t happen.”</p><h3>6. When you’re stuck, read the manual</h3><p>Adam hit a command he’d never seen. He reached for his phone.</p><p><strong>Alex:</strong> “Put that down. The answer is already on this machine.”</p><pre>man ls</pre><p>Useful variations:</p><pre>man -f passwd     # short description of matching pages<br>man -k network    # search names and descriptions<br>man -a passwd     # show all matching pages<br>man -w passwd     # show where the page file lives<br>whatis passwd<br>apropos network<br>man -K password  # full-text search (slow)</pre><p>Manual pages are grouped into sections:</p><ul><li><strong>1:</strong> user commands</li><li><strong>2:</strong> system calls</li><li><strong>3:</strong> library functions</li><li><strong>4:</strong> device files</li><li><strong>5:</strong> configuration file formats</li><li><strong>6:</strong> games</li><li><strong>7:</strong> standards and protocols</li><li><strong>8:</strong> system administration commands</li><li><strong>9:</strong> kernel API</li></ul><p>The same name can live in several sections, so this matters:</p><pre>man 5 passwd    # the /etc/passwd file format<br>man 1 passwd    # the passwd command</pre><p>Most manual pages follow the same layout: <strong>NAME</strong>, <strong>SYNOPSIS</strong>, <strong>DESCRIPTION</strong>, <strong>OPTIONS</strong>, <strong>EXAMPLES</strong>, <strong>FILES</strong> and <strong>SEE ALSO</strong>. In a hurry, jump straight to <strong>EXAMPLES</strong>.</p><p>Inside a manual page: <strong>Space</strong> next page, <strong>PageUp</strong> previous page, <strong>↑/↓</strong> one line, /text search, n next match, N previous match, g top, G bottom, q quit.</p><p><strong>Alex:</strong> “A good pentester doesn’t memorize every command. They know how to find accurate documentation fast.”</p><p>Adam had the tools and the evidence. One question remained, and it was the big one.</p><p><strong>Alex:</strong> “Logs tell you <em>what</em> happened. Now find out <em>who</em> has access to this machine.”</p><h3>Try it yourself</h3><ol><li>Run ls /var/log and open one file with less. Search inside it with /error.</li><li>Run sudo grep -E &#39;Failed|Accepted&#39; /var/log/auth.log | tail and describe what you see.</li><li>Run man 5 passwd and find the meaning of the third field.</li><li>Save your hostname and today’s date into a notes file using &gt;&gt;.</li></ol><p><em>Next: Part 4, who has access to this system and how to find out.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed58001c8904" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 2: What’s Running on This Machine? Processes, Services and Cron]]></title>
            <link>https://medium.com/@stevenwael371/part-2-whats-running-on-this-machine-processes-services-and-cron-32b4d8cba89f?source=rss-0f01b65c0ca7------2</link>
            <guid isPermaLink="false">https://medium.com/p/32b4d8cba89f</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Steven Wael]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 13:10:32 GMT</pubDate>
            <atom:updated>2026-11-21T13:10:32.450Z</atom:updated>
            <content:encoded><![CDATA[<p><em>An idle server, a spinning fan, and a process nobody started. Here’s how to find out what’s running and who launched it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xyr_8E5J_YBv4E1OJVDBmQ.png" /></figure><p>Adam stared at his screen.</p><p>The server had been idle for an hour, yet the fan noise said otherwise. Files were changing. Something was running commands, and nobody was typing them.</p><p><strong>Alex:</strong> “Every program that runs creates a process. Learn to see them.”</p><p><em>Everything in this series is for authorized lab machines only. Sample outputs are illustrative; yours will differ.</em></p><h3>1. Listing processes</h3><p>Plain ps shows only the processes attached to your current terminal. For the full picture, add aux:</p><pre>ps aux #`a`: shows processes from all users.<br>      #`x`: includes processes not attached to a terminal.<br>      #`u`: displays processes in a user-oriented format.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MCM_AlttFXjk5IgXuPKH4A.png" /></figure><p>The key columns: PID (process ID), USER, %CPU, %MEM, and COMMAND.</p><p><strong>Adam:</strong> “Process 1337 is eating almost all the CPU!”</p><p><strong>Alex:</strong> “Then watch it live.”</p><pre>top</pre><p>top refreshes continuously. Press q to quit.</p><p><strong>Alex:</strong> “In a pentest, process enumeration shows you applications, services, and anything unusual.”</p><h3>2. Stopping a process, politely</h3><p><strong>Adam:</strong> “Can I kill it?”</p><p><strong>Alex:</strong> “Yes, but first understand what it is. Then send a signal.”</p><pre>kill -TERM 1337    # ask it to exit gracefully<br>kill -KILL 1337    # force it to die<br>kill -STOP 1337    # pause it</pre><ul><li><strong>SIGTERM:</strong> requests graceful termination.</li><li><strong>SIGKILL:</strong> forces immediate termination.</li><li><strong>SIGSTOP:</strong> suspends the process.</li></ul><p><strong>Alex:</strong> “Don’t reach for SIGKILL first. Let the process clean up after itself.”</p><h3>3. Parents and children</h3><p>Adam noticed processes weren’t independent. Alex explained they form a family tree.</p><pre>systemd<br> ├── process A<br> │    └── child process<br> ├── process B<br> └── process C</pre><p>On most modern distributions, systemd is the first userspace process and manages services.</p><p><strong>Alex:</strong> “You’ll also meet <em>namespaces</em>, which isolate what a process can see: process IDs, network interfaces, mounts, users. They’re everywhere in containers. Don’t confuse them with <em>cgroups</em>, which limit and account for resources.”</p><h3>4. Checking services</h3><p><strong>Adam:</strong> “Apache is installed. Is it running?”</p><pre>systemctl status apache2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7QyB6SR_FS47xoPicOqVg.png" /></figure><p>The operations you’ll use constantly:</p><pre>sudo systemctl start apache2<br>sudo systemctl stop apache2<br>sudo systemctl enable apache2<br>sudo systemctl disable apache2</pre><ul><li>start / stop: act right now.</li><li>enable / disable: control startup at boot.</li></ul><p><strong>Alex:</strong> “Remember: systemd is the manager, systemctl is how you talk to it.”</p><h3>5. Foreground vs background</h3><p>Adam copied a huge file and his terminal froze until it finished.</p><p><strong>Adam:</strong> “Can I make it not block me?”</p><pre>cp bigfile.iso /backup/ &amp;</pre><p>The &amp; sends it to the background. If you already started something in the foreground, press <strong>Ctrl + Z</strong> to suspend it (not kill it), then fg to bring it back.</p><h3>6. Who runs commands when nobody’s typing? Meet Cron</h3><p><strong>Adam:</strong> “So who started that miner?”</p><p><strong>Alex:</strong> (smiling) “Check the schedule.”</p><pre>crontab -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRmQkqCCz9cqoDtPKeKeVA.png" /></figure><p>A cron line has five time fields, then the command:</p><pre>MIN HOUR DOM MON DOW COMMAND</pre><ul><li><strong>MIN:</strong> minute</li><li><strong>HOUR:</strong> hour</li><li><strong>DOM:</strong> day of month</li><li><strong>MON:</strong> month</li><li><strong>DOW:</strong> day of week</li></ul><p>* means “any value”. So * * * * * runs every minute, and this runs a backup every 12 hours:</p><pre>0 */12 * * * cp -R /home/user/Documents /var/backups/</pre><p>Edit your schedule with crontab -e.</p><p><strong>Alex:</strong> “From a Red Team view, scheduled tasks reveal automation, scripts, and misconfigurations. Always check them during authorized enumeration.”</p><p>Adam finally had the culprit. But Alex wasn’t done.</p><p><strong>Alex:</strong> “Now let’s learn <em>how</em> to install the tools you’ll need, and where this machine keeps its diary.”</p><h3>Try it yourself</h3><ol><li>Run ps aux | head and find the PID of your own shell (echo $$).</li><li>Start sleep 300 &amp;, then find it with ps aux | grep sleep and stop it with kill.</li><li>Run crontab -l and check /etc/cron.d/. What’s scheduled?</li><li>Start a long command, press Ctrl + Z, run fg. What changed?</li></ol><p><em>Next: Part 3, packages, logs, and the art of reading evidence.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32b4d8cba89f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lost in a Linux Terminal? Here’s Where Every Red Teamer Starts(Part 1)]]></title>
            <link>https://medium.com/@stevenwael371/lost-in-a-linux-terminal-heres-where-every-red-teamer-starts-part-1-c9ef60ebbcfa?source=rss-0f01b65c0ca7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9ef60ebbcfa</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Steven Wael]]></dc:creator>
            <pubDate>Wed, 18 Nov 2026 14:18:20 GMT</pubDate>
            <atom:updated>2026-11-18T14:18:20.987Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A blinking cursor, no mouse, no menu. These are the first commands every Red Teamer reaches for.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AVMJPqQA9dB9tZ7ohLvEFA.png" /></figure><p>It’s 11:47 PM. You just landed a shell on a lab machine.</p><p>No desktop. No icons. No mouse. Just a blinking cursor.</p><p>What do you type first?</p><p>That was exactly Adam’s problem. He had watched dozens of pentesting videos and finished a few TryHackMe rooms, but the moment he faced a bare terminal, his mind went blank.</p><p>His mentor Alex, an experienced penetration tester, texted him one line: <em>“Authorized lab machine. Investigate it. Where do you start?”</em></p><p><strong>Adam:</strong> “Honestly? I don’t know. Should I open something?”</p><p><strong>Alex:</strong> “Before anything else, understand where you are.”</p><blockquote><em>Everything in this series is for authorized lab machines only. Screenshots are from my lab; yours will differ.</em></blockquote><p>1. Where am I, where can I go, and what’s here?</p><p><strong>Alex:</strong> “Linux works through commands. Three questions will carry you a long way.”</p><p>Where am I?</p><pre>pwd</pre><pre>/home/adam</pre><p>Where can I go?</p><pre>cd /etc</pre><p>Handy shortcuts:</p><pre>cd ..       # one directory back<br>cd /        # root directory<br>cd ~        # your home directory<br>cd -        # previous directory</pre><p>What’s inside?</p><pre>ls -la</pre><p><strong>Adam:</strong> “Why are some names starting with a dot?”</p><p><strong>Alex:</strong> “Hidden files. ls alone skips them, ls -a shows them. Attackers and admins both love hidden files, so always look.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAbNsMnizUOXSELvDfMgmA.png" /></figure><h3>2. Reading files without drowning</h3><p>Adam found a folder full of configuration files.</p><p><strong>Adam:</strong> “How do I see what’s inside?”</p><p><strong>Alex:</strong> “Depends on the size.”</p><pre>cat /etc/passwd</pre><p>cat prints the whole file. Great for small files.</p><p>For big files, use less. You can scroll, search with /word, and quit with q.</p><pre>less /etc/passwd</pre><p>Or peek at just the edges:</p><pre>head -n 3 /etc/passwd    # first 3 lines<br>tail -n 4 /etc/passwd    # last 4 lines</pre><p><strong>Alex:</strong> “You don’t always need to read everything. Sometimes the first or last few lines tell you enough.”</p><p>Then Adam hit a strangely named file and typed the name. Nothing worked.</p><pre>cat &quot;./--spacee in this filename--&quot;</pre><p><strong>Alex:</strong> “Spaces and dashes confuse the shell. Wrap the name in quotes, and start with ./ so a leading dash isn’t mistaken for an option.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P-Y3R3FTs1rEgvS-zcA66w.png" /></figure><h3>3. What kind of thing am I looking at?</h3><pre>file /etc/passwd<br>hostname</pre><ul><li>file identifies the <em>real</em> file type, whatever the extension says.</li><li>hostname tells you which machine you’re on.</li></ul><p><strong>Alex:</strong> “Reconnaissance starts with understanding what you’re looking at.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-4AVfj88fKhCEd1-kmiHMQ.png" /></figure><h3>4. Searching for clues</h3><p><strong>Alex:</strong> “Find every file named file.txt on this machine.”</p><pre>find / -name &quot;file.txt&quot; 2&gt;/dev/null</pre><p>2&gt;/dev/null hides the flood of “Permission denied” errors.</p><p>A faster alternative uses a prebuilt database, so results can be outdated:</p><pre>locate file.txt</pre><p>Search <em>inside</em> files with grep, and count with wc:</p><pre>grep &quot;root&quot; /etc/passwd<br>wc /etc/passwd</pre><p>wc prints lines, words, and bytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MFwTMIP0ZwpMHSkVgS9R9Q.png" /></figure><h3>5. Moving files around</h3><p>Alex’s next task: pull a file from an authorized lab server.</p><pre>wget https://example.com/file.txt<br>curl -O https://example.com/file.txt</pre><p><strong>Adam:</strong> “They look the same.”</p><p><strong>Alex:</strong> “Close, but wget is for downloading. curl is a Swiss army knife for talking to URLs: HTTP requests, APIs, uploads. And for machine-to-machine copies over SSH, there’s scp.”</p><pre>scp file.txt user@192.168.1.10:/home/user/     # send<br>scp user@192.168.1.10:/home/user/file.txt .    # fetch</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9N2dIW7-kyy385uUSm6Aw.png" /></figure><h3>6. Connecting to another machine</h3><pre>ssh user@192.168.1.10<br>ssh -p 2222 user@192.168.1.10<br>ssh user@192.168.1.10 &quot;mkdir workstation&quot;</pre><p>The second uses a custom port. The third runs one command remotely without opening a shell.</p><p><strong>Alex:</strong> “SSH is the backbone of remote administration. Always verify the target and make sure you’re authorized to touch it.”</p><p>For the first time, Linux didn’t feel completely foreign to Adam.</p><p>Then his terminal showed something odd: a process he didn’t start.</p><p><strong>Alex:</strong> “Good eye. Next, we find out what’s running in the background.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qTTDVvyxEIYiEJO1rgiVWA.png" /></figure><h3>Try it yourself</h3><ol><li>Run pwd, then cd /etc, then cd -. Where do you end up?</li><li>In your home directory, run ls and then ls -la. What extra files appear?</li><li>Find every .conf file under /etc: find /etc -name &quot;*.conf&quot; 2&gt;/dev/null | head</li><li>Practice in a legal sandbox: TryHackMe’s <em>Linux Fundamentals</em> rooms are a great fit.</li></ol><p><em>Next: Part 2, what’s secretly running on this machine.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9ef60ebbcfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>