<?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 Cy5ec-rhythm on Medium]]></title>
        <description><![CDATA[Stories by Cy5ec-rhythm on Medium]]></description>
        <link>https://medium.com/@Cy5ec-rhythm?source=rss-961956be0605------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5AIbgvf5vQYI5J0xAfuM7A.png</url>
            <title>Stories by Cy5ec-rhythm on Medium</title>
            <link>https://medium.com/@Cy5ec-rhythm?source=rss-961956be0605------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 15:17:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Cy5ec-rhythm/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[AI Security | How Does Machine Learning Actually Learn? | AIS3]]></title>
            <link>https://medium.com/@Cy5ec-rhythm/ai-security-how-does-machine-learning-actually-learn-ais3-0bdd24dcd7fa?source=rss-961956be0605------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bdd24dcd7fa</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Cy5ec-rhythm]]></dc:creator>
            <pubDate>Tue, 03 Nov 2026 14:51:25 GMT</pubDate>
            <atom:updated>2026-11-03T14:51:25.595Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Datasets, features, labels, training, testing and inference — explained</em></p><p>Last time I wrote about the difference between AI, machine learning and deep learning. That was the easy part, honestly. This week I wanted to go one level deeper and figure out how ML actually learns.</p><p>Because “the model learns from data” is one of those phrases everyone says, but nobody really explains. What does learning even mean here? Is the model sitting there thinking? Does it memorise things?</p><p>Turns out it’s none of that. It’s basically maths adjusting itself until it makes fewer mistakes. Which sounds less exciting, but once you get it, a lot of other stuff starts making sense.</p><p>This clicked for me when I was testing one of my bug bounty targets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fvaejR6uV3QxJ2wMQWHy5w.png" /></figure><h3>Start with the data</h3><p>Everything in ML starts with data. No data, no learning. Simple as that.</p><p>In security, data is everywhere. Login records. Network traffic. Email headers. System logs. DNS queries.</p><p>But raw data on its own isn’t super useful. A bunch of log lines doesn’t mean anything to a model until you shape it into something it can work with.</p><p>That’s where the idea of a <strong>dataset</strong> comes in.</p><p>A dataset, at its simplest, is just a structured pile of examples. Think spreadsheet. Rows are individual examples — a login attempt, an email, whatever. Columns are the details about each one.</p><p>Let’s say you’re building a model to catch suspicious logins. Yours might look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*sPC1fPxbF0VEbG3LBEJudA.png" /></figure><p>Each row is one login event. Each column tells you something about that event. And the last column is the answer — was it normal or suspicious?</p><p>That last column is important. It’s called the <strong>label</strong>.</p><h3>Features and labels</h3><p>Let me break down the two most important words in ML, because I mixed them up for ages.</p><p><strong>Features</strong> are the inputs. They’re the pieces of information you give the model to work with. In the login example, features would be things like:</p><ul><li>Number of failed attempts</li><li>Time of day</li><li>Whether the device is known</li><li>Whether the location looks odd</li></ul><p><strong>Labels</strong> are the answers. They’re what you want the model to predict. In this case, the label is either “normal” or “suspicious.”</p><p>So features go in, label comes out. That’s the basic flow.</p><p>I got these mixed up at first, honestly. Kept thinking the label was just another feature. It’s not.</p><p>The label is the thing you’re trying to predict — the answer you hold back during training and check against at the end.</p><p>Easiest way to think about it is like a flashcard. Features are the question side. Label is the answer side. You show the model the question, it takes a guess, then you flip the card and see if it got it right.</p><h3>Training vs testing</h3><p>For the longest time I didn’t get why you’d hold back data. Like, why not just throw everything at the model?</p><p>Turns out if you do that, the model has basically already seen the answers. It’ll look amazing on the stuff it trained on, but you have zero clue if it works on anything new.</p><p>That’s overfitting. Super common beginner mistake. The model just memorises the training data instead of actually getting the pattern. Aces the practice questions, then completely bombs the real exam.</p><p>So you split your data into two parts:</p><ul><li><strong>Training set</strong> — usually around 70–80% of your data. This is what the model learns from.</li><li><strong>Test set</strong> — the remaining 20–30%. This is what you use to check if the model actually works on new data.</li></ul><p>The model never sees the test set during training. It only gets to look at it at the end, when you want to see how well it performs.</p><p>It’s basically like revising for an exam. You study one set of questions, then test yourself on different ones you’ve never seen. If you ace the practice stuff but bomb the actual exam, you know you just memorised it instead of actually understanding it.</p><p>Same idea here.</p><h3>How training actually works</h3><p>This is the part I found most interesting, because “learning” sounds vague until you see what’s actually happening.</p><p>Under the hood, a model is basically a bunch of numbers — called weights — that decide how much each feature matters.</p><p>At the start, those weights are basically random. The model has no idea what it’s doing. It’ll look at a login event and guess randomly whether it’s normal or suspicious.</p><p>Then you check: was the guess right or wrong?</p><p>If it was wrong, the model adjusts its weights slightly. Maybe it decides “failed attempts” should matter a bit more. Or “time of day” should matter a bit less.</p><p>Then it tries again on the next example. Guesses. Checks. Adjusts.</p><p>This happens thousands, sometimes millions of times. Each time, the model gets a tiny bit better at guessing.</p><p>That’s what “learning” actually means. It’s not thinking. It’s not understanding. It’s just repeated small adjustments until the mistakes get fewer.</p><p>There’s a fancy term for this — <strong>gradient descent</strong> — but you don’t need to know the maths to get the idea. The model is basically walking downhill on a landscape of errors, trying to find the lowest point where it makes the fewest mistakes.</p><p>I found that analogy helpful. The model doesn’t know where the bottom is. It just takes small steps in whatever direction reduces the error, over and over, until it gets there.</p><h3>Inference: using the model</h3><p>Once training is done, you have a model that can make predictions on new data.</p><p>That’s called <strong>inference</strong>.</p><p>It’s basically the model doing its job in the real world. A new login comes in, the model looks at the features, runs them through everything it learned, and spits out a prediction: “suspicious” or “normal.”</p><p>Important thing to remember: at inference time, the model isn’t learning anymore. It’s frozen. It’s just applying what it already learned.</p><p>Training is the slow, expensive part. Inference is fast and cheap. That’s why you can run a trained model on thousands of logins per second without breaking a sweat, but training it might have taken hours on a beefy machine.</p><p>In security, this is where the rubber meets the road. Your model gets deployed, starts watching live traffic, and starts flagging things. This is also where you find out if it actually works — because real-world data is messier than your training data ever was.</p><h3>A quick security example</h3><p>Let’s say you’re trying to build something that catches suspicious logins. Where do you even start?</p><p>Honestly, you start with old logs. Pull a few thousand login records, whatever you’ve got sitting around. Nothing fancy.</p><p>Then comes the boring part — labelling. Someone (probably a security analyst, probably not enjoying it) goes through and marks each one normal or suspicious. Painful, tedious, but it matters. Feed the model garbage labels and you’ll get a garbage model, no two ways about it.</p><p>After that you figure out which details actually matter. Failed attempts, time of day, known device or not, weird location or not. Those become your features.</p><p>Then you split everything. Usually 80/20 — most for training, a chunk held back for testing later. Don’t skip this part, it’ll bite you.</p><p>Training is where the model basically hammers through the training data over and over, nudging its internal weights a bit every time it guesses wrong. Slowly gets less terrible at it.</p><p>Once that’s done, you throw the test data at it — stuff it’s never laid eyes on. Getting 90% right? Decent. Only 55%? Something’s broken. Could be the features were useless, could be the labels were a mess.</p><h3>Things that tripped me up</h3><p>A few mistakes I made early on, in case they help anyone else:</p><ul><li>I thought more data always meant a better model. Not always — messy or biased data can hurt more than it helps.</li><li>I mixed up features and labels more than once. Features are inputs, labels are the answer.</li><li>I didn’t get why you split data into training and testing. Now I get it — you need unseen data to check if the model actually learned something general.</li><li>I assumed “learning” meant the model was thinking. It’s not. It’s just maths adjusting numbers until errors go down.</li></ul><h3>What stuck with me</h3><p>The biggest thing I took away is that ML isn’t magic. It’s a very systematic process of showing a model examples, letting it make guesses, and nudging it when it’s wrong.</p><p>Once you see it that way, a lot of the mystery falls away. The model isn’t smart. It’s just very good at spotting patterns in data — if you give it good data and enough chances to practise.</p><p>What surprised me most was how fast this stuff has improved. A year ago, AI-generated images and animations were still pretty rough. Now models can produce animations that look almost perfect. I think part of it is that models are being trained in a way that lets them adapt to what the user actually wants, instead of just spitting out generic results.</p><p><strong>Next article:</strong> <em>The role of Python and data in AI for cybersecurity.</em></p><p>Once you get how models learn, the next thing you start wondering is how people actually get the data ready and feed it into something useful. Turns out Python is a big part of that.</p><p><em>Question to leave you with: if a model gets 99% accuracy on its training data but only 60% on new data, what do you think went wrong?</em></p><p>Keep H4cking</p><p><em>~Sh4d0w</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bdd24dcd7fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Security | AI vs Machine Learning vs Deep Learning — What I Actually Figured Out | AIS2]]></title>
            <link>https://medium.com/@Cy5ec-rhythm/ai-security-ai-vs-machine-learning-vs-deep-learning-what-i-actually-figured-out-ais2-1939e42afbfb?source=rss-961956be0605------2</link>
            <guid isPermaLink="false">https://medium.com/p/1939e42afbfb</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[ai-security]]></category>
            <dc:creator><![CDATA[Cy5ec-rhythm]]></dc:creator>
            <pubDate>Tue, 27 Oct 2026 13:31:01 GMT</pubDate>
            <atom:updated>2026-10-27T13:31:01.588Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Three terms I kept mixing up, and how I finally made sense of them (with security examples).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1LzG9RktR3gohjoMvbYTg.png" /></figure><p>I kept seeing the same three words everywhere when I first got into AI. Artificial intelligence. Machine learning. Deep learning.</p><p>At first I honestly thought they were all the same thing. Just different names for “smart computer stuff.”</p><p>Then I noticed security companies doing it too. One page says “AI-powered detection.” Another says “deep learning engine.” Another says “ML-driven analytics.” Same product, three buzzwords, no explanation. Like many youtubers and Instagram influencers keep posting the roadmap of AI Security… But here comes a catch, there are two things in AI Security. One is Securing AI (Protecting AI from attackers) which is Defensive or Blue teaming and AI Pentesting (finding bugs in AI agents or models) which is Offensive or Red teaming. <br>And wait there is one more thing which is… protecting the organization with AI models and testing the organization with AI. (We’ll discuss them later.)<br>So, the influencers must be specific about there roadmaps to avoid confusion.</p><p>Nvm, I sat down and tried to sort it out for myself. This is me explaining it, mostly with security examples because that’s what I care about.</p><p>I’m not an ML researcher or anything. Just someone who got tired of nodding along whenever these words came up.</p><h3>Basic idea..</h3><p>AI is the big umbrella term. It just means getting a computer to do stuff that normally needs a human brain — spotting patterns, understanding language, making a call on something.</p><p><strong>Machine learning</strong>, or ML, is one way to actually build AI. Instead of sitting down and writing a bunch of rules yourself, you show the computer loads of examples and let it figure out the patterns on its own.</p><p><strong>Deep learning</strong> is a specific type of machine learning. It uses neural networks with lots of layers stacked on top of each other, and it’s the tech behind things like ChatGPT, Claude, Deepseek, Gemini and plenty of other AI models in market these days.</p><p>So if you picture it as circles: <strong>AI is the biggest one. Machine learning sits inside that. And deep learning sits inside machine learning.</strong></p><p>That’s honestly the whole concept in a nutshell. Everything else is just extra detail.</p><h3>What AI actually means</h3><p>AI stands for artificial intelligence. It just means getting a computer to do something we’d normally expect a person to do.</p><p>Spotting patterns. Understanding language. Making a decision. Recognising a face. Filtering spam.</p><p>Here’s the part that surprised me: AI does <strong>not</strong> have to learn from data.</p><p>A simple program with a bunch of “if this, then that” rules still counts as AI.</p><p>Say a security tool has this rule: “if someone types the wrong password more than 5 times, send an alert.”</p><p>That’s not machine learning. Nobody trained it on data. Someone just wrote that rule by hand. But it’s still AI, because it’s doing a job we’d normally ask a human to do — spotting suspicious behaviour.</p><p>Why does this matter in security? Volume, mostly.</p><p>Think about how many login attempts, emails, network connections and system logs a company produces every day. Thousands. Maybe millions. No security team can read all of that.</p><p>So AI helps by flagging the strange stuff and pushing it to the top of the pile.</p><p>But “strange” doesn’t always mean “dangerous.” Sometimes it’s just someone travelling and logging in from a new country. The system gets things wrong. A human still needs to check.</p><p>There’s also a trap I fell into early on: assuming “AI-powered” on a product page means something sophisticated. Sometimes it does. Sometimes it’s literally a few regex rules with a fancy name. Marketing loves the word AI because it sells.</p><h3>What machine learning means</h3><p>Machine learning is a way of building AI where you <strong>don’t write the rules yourself</strong>.</p><p>Instead, you show the computer lots of examples, and it figures out the pattern on its own.</p><p>Let’s use suspicious logins as an example.</p><p>Say a company wants to spot when someone might be trying to break into an account. They collect old login records. Each record has stuff like how many times the password was typed wrong, what time of day it happened, whether it came from a known device, whether the location looks normal.</p><p>Then someone — usually a security analyst — goes through the old records and marks them. “This one was normal.” “This one was suspicious.”</p><p>Now you have labelled examples. You feed all of this into a machine learning model, and it starts noticing patterns.</p><p>Maybe it learns things like: lots of failed attempts plus a new device plus a weird time often means suspicious. Or one failed attempt on a known device at a normal time is usually fine.</p><p>After training, when a new login happens, the model looks at the details and makes a guess. “This looks suspicious” or “this looks fine.”</p><p>The key word is <strong>guess</strong>.</p><p>The model doesn’t actually know what an attacker is thinking. It has no idea about intent. It’s just comparing the new login to patterns it saw in the training data.</p><p>And sometimes it’s wrong.</p><p>Maybe the CEO is travelling, logs in from a new phone, and types the password wrong twice. The model might flag that as suspicious. It’s not “wrong” in a technical sense — it’s just matching a pattern. A human still needs to look.</p><p>Compare that to the old way: one simple rule, like “more than 5 failed attempts = alert.”</p><p>That rule is easy to understand. Anyone can understand it and can come to conclusion that exactly why it executed. It works well when you already know the pattern and what rules are feed into the system.</p><p><strong>ML starts to make sense when the pattern is too messy for a few simple rules.</strong></p><p>Neither is automatically better. Real security systems often use both — simple rules for known problems, ML for messier stuff.</p><p>One thing that took me a while to get: ML models are only as good as their training data. Garbage in, garbage out. If your “suspicious login” labels came from a team that only ever looked at obvious cases, your model has learned to spot obvious cases. It’ll miss the subtle ones. That’s a data problem, not a model problem, but it shows up as a model problem.</p><h3>What deep learning means</h3><p>Deep learning is a type of machine learning that uses <strong>neural networks with many layers</strong>.</p><p>“Deep” just means “lots of layers.” That’s it. Nothing mystical.</p><p>Neural networks were loosely inspired by how brain cells connect, but they’re not actually like a brain. They’re maths running on a computer.</p><p>The idea is that each layer adds a bit more understanding on top of the last one, so by the time you get deep into the network, it’s picking up on much more complex patterns.</p><p>Take an image model, for example. The first few layers might just pick up on really simple stuff — edges, lines, basic shapes. Then the middle layers start recognising textures or parts of objects. And by the time you get to the later layers, the model can actually identify whole things, like “oh, that’s a cat.”</p><p>Text works similarly. Early layers pick up simple word patterns. Later layers pick up meaning and context.</p><p>Phishing emails are a good example of where deep learning makes sense.</p><p>A phishing email has lots going on at once. The wording (“urgent action required!”). The links — do they look real? The sender address — does it match the company? The overall tone — does it feel rushed or threatening?</p><p>All of these interact in complicated ways. You’d struggle to write rules covering every combination.</p><p>But feed a deep learning model thousands or millions of example emails — some real, some phishing — and it starts picking up those subtle patterns itself.</p><p>This is also the tech behind modern AI chatbots like ChatGPT.</p><p>But deep learning isn’t a free upgrade. It needs a lot of data. It needs a lot of computing power. And it’s hard to explain why it made a decision.</p><p>That last one matters in security. If a system blocks an email or locks an account, someone might ask “why?” With a simple rule, you can point at the exact rule. With a deep learning model, it’s much harder.</p><p>So if your problem is simple, or you don’t have much data, a basic ML model is often smarter.</p><p>I had to remind myself of this more than once: bigger model doesn’t always mean better security.</p><h3>How they fit together</h3><p>Think nested circles.</p><p>AI is the biggest circle — the whole field. Machine learning is a smaller circle inside AI. Deep learning is an even smaller circle inside ML.</p><p>A lot of people assume AI and ML mean the same thing, but they don’t. Even something as basic as a rules-based system counts as AI — it just doesn’t learn from data.</p><p>The easiest way to keep it straight: AI is the big goal, ML is one way to reach it, and deep learning is one specific type of ML.</p><h3>Phishing, three ways</h3><p>Say a company wants to stop phishing emails.</p><p><em>Start with rules. The filter checks known red flags. Link text says “click here” but goes somewhere weird. Sender address looks almost right but not quite — </em><em>paypa1.com instead of </em><em>paypal.com. Urgent language like “act now or lose access.”</em></p><p>Simple, predictable. You can see exactly why an email got flagged. Problem is attackers just change the wording and slip past.</p><p><em>Then try ML. Train on thousands of emails — some real, some phishing. Model learns from sender details, link patterns, word choices. Gets better at catching phishing that doesn’t match obvious rules. But it depends heavily on training data. If it only saw old-style phishing, it might miss new tricks.</em></p><p><em>Then deep learning. Picks up subtle patterns in the actual text. Better with messy, complicated language. Still gets things wrong though, and harder to explain why it flagged something.</em></p><p>Which should they use? Depends.</p><p>Rules for known patterns. Classic ML for structured data like login records. Deep learning for messy text at scale.</p><p>A real system would probably mix all three and send uncertain cases to a human.</p><p>Goal isn’t the fanciest tech. It’s solving the problem reliably.</p><h3>A tiny example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*lfIVKa5M1PJT9edFs2l1JA.png" /><figcaption>Made-up login data</figcaption></figure><p>“More than 5 failed attempts” rule flags C and D.</p><p>A trained ML model would look at more than just failed attempts. It’d also weigh device, time, location, and compare against past cases.</p><p>Deep learning on four rows would be absurd. You’d need way more data.</p><p>This is just an illustration, not a real experiment. Haven’t tested anything. Without real data and proper testing, can’t say which would work best.</p><p>C might be the CEO fat-fingering a password on a new phone. A might be an attacker who got in first try. One signal never tells the whole story.</p><h3>Mistakes I made early on</h3><p>Thought AI always meant learning. <strong>It doesn’t</strong> — rules count too.</p><p>Assumed <strong>deep learning was always better. It’s not.</strong></p><p>Thought more data always helps. <strong>Bad data hurts more than it helps</strong> sometimes.</p><p>Assumed “AI-powered” on a product page meant advanced. Sometimes it’s just basic rules with a fancy name.</p><h3>What stuck</h3><p>AI is the wide field. ML learns from data. Deep learning is ML with multilayer nets.</p><p>Rules, ML and deep learning all have a place in security.</p><p>Bigger doesn’t mean better.</p><p>Nothing catches everything.</p><p>One thing that really stuck with me through all this — the model itself matters less than I thought it would. I kept obsessing over which architecture was “best” or whether deep learning was somehow superior, when really the thing making or breaking everything was the data going in.</p><p>Bad training data will sabotage even the fanciest model. Good data can make something simple work really well. That was a bit of a mindset shift for me.</p><p>So if someone asked me for advice now, I’d say don’t start by picking a tool. That’s putting the cart before the horse. Sit with the problem first. What are you actually trying to solve? Once that’s clear, the right approach usually becomes obvious. And sometimes — more often than people admit — that approach is just a simple rule. No model, no training, no fuss. It works, and that’s what matters.</p><p><strong>Next article:</strong> <em>How Does Machine Learning Actually Learn?</em></p><p><em>Question to leave you with: if a simple rule already catches a known attack, when is it worth bothering with ML?</em></p><p>Keep H4cking</p><p><em>~Sh4d0w</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1939e42afbfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AIS1 | AI Security | AI for Cybersecurity: What Is Artificial Intelligence, and Why Does Security…]]></title>
            <link>https://medium.com/@Cy5ec-rhythm/ais1-ai-security-ai-for-cybersecurity-what-is-artificial-intelligence-and-why-does-security-b93cebc593f1?source=rss-961956be0605------2</link>
            <guid isPermaLink="false">https://medium.com/p/b93cebc593f1</guid>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ai-basics]]></category>
            <category><![CDATA[ai-for-cybersecurity]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Cy5ec-rhythm]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 18:31:01 GMT</pubDate>
            <atom:updated>2026-10-19T18:31:01.357Z</atom:updated>
            <content:encoded><![CDATA[<h3>AIS1 | AI Security | AI for Cybersecurity: What Is Artificial Intelligence, and Why Does Security Need It?</h3><p><em>AIS1 is AI Security part 1.</em></p><p>Every day, countless login attempts, network connections, emails, and system events take place across the internet. Hidden among this massive amount of activity, there could be signs of a cyberattack. But how do we identify those signs before they turn into something serious?</p><p>This is where Artificial Intelligence (AI) comes into the picture.</p><p>AI is becoming an important part of cybersecurity, helping security teams analyze data, recognize suspicious patterns, and investigate potential threats. But how does it actually work? Can machines really learn to detect cyberattacks? And more importantly, can we trust them to make the right decisions?</p><p>These are some of the questions I want to explore through this series.</p><p><strong>This is Part 1 of my AI Security series.</strong> As a cybersecurity student, I’ve started learning about AI and its role in cybersecurity, and I thought, why not document the journey and share what I learn along the way?</p><p>The goal is simple: start from the basics, build a strong understanding of this domain, and gradually move toward practical experiments and security research. I’ll be learning, exploring, and sharing my progress, and if you’re interested in this field too, you’re welcome to join me.</p><p>So, let’s start with the most basic question: <strong>What exactly is Artificial Intelligence, and why does cybersecurity need it?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZkLNEc9T7fw6gNw-xeRkg.png" /></figure><h3>Introduction</h3><p>Artificial Intelligence (AI) is everywhere these days. From chatbots and image generators to self-driving cars, AI is changing how we interact with technology.</p><p>But there is another area where AI is becoming increasingly important: <strong>cybersecurity</strong>.</p><p>Think about it for a moment. Every day, organizations generate huge amounts of data from login attempts, network traffic, applications, emails, and user activities. Somewhere in all that data, there could be signs of a cyberattack.</p><p>The problem is that identifying those signs manually can be difficult, especially when an organization has thousands of devices and millions of events to monitor.</p><p>This is where AI can help.</p><p>But before we talk about using AI to detect cyberattacks, we need to understand what AI actually is, how it works, and what makes it different from traditional programming.</p><p>So, let’s start with the basics.</p><h3>1. What Exactly Is Artificial Intelligence?</h3><p>Artificial Intelligence is a field of computer science focused on building systems that can perform tasks normally associated with human intelligence.</p><p>These tasks can include recognizing patterns, understanding language, making predictions, and helping people make decisions.</p><p>For example, consider your email inbox.</p><p>When your email service identifies a message as spam, it is performing a task that involves recognizing patterns associated with unwanted emails.</p><p>Similarly, a security system might analyze login activity and identify behaviour that looks unusual.</p><p>In both cases, the system is using information to help make a decision.</p><p>However, AI does not think or understand everything the way a human does. Its capabilities depend on how it was designed, the data it receives, and the methods used to build it.</p><h3>A simple cybersecurity example</h3><p>Imagine an employee usually logs in to a company system from India during regular working hours.</p><p>One day, the system records a login from an unfamiliar location at an unusual time, followed by several failed login attempts.</p><p>This activity might be suspicious.</p><p>An AI-based security system could analyze these events, compare them with historical patterns, and flag the activity for investigation.</p><p>Notice something important here: <strong>the system is identifying a possible threat, not proving that an attack has occurred.</strong></p><p>The employee might be traveling, using a VPN, or simply having trouble remembering a password.</p><p>That distinction will become important as we explore AI in cybersecurity.</p><h3>2. How Is AI Different From Traditional Programming?</h3><p>To understand AI, let’s compare two ways of building a security system.</p><h3>Traditional programming</h3><p>In traditional programming, a developer writes explicit instructions that tell a computer what to do.</p><p>For example, we could create a simple rule:</p><ul><li>If a user has five failed login attempts within a short period, generate an alert.</li><li>Otherwise, do not generate that alert.</li></ul><p>The computer follows the rule we provide.</p><p>This approach is useful because the behaviour is clear and predictable. We know exactly why the system generates an alert.</p><p>However, attackers do not always follow the same pattern.</p><p>An attacker might try only two passwords per account but attempt those passwords against hundreds of accounts. A simple rule that checks only repeated failures against one account might miss the broader pattern.</p><h3>AI and machine learning</h3><p>Instead of relying only on manually written rules, we can use machine learning to identify patterns from data.</p><p>For example, a model could learn from historical login records containing features such as:</p><ul><li>Number of failed login attempts</li><li>Time of login</li><li>Whether the device is familiar</li><li>Whether the location is unusual</li><li>Number of accounts accessed from the same source</li></ul><p>After learning from suitable training data, the model can estimate whether new activity resembles previously observed suspicious behaviour.</p><p>It may identify combinations of signals that are difficult to capture with a small set of manually written rules.</p><p>Here is a simple comparison:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*vZ5FBIixDGEfx8yFcEmS1A.png" /></figure><p><strong>This does not mean AI is always better.</strong></p><p>A carefully written rule can be more reliable than a poorly trained model. Traditional rules are also useful when a security policy must be enforced exactly.</p><p><strong>In real cybersecurity systems, traditional rules and AI can complement each other.</strong></p><p>For example, a system could use a strict rule to block a known malicious IP address while using machine learning to identify unusual login behaviour.</p><h3>3. What Is Machine Learning, and How Does It Work?</h3><p>Machine learning (ML) is a branch of AI that allows computer systems to learn patterns from data and use those patterns to make predictions or decisions.</p><p><strong><em>You do not need to understand complicated mathematics to grasp the basic idea.</em></strong></p><p>Let’s walk through a simple example.</p><p>Imagine that we want to build a system that helps identify suspicious login attempts.</p><h3>Step 1: Collect data</h3><p>First, we need examples of login activity.</p><p>A simplified dataset might look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*OnZAJ0C0U9-LKrw5pgHvIw.png" /></figure><p><strong><em>The first two columns describe the activity. These are called features.</em></strong></p><p><strong><em>The final column tells us the expected category. This is called the label.</em></strong></p><p>For this example, we are assuming the labels have been correctly assigned during investigation. In real environments, determining whether an event was genuinely malicious can be much harder.</p><h3>Step 2: Train the model</h3><p>We provide suitable historical examples to a machine learning algorithm.</p><p>During training, the algorithm adjusts its internal parameters to learn relationships between the features and the labels.</p><p>It might learn that repeated failures combined with an unusual location are associated with suspicious activity in the training data.</p><p>The model is not simply memorizing a universal rule that works everywhere. It is learning patterns from the examples it receives.</p><p>If the training data is incomplete, biased, or incorrectly labelled, the resulting model may perform poorly.</p><h3>Step 3: Make a prediction</h3><p>Now imagine that a new login attempt occurs with six failed attempts and an unfamiliar location.</p><p>The model analyzes the input and produces a prediction, such as a suspiciousness score or a predicted category.</p><p>The security system can then decide what to do with that result.</p><p>Depending on the design, it might generate an alert, request additional authentication, or send the event to a security analyst for review.</p><h3>Step 4: Evaluate the model</h3><p>We cannot assume that the model works just because it produces predictions.</p><p>We need to test it on data that was not used to train it and measure how well it performs.</p><p>For cybersecurity, some important measurements include:</p><ul><li><strong>Precision:</strong> Of the events flagged as suspicious, how many were actually suspicious?</li><li><strong>Recall:</strong> Of all the genuinely suspicious events in the test data, how many did the model identify?</li><li><strong>False-positive rate:</strong> How often did the system incorrectly flag normal activity?</li></ul><p>These measurements help us understand the model’s strengths and weaknesses.</p><p>For example, a system that flags almost every login as suspicious might catch many attacks, but it would also overwhelm the security team with alerts.</p><p>A useful model needs to balance detection with the cost of incorrect alerts and missed attacks.</p><h3>A quick note: not all AI learns the same way</h3><p>The example above uses <em>supervised learning</em>, where training data contains labels.</p><p>Other approaches exist too:</p><ul><li><strong>Unsupervised learning:</strong> Looks for patterns or groups in data without relying on predefined labels for every example.</li><li><strong>Reinforcement learning:</strong> Learns behaviour through interactions and feedback, often expressed using rewards.</li></ul><p>These approaches serve different purposes. They are not interchangeable, and not every AI security system uses machine learning.</p><p>For now, understanding supervised learning is enough to get us started.</p><h3>4. How Is AI Used in Cybersecurity Today?</h3><p>Now that we understand the basics, let’s explore some practical applications.</p><h3>A. Phishing detection</h3><p>Phishing emails try to trick people into revealing credentials, downloading malicious files, or visiting fraudulent websites.</p><p>AI models can analyze signals such as email content, sender information, links, and message patterns to help identify suspicious messages.</p><p>For example, a message claiming to come from a company’s IT department might ask an employee to verify their password through an unfamiliar link.</p><p>A detection system could identify several suspicious signals and flag the message.</p><p>However, attackers can change their wording, imitate legitimate communication, and exploit trusted accounts. AI-based detection therefore needs to work alongside other security controls.</p><h3>B. Network intrusion detection</h3><p>Organizations monitor network activity to identify possible intrusions.</p><p>Machine learning models can analyze network-related features and help identify traffic that differs from expected patterns.</p><p>For example, a device that normally communicates with a few internal services might suddenly begin making connections to many unfamiliar destinations.</p><p>That change could justify an investigation.</p><p>But unusual traffic is not automatically malicious. Software updates, backups, and legitimate administrative tasks can also create unusual patterns.</p><p>This is why context matters.</p><h3>C. Malware detection</h3><p>Traditional antivirus tools can use signatures to identify known malicious files.</p><p>Machine learning can complement signature-based detection by analyzing features of files or their behaviour to estimate whether they may be malicious.</p><p>This can help identify some threats that do not match previously known signatures.</p><p>Still, an AI model can misclassify both legitimate and malicious files. Its predictions need to be evaluated carefully, especially before taking disruptive actions.</p><h3>D. Fraud and account abuse detection</h3><p>AI is also useful for identifying potentially fraudulent transactions and suspicious account activity.</p><p>A system might consider transaction amounts, frequency, device information, and deviations from a customer’s usual behaviour.</p><p>Similar ideas can help security teams investigate account takeover attempts, automated abuse, and unusual access patterns.</p><p>The important point is that AI can help prioritize events for investigation. It does not automatically know whether every unusual event is fraudulent.</p><h3>E. Security Operations Centers (SOCs)</h3><p>A Security Operations Center, or SOC, monitors systems, investigates alerts, and responds to potential security incidents.</p><p>SOC analysts often have to work through large volumes of logs and alerts.</p><p>AI can assist with tasks such as grouping related alerts, summarizing events, identifying patterns, and helping analysts investigate incidents.</p><p>Generative AI tools can also help explain unfamiliar log entries or summarize investigation notes.</p><p>However, an AI-generated explanation may be incomplete or incorrect. Analysts still need to validate important conclusions against actual evidence.</p><p>Across these applications, the same principle applies: <strong>AI can help security teams process information and identify potential threats, but its output is not a substitute for evidence and sound security decisions.</strong></p><h3>5. Can We Trust AI to Detect Every Cyberattack?</h3><p>The short answer is no.</p><p>AI is a useful security tool, but it has limitations. Understanding those limitations is just as important as understanding its capabilities.</p><h3>False positives</h3><p>A false positive occurs when a system flags legitimate activity as malicious.</p><p>For example, an employee might travel to a new country and log in from an unfamiliar location.</p><p>An AI system could flag the login because it differs from the employee’s usual behaviour, even though the login is legitimate.</p><p>Too many false positives can waste analysts’ time and cause alert fatigue.</p><h3>False negatives</h3><p>A false negative occurs when a system fails to identify genuinely malicious activity.</p><p>An attacker might deliberately keep activity within normal-looking limits or use stolen credentials in a way that resembles legitimate behaviour.</p><p>If the model does not recognize the pattern, the activity might go undetected.</p><p>Both types of error matter. A security system that rarely raises false alarms but misses important attacks is not necessarily a good system.</p><h3>Poor or incomplete training data</h3><p>Machine learning models depend on the quality and relevance of their training data.</p><p>If a model is trained mainly on attacks seen in the past, it may struggle with new techniques or environments that differ significantly from its training examples.</p><p>This is one reason why testing models on separate datasets and monitoring their performance over time is important.</p><h3>Adversarial behaviour</h3><p>Attackers can deliberately adapt their behaviour to avoid detection.</p><p>Depending on the system, they may manipulate input data, exploit weaknesses in a model, or try to influence the information used by an AI application.</p><p>This leads us to a broader field called <em>AI security</em>, which studies how AI systems can be attacked and how to protect them.</p><p>There is an important distinction here:</p><ul><li><strong>AI for cybersecurity</strong> means using AI to help defend systems.</li><li><strong>Security of AI</strong> means protecting AI models, applications, data, and supporting infrastructure from attacks.</li></ul><p>These two areas overlap, but they are not the same.</p><p>For example, using machine learning to detect malicious network traffic is AI for cybersecurity. Protecting a chatbot from prompt injection is security of AI.</p><p>We will explore both areas as this series develops.</p><h3>Lack of human judgment</h3><p>AI predictions do not automatically account for every business requirement, operational risk, or unusual circumstance.</p><p>Imagine a model flags a login as suspicious. Immediately blocking the account might prevent an attacker from proceeding, but it could also interrupt a critical employee during an emergency.</p><p>A safer design might request additional authentication, limit access temporarily, or send the event to a security analyst, depending on the risk.</p><p>The response should be proportionate to the threat and the potential impact of getting the decision wrong.</p><p><strong>The goal is not to trust AI blindly or reject it completely. The goal is to understand where it helps, measure where it fails, and design safeguards around its decisions.</strong></p><h3>6. What Should We Learn Next?</h3><p>This article is only the starting point.</p><p>Before building AI-based security tools, we need to understand the underlying concepts well enough to know what our models are doing and how to evaluate their results.</p><p>Here is the path I plan to follow in this series:</p><ol><li><strong>AI fundamentals:</strong> Understanding artificial intelligence, machine learning, and deep learning.</li><li><strong>Python and data:</strong> Learning how to prepare and analyze datasets.</li><li><strong>Machine learning in practice:</strong> Training a basic classification model and evaluating its predictions.</li><li><strong>AI for cybersecurity:</strong> Applying machine learning to phishing detection, anomaly detection, and intrusion detection.</li><li><strong>AI security:</strong> Exploring prompt injection, data poisoning, adversarial machine learning, and LLM security.</li></ol><p>The aim is to move gradually from understanding the concepts to testing them ourselves.</p><h3>Final Thoughts</h3><p>AI is becoming an important part of cybersecurity because security teams need ways to analyze large amounts of information, identify suspicious patterns, and prioritize potential threats.</p><p>Machine learning can help identify patterns that would be difficult to capture using only manually written rules. But it also introduces challenges, including false positives, missed attacks, unreliable predictions, and dependence on training data.</p><p>That is why learning AI for cybersecurity should involve more than just learning how to use a model. We also need to understand how it learns, how it can fail, and how to evaluate its performance.</p><p>For me, this is what makes the field interesting. We are not just asking whether AI can detect a cyberattack. We are also asking how reliably it can do so, what happens when it makes a mistake, and how we can build safer systems around it.</p><p>This is the first article in my journey to understand AI for cybersecurity, starting with the basics and gradually moving toward practical experiments and AI security research.</p><p><strong>Next article:</strong> <em>AI vs Machine Learning vs Deep Learning: What’s the Difference?</em></p><p>Keep Hacking</p><p>~Sh4d0w</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b93cebc593f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nmap for Hackers: The Practical Guide to Network Scanning]]></title>
            <link>https://medium.com/@Cy5ec-rhythm/nmap-for-hackers-the-practical-guide-to-network-scanning-412297fc1b1f?source=rss-961956be0605------2</link>
            <guid isPermaLink="false">https://medium.com/p/412297fc1b1f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Cy5ec-rhythm]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 18:31:01 GMT</pubDate>
            <atom:updated>2026-10-12T18:31:01.961Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4znLXBKTVMLacV3l20K-g.png" /></figure><p>When you’re learning cybersecurity, Nmap is one of the tools you’ll come across pretty early.</p><p>I started looking into network scanning because I wanted to understand how we can discover open ports, identify services, and figure out what might be running on a target machine.</p><p>At first, the commands might look confusing. You see options like -sS, -sV, -sC, and -Pn, and it&#39;s easy to wonder what the difference actually is.</p><p>But once you understand what each option does, Nmap becomes much easier to work with.</p><p>In this guide, I’m covering the Nmap commands that are worth knowing, especially if you’re learning Kali Linux, networking, CTFs, or penetration testing.</p><p>I’ll explain what each command does, when you might use it, and what to look for in the output.</p><p>You don’t need to memorize everything in one sitting. The idea is to understand the basics and build from there.</p><p><strong>Let’s get started.</strong></p><p><em>Note: Use these commands only on your own systems, authorized lab machines, or targets where you have explicit permission to test.</em></p><h3>1. What exactly is Nmap?</h3><p>Nmap stands for <strong>Network Mapper</strong>.</p><p>It’s a network scanning tool that helps us discover hosts, check ports, and identify services running on a machine.</p><p>Let’s say you have a target machine in a CTF lab. Before investigating its services, you need to understand what’s exposed on the network.</p><p>That’s where Nmap comes in.</p><p>For example:</p><pre>nmap 192.0.2.10</pre><p>This runs a basic scan against the example IP address.</p><p>A typical result might look like this:</p><pre>PORT    STATE SERVICE<br>22/tcp  open  ssh<br>80/tcp  open  http<br>443/tcp open  https</pre><p>Here’s what the output tells us:</p><ul><li><strong>PORT:</strong> The port number and protocol.</li><li><strong>STATE:</strong> Whether Nmap considers the port open, closed, or filtered.</li><li><strong>SERVICE:</strong> The service commonly associated with that port.</li></ul><p>In this example, ports 22, 80, and 443 are reported as open.</p><p>That doesn’t automatically mean the machine is vulnerable. It simply gives us information about the services we can investigate further.</p><p>That’s the first thing to understand about Nmap: <strong>scanning is the starting point, not the entire security assessment.</strong></p><h3>2. Install Nmap on Kali Linux</h3><p>If you’re using Kali Linux, Nmap is usually already installed.</p><p>Check it with:</p><pre>nmap --version</pre><p>If it isn’t installed, run:</p><pre>sudo apt update<br>sudo apt install nmap</pre><p>To see the available options:</p><pre>nmap --help</pre><p>And if you want the detailed manual:</p><pre>man nmap</pre><p>You don’t need to read the entire manual right now. It’s useful when you want to understand a particular option in more detail.</p><h3>3. Run your first Nmap scan</h3><p>Let’s start with the most basic command:</p><pre>nmap 192.0.2.10</pre><p>Replace the example address with your authorized lab target.</p><p>By default, Nmap scans its 1,000 most common TCP ports.</p><p>You might see output like:</p><pre>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http</pre><p>This gives you a starting point.</p><p>If port 22 is open, you might investigate SSH. If port 80 is open, you might look at the web application.</p><p>One important detail: Nmap’s service name is initially based on the port’s usual assignment. It doesn’t guarantee that the expected software is actually running there.</p><h3>4. Scan multiple IP addresses</h3><p>Sometimes you have more than one machine to check.</p><p>You can scan multiple IP addresses in a single command:</p><pre>nmap 192.0.2.10 192.0.2.20</pre><p>You can also use a comma-separated list:</p><pre>nmap 192.0.2.10,192.0.2.20,192.0.2.30</pre><p>This is useful when working with a lab containing several machines.</p><h3>5. Scan an IP range</h3><p>What if you want to scan a range of addresses?</p><p>For example:</p><pre>nmap 192.0.2.1-20</pre><p>This scans the addresses from 192.0.2.1 through 192.0.2.20.</p><p>You can also use CIDR notation:</p><pre>nmap 192.0.2.0/24</pre><p>A /24 IPv4 network contains 256 addresses.</p><p>Before scanning a range, make sure you understand which devices it includes. A single command can send traffic to many machines.</p><h3>6. Discover live hosts</h3><p>Sometimes you don’t need port information yet. You just want to know which hosts appear to be online.</p><p>Use:</p><pre>nmap -sn 192.0.2.0/24</pre><p>The -sn option disables port scanning and performs host discovery.</p><p>This is useful when you’re mapping your own lab network before investigating individual machines.</p><p>Keep in mind that a machine can be running but still fail to respond to Nmap’s discovery probes. Firewalls and network configurations can affect the result.</p><h3>7. Scan specific ports</h3><p>Suppose you only want to check ports 22, 80, and 443.</p><p>You can do that with:</p><pre>nmap -p 22,80,443 192.0.2.10</pre><p>To scan only port 22:</p><pre>nmap -p 22 192.0.2.10</pre><p>This is useful when you want to investigate a particular service without scanning the default set of ports.</p><p>Here are a few common port assignments:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*eyXFwxbvm9Jd7NXfVcqfLA.png" /></figure><p>These are common assignments, not guarantees. Services can run on different ports.</p><h3>8. Scan all TCP ports</h3><p>A basic Nmap scan checks 1,000 common TCP ports. What if the service you’re looking for is running on another port?</p><p>Use:</p><pre>nmap -p- 192.0.2.10</pre><p>The -p- option selects all 65,535 TCP ports.</p><p>This can help you discover services running on nonstandard ports, such as a web application listening on port 8080.</p><p>The downside is that scanning all ports can take longer, especially when the target filters probes or the network is slow.</p><h3>9. Identify service versions</h3><p>Finding an open port is useful, but knowing which service is running can tell you more.</p><p>Use:</p><pre>nmap -sV 192.0.2.10</pre><p>The -sV option enables service and version detection.</p><p>An illustrative result might look like:</p><pre>PORT   STATE SERVICE VERSION<br>22/tcp open  ssh     OpenSSH ...<br>80/tcp open  http    nginx ...</pre><p>The actual output depends on the target.</p><p>Why does this matter?</p><p>Because service identification helps you decide what to investigate next. In an authorized lab, you can research a detected version and check whether there are relevant security advisories.</p><p>Don’t assume a version string proves that a system is vulnerable. The software may have patches or configuration changes that affect its security.</p><h3>10. Detect the operating system</h3><p>Nmap can also attempt to estimate the target’s operating system.</p><pre>sudo nmap -O 192.0.2.10</pre><p>The -O option enables OS detection.</p><p>Nmap analyzes network responses and compares them with known characteristics to find possible matches.</p><p>It might identify a likely operating system, but the result isn’t always exact. Virtual machines, firewalls, and unusual network configurations can affect detection.</p><p>Treat the result as an estimate rather than a confirmed fact.</p><h3>11. Combine OS and version detection</h3><p>Instead of running these checks separately, you can combine them:</p><pre>sudo nmap -sV -O 192.0.2.10</pre><p>This attempts to identify service versions and the operating system.</p><p>It’s useful when you want a broader picture of an authorized lab machine.</p><p>Remember that these additional checks generate more probes than a basic scan.</p><h3>12. Understand TCP SYN scanning</h3><p>One of the common Nmap scanning techniques is the TCP SYN scan.</p><pre>sudo nmap -sS 192.0.2.10</pre><p>The -sS option enables SYN scanning.</p><p>In a normal TCP connection, a client and server complete a handshake before exchanging application data.</p><p>A SYN scan sends an initial TCP SYN packet and interprets the response to determine the likely state of the port. It generally doesn’t complete the full TCP connection when a port responds as open.</p><p>This technique often requires administrator privileges.</p><p>It’s worth learning because it helps explain how TCP scanning works. However, it isn’t invisible — network monitoring tools can detect it.</p><h3>13. Use a TCP connect scan</h3><p>Another option is the TCP connect scan:</p><pre>nmap -sT 192.0.2.10</pre><p>The -sT option uses the operating system&#39;s connection function to establish TCP connections.</p><p>Unlike a SYN scan, it completes the TCP connection to an open port.</p><p>This is useful when you don’t have the privileges required for raw-packet scanning.</p><h3>14. Scan UDP ports</h3><p>Most beginners focus on TCP, but UDP matters too.</p><p>UDP is used by services such as DNS and NTP, among others.</p><p>To scan common UDP ports:</p><pre>sudo nmap -sU 192.0.2.10</pre><p>UDP scanning can be slower because many services don’t respond to unexpected probes.</p><p>You might see states such as:</p><pre>open<br>closed<br>open|filtered</pre><p>The open|filtered state means Nmap can&#39;t determine whether the port is open or being filtered.</p><p>A missing response doesn’t automatically mean that a UDP port is open.</p><h3>15. Run default NSE scripts</h3><p>Nmap includes something called the <strong>Nmap Scripting Engine (NSE)</strong>.</p><p>These scripts can help gather information about services, inspect configurations, and perform other network checks.</p><p>To run the default script category:</p><pre>nmap -sC 192.0.2.10</pre><p>You can combine it with service detection:</p><pre>nmap -sC -sV 192.0.2.10</pre><p>This is a common combination in authorized CTF and lab workflows.</p><p>However, not every NSE script behaves the same way. Some are informational, while others can be intrusive. Understand what a script does before running it.</p><h3>16. Run a specific NSE script</h3><p>You don’t always need to run a whole category of scripts.</p><p>For example, you can use the HTTP title script against a lab web server:</p><pre>nmap -p 80 --script http-title 192.0.2.10</pre><p>This attempts to retrieve the page title from the HTTP service.</p><p>To see which scripts are available in your Kali installation:</p><pre>ls /usr/share/nmap/scripts/</pre><p>You can look up individual scripts in the Nmap documentation before using them.</p><h3>17. Save your scan results</h3><p>If you’re doing practical work, saving results is a good habit.</p><p>To save normal text output:</p><pre>nmap -oN scan.txt 192.0.2.10</pre><p>To save XML output:</p><pre>nmap -oX scan.xml 192.0.2.10</pre><p>To save several output formats together:</p><pre>nmap -oA lab-scan 192.0.2.10</pre><p>The final command creates output files with the lab-scan prefix.</p><p>Saving results makes it easier to compare scans and document what you discovered.</p><h3>18. Adjust scan timing</h3><p>Nmap provides timing templates that affect scan speed and how probes are handled.</p><p>For example:</p><pre>nmap -T3 192.0.2.10</pre><p>-T3 is the normal timing template.</p><p>You can also use:</p><pre>nmap -T4 192.0.2.10</pre><p>The higher timing templates are generally more aggressive.</p><p>A faster scan isn’t always a better scan. On a slow network or a heavily filtered target, aggressive timing can produce less reliable results or trigger alerts.</p><p>For learning, start with the default settings and adjust them when you understand why you need to.</p><h3>19. Skip host discovery</h3><p>Sometimes Nmap’s host discovery probes don’t get a response even though a service is reachable.</p><p>In an authorized lab, you can use:</p><pre>nmap -Pn 192.0.2.10</pre><p>The -Pn option tells Nmap to skip host discovery and treat the target as online.</p><p>This can help when discovery probes are blocked by a firewall.</p><p>It doesn’t bypass the firewall or make inaccessible services reachable. It simply changes the initial discovery behavior.</p><h3>20. Understand Nmap port states</h3><p>This is something I think every beginner should understand properly.</p><p>When Nmap scans a port, it reports a state based on the responses it receives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*qHxHeGjRs03HCA59_cC9Lg.png" /></figure><p>The important thing to remember is that <strong>filtered doesn’t mean closed</strong>.</p><p>A firewall might be preventing Nmap from getting enough information to determine the actual state.</p><p>Always interpret the results in the context of the network you’re testing.</p><h3>21. A practical Nmap workflow</h3><p>Let’s put the commands together.</p><p>Imagine you’ve been given a machine in an authorized CTF lab.</p><p>Here’s one way to approach it.</p><p><strong>Step 1: Run a basic scan</strong></p><pre>nmap 192.0.2.10</pre><p>Check which common TCP ports are reported.</p><p><strong>Step 2: Scan all TCP ports</strong></p><pre>nmap -p- 192.0.2.10</pre><p>Look for services running on ports outside the default scan set.</p><p><strong>Step 3: Identify service versions</strong></p><pre>nmap -sV -p 22,80,443 192.0.2.10</pre><p>Replace these ports with the ones you actually discovered.</p><p><strong>Step 4: Try OS detection</strong></p><pre>sudo nmap -O 192.0.2.10</pre><p>Use the result as an estimate.</p><p><strong>Step 5: Run default scripts</strong></p><pre>nmap -sC -sV -p 22,80,443 192.0.2.10</pre><p>Again, adjust the ports based on your results.</p><p><strong>Step 6: Save the output</strong></p><pre>nmap -oA lab-scan 192.0.2.10</pre><p>This gives you a structured starting point for further investigation.</p><p>The main idea is to use each result to decide what to do next, instead of blindly running every option at once.</p><h3>22. Common mistakes beginners make</h3><p>Here are a few things worth remembering while learning Nmap.</p><p><strong>Mistake 1: Assuming every open port is vulnerable</strong></p><p>An open port tells you that a service appears to be available. It doesn’t prove a security weakness exists.</p><p><strong>Mistake 2: Scanning only the default ports</strong></p><p>Services can run on nonstandard ports. Depending on your assessment requirements, a broader scan may be necessary.</p><p><strong>Mistake 3: Confusing filtered with closed</strong></p><p>A firewall may be blocking probes. The results don’t necessarily tell you whether a service is listening.</p><p><strong>Mistake 4: Using every option in one command</strong></p><p>More options don’t automatically mean better results. Start with a basic scan and add options when you have a reason.</p><p><strong>Mistake 5: Ignoring the output</strong></p><p>Don’t stop when Nmap finishes. Read the results, identify what you need to investigate, and document your findings.</p><p><strong>Mistake 6: Scanning without permission</strong></p><p>Always work within your authorization and the target’s defined scope.</p><h3>23. Nmap command cheat sheet</h3><p>Here are the commands I’d keep handy while learning.</p><pre># Basic scan<br>nmap 192.0.2.10</pre><pre># Scan multiple IPs<br>nmap 192.0.2.10 192.0.2.20</pre><pre># Scan an IP range<br>nmap 192.0.2.1-20</pre><pre># Discover hosts<br>nmap -sn 192.0.2.0/24</pre><pre># Scan specific ports<br>nmap -p 22,80,443 192.0.2.10</pre><pre># Scan all TCP ports<br>nmap -p- 192.0.2.10</pre><pre># Service version detection<br>nmap -sV 192.0.2.10</pre><pre># OS detection<br>sudo nmap -O 192.0.2.10</pre><pre># TCP SYN scan<br>sudo nmap -sS 192.0.2.10</pre><pre># TCP connect scan<br>nmap -sT 192.0.2.10</pre><pre># UDP scan<br>sudo nmap -sU 192.0.2.10</pre><pre># Default NSE scripts<br>nmap -sC 192.0.2.10</pre><pre># Specific HTTP script<br>nmap -p 80 --script http-title 192.0.2.10</pre><pre># Save normal output<br>nmap -oN scan.txt 192.0.2.10</pre><pre># Save XML output<br>nmap -oX scan.xml 192.0.2.10</pre><pre># Save multiple formats<br>nmap -oA lab-scan 192.0.2.10</pre><pre># Normal timing template<br>nmap -T3 192.0.2.10</pre><pre># Faster timing in a suitable lab<br>nmap -T4 192.0.2.10</pre><pre># Skip host discovery<br>nmap -Pn 192.0.2.10</pre><p>The IP addresses used throughout this guide are documentation examples. Replace them with the correct addresses for your own lab.</p><h3>Final thoughts</h3><p>For me, the most important part of learning Nmap is understanding what the results actually tell you.</p><p>Finding an open port is just the beginning. You need to understand the service, check what information is available, and decide whether further investigation makes sense.</p><p>Start with basic scans. Learn the difference between open, closed, and filtered ports. Then move on to version detection, OS detection, and NSE scripts.</p><p>You don’t have to memorize every command in this guide today. Pick a few, try them in a controlled lab, and read the output carefully.</p><p><strong>Don’t just run the scan. Understand what you’re looking at.</strong></p><p>That’s what makes the difference between someone who knows a command and someone who understands network reconnaissance.</p><p>Happy Hacking</p><p>~Sh4d0w</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=412297fc1b1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 20 curl Commands Every Hacker Should Know.]]></title>
            <link>https://medium.com/@Cy5ec-rhythm/top-20-curl-commands-every-hacker-should-know-54ded7d1edca?source=rss-961956be0605------2</link>
            <guid isPermaLink="false">https://medium.com/p/54ded7d1edca</guid>
            <category><![CDATA[cybersecurity-tools]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[curl-commands]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Cy5ec-rhythm]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 18:31:01 GMT</pubDate>
            <atom:updated>2026-10-06T18:31:01.541Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-BnJL7ro4HTPWhJ0NRDvQ.png" /></figure><h3>My Top 20 curl Commands — Quick Cheat Sheet</h3><p>If you want to understand each command in detail, check out my previous blog post. Here’s the cheat sheet I keep coming back to.</p><p>These are the commands worth knowing first, especially if you’re learning <strong>Linux, web security, APIs, or penetration testing.</strong></p><h3>1. Basic GET Request</h3><pre>curl https://example.com</pre><h3>2. View HTTP Headers</h3><pre>curl -I https://example.com</pre><h3>3. Verbose Mode</h3><pre>curl -v https://example.com</pre><h3>4. Headers + Response Body</h3><pre>curl -i https://example.com</pre><h3>5. Follow Redirects</h3><pre>curl -L https://example.com</pre><h3>6. Change User-Agent</h3><pre>curl -A &quot;Mozilla/5.0&quot; https://example.com</pre><h3>7. Add a Custom Header</h3><pre>curl -H &quot;X-Test: hello&quot; https://example.com</pre><h3>8. Send Query Parameters</h3><pre>curl &quot;https://example.com/search?q=test&quot;</pre><h3>9. Send POST Data</h3><pre>curl -X POST -d &quot;username=test&quot; https://example.com/login</pre><h3>10. Send JSON Data</h3><pre>curl -X POST \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;username&quot;:&quot;test&quot;}&#39; \<br>https://example.com/api</pre><h3>11. Send an Authorization Header</h3><pre>curl \<br>-H &quot;Authorization: Bearer YOUR_TOKEN&quot; \<br>https://example.com/api</pre><h3>12. Send a Cookie</h3><pre>curl -b &quot;session=YOUR_SESSION&quot; https://example.com</pre><h3>13. Save and Reuse Cookies</h3><pre>curl -c cookies.txt https://example.com</pre><p>Then reuse them:</p><pre>curl -b cookies.txt https://example.com</pre><h3>14. Use a Proxy</h3><pre>curl -x http://127.0.0.1:8080 https://example.com</pre><p>This is especially useful when working with <strong>Burp Suite</strong>.</p><h3>15. Reproduce a Request</h3><pre>curl &#39;https://example.com/api&#39; \<br>-H &#39;Content-Type: application/json&#39; \<br>--data-raw &#39;{&quot;test&quot;:&quot;value&quot;}&#39;</pre><h3>16. Upload a File</h3><pre>curl -F &quot;file=@test.txt&quot; https://example.com/upload</pre><h3>17. Get Only the HTTP Status Code</h3><pre>curl -s -o /dev/null -w &quot;%{http_code}\n&quot; https://example.com</pre><h3>18. Use curl With jq</h3><pre>curl https://example.com/api/user | jq</pre><p>Great for making JSON responses easier to read.</p><h3>19. Save the Response to a File</h3><pre>curl https://example.com -o response.html</pre><h3>20. Debug a Request and Follow Redirects</h3><pre>curl -v -L https://example.com</pre><h3>The Commands I’d Learn First</h3><p>If you’re completely new to curl, don&#39;t try to memorize all 20 immediately.</p><p>Start with these:</p><pre>curl https://example.com<br>curl -I https://example.com<br>curl -v https://example.com<br>curl -H &quot;Header: value&quot; https://example.com<br>curl -X POST -d &quot;data=value&quot; https://example.com<br>curl -X POST -H &quot;Content-Type: application/json&quot; -d &#39;{}&#39; https://example.com<br>curl -b &quot;cookie=value&quot; https://example.com<br>curl -x http://127.0.0.1:8080 https://example.com</pre><p>Once these start making sense, the rest becomes much easier.</p><p>The goal isn’t to memorize every option.</p><p>The goal is to understand what you’re actually sending to the server.</p><p><strong><em>~Sh4d0w</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54ded7d1edca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[curl for Hackers: A Practical Guide to HTTP, APIs & Web Testing]]></title>
            <link>https://medium.com/@Cy5ec-rhythm/curl-for-hackers-a-practical-guide-to-http-apis-web-testing-89f3f2ccfc70?source=rss-961956be0605------2</link>
            <guid isPermaLink="false">https://medium.com/p/89f3f2ccfc70</guid>
            <category><![CDATA[cybersecurity-tools]]></category>
            <category><![CDATA[curl-commands]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[banner-grabbing]]></category>
            <dc:creator><![CDATA[Cy5ec-rhythm]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 18:31:01 GMT</pubDate>
            <atom:updated>2026-09-29T18:31:01.635Z</atom:updated>
            <content:encoded><![CDATA[<p>One of my favourite and best tool I’ve ever seen for Web application testing, bug bounty or whether it is testing APIs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VzntNRS-ciAuSwBCG3AZg.png" /></figure><p>If you are learning cybersecurity, Linux, web security, bug bounty, or even just working with APIs, there is one command you should get comfortable with:</p><pre>curl</pre><p>At first, curl looks like a simple command that just opens a URL from the terminal.</p><p>But once you start using it properly, you realize that it can do much more.</p><p>You can use curl to:</p><ul><li>Send HTTP requests</li><li>Check website responses</li><li>Inspect HTTP headers</li><li>Test APIs</li><li>Send GET and POST requests</li><li>Add custom headers</li><li>Send cookies</li><li>Test authentication</li><li>Upload files</li><li>Download files</li><li>Follow redirects</li><li>Debug HTTP connections</li><li>Reproduce requests captured in Burp Suite</li><li>Automate web requests from the terminal</li></ul><p>This is my practical curl handbook. I’m keeping it focused on the commands that are actually useful when working with Linux, networking, APIs, and cybersecurity.</p><h3>1. What is curl?</h3><p>curl stands for <strong>Client URL</strong>.</p><p>It is a command-line tool used to transfer data between your machine and a server using different protocols.</p><p>The most common one you’ll use is:</p><pre>HTTP / HTTPS</pre><p>For example:</p><pre>curl https://example.com</pre><p>This sends a request to the website and prints the response in your terminal.</p><p>That’s the simplest possible use of curl.</p><h3>2. Check if curl is installed</h3><p>On Kali Linux:</p><pre>curl --version</pre><p>You’ll see something similar to:</p><pre>curl 8.x.x</pre><p>You can also check where it is installed:</p><pre>which curl</pre><p>Example:</p><pre>/usr/bin/curl</pre><p>If it isn’t installed:</p><pre>sudo apt update<br>sudo apt install curl</pre><h3>3. Basic GET Request</h3><p>The most basic command:</p><pre>curl https://example.com</pre><p>This performs an HTTP GET request.</p><p>Think of it like:</p><pre>Your Computer<br>     |<br>     | GET / <br>     ↓<br>Web Server<br>     |<br>     | HTTP Response<br>     ↓<br>Your Terminal</pre><p>If you want to make it clear that you’re using GET:</p><pre>curl -X GET https://example.com</pre><p>But normally you don’t need -X GET because GET is already the default method.</p><p>So this:</p><pre>curl https://example.com</pre><p>is enough.</p><h3>4. Save the Response to a File</h3><p>Sometimes the response is too large to read directly in the terminal.</p><p>Use:</p><pre>curl https://example.com -o page.html</pre><p>Now check the file:</p><pre>ls</pre><p>You can read it using:</p><pre>cat page.html</pre><p>Or:</p><pre>less page.html</pre><h3>5. Download a File</h3><p>Suppose a server provides a file:</p><pre>curl -O https://example.com/file.zip</pre><p>The -O option saves the file using the filename from the URL.</p><p>For example:</p><pre>https://example.com/report.pdf</pre><p>will normally be saved as:</p><pre>report.pdf</pre><h3>6. Download With Your Own Filename</h3><p>You can choose the filename yourself:</p><pre>curl -o report.pdf https://example.com/file.pdf</pre><p>Here:</p><pre>-o → output filename</pre><h3>7. Show HTTP Response Headers</h3><p>This is one of the most useful things when doing web security.</p><p>Use:</p><pre>curl -I https://example.com</pre><p>Example output:</p><pre>HTTP/2 200<br>content-type: text/html<br>server: nginx<br>strict-transport-security: max-age=31536000</pre><p>This lets you quickly inspect things such as:</p><ul><li>HTTP status code</li><li>Server</li><li>Content-Type</li><li>Security headers</li><li>Cookies</li><li>Redirect information</li></ul><h3>8. Show Headers + Response Body</h3><p>Use:</p><pre>curl -i https://example.com</pre><p>Difference:</p><pre>-I → headers only<br>-i → headers + body</pre><h3>9. Verbose Mode</h3><p>When something isn’t working, this is one of my first commands.</p><pre>curl -v https://example.com</pre><p>-v means verbose.</p><p>It gives you more information about the connection.</p><p>You can see things like:</p><pre>* Connected to example.com<br>&gt; GET / HTTP/2<br>&gt; Host: example.com<br>&gt; User-Agent: curl/...<br>&gt;<br>&lt; HTTP/2 200<br>&lt; content-type: text/html</pre><p>This is extremely useful for troubleshooting.</p><h3>10. Extra Verbose Mode</h3><p>You can also use:</p><pre>curl -vv https://example.com</pre><p>or:</p><pre>curl -vvv https://example.com</pre><p>The more vs you use, the more debugging information curl can provide.</p><h3>11. Follow Redirects</h3><p>Imagine you request:</p><pre>curl http://example.com</pre><p>and the server responds:</p><pre>301 Moved Permanently<br>Location: https://example.com/</pre><p>By default, curl doesn’t necessarily follow the redirect.</p><p>Use:</p><pre>curl -L http://example.com</pre><p>-L tells curl to follow redirects.</p><p>This is very useful when testing websites.</p><h3>12. Check the Final URL After Redirects</h3><p>You can combine:</p><pre>curl -IL http://example.com</pre><p>This follows redirects while showing headers.</p><p>Useful for checking redirect chains.</p><h3>13. Change the User-Agent</h3><p>Every HTTP request usually contains a User-Agent.</p><p>curl’s default might look something like:</p><pre>curl/8.x.x</pre><p>You can change it:</p><pre>curl -A &quot;Mozilla/5.0&quot; https://example.com</pre><p>or:</p><pre>curl --user-agent &quot;Mozilla/5.0&quot; https://example.com</pre><p>You can use this when testing how a server responds to different clients.</p><p>For example:</p><pre>curl -A &quot;Googlebot&quot; https://example.com</pre><p>Only do this on systems you’re authorized to test.</p><h3>14. Add Custom Headers</h3><p>This is extremely important when working with APIs.</p><p>Use:</p><pre>curl -H &quot;Content-Type: application/json&quot; https://example.com/api</pre><p>You can add multiple headers:</p><pre>curl \<br>-H &quot;Content-Type: application/json&quot; \<br>-H &quot;Accept: application/json&quot; \<br>-H &quot;X-Test: hello&quot; \<br>https://example.com/api</pre><p>The -H option means:</p><pre>Add HTTP header</pre><h3>15. Authorization Header</h3><p>APIs commonly use authorization headers.</p><p>Example:</p><pre>curl \<br>-H &quot;Authorization: Bearer YOUR_TOKEN&quot; \<br>https://example.com/api/profile</pre><p>A common format is:</p><pre>Authorization: Bearer TOKEN</pre><p>Never publish real API keys or access tokens in a blog post, GitHub repository, screenshot, or command history.</p><p>Use placeholders such as:</p><pre>YOUR_TOKEN</pre><p>instead.</p><h3>16. GET Request With Query Parameters</h3><p>Suppose an API expects:</p><pre>/api/users?id=10</pre><p>You can use:</p><pre>curl &quot;https://example.com/api/users?id=10&quot;</pre><p>Multiple parameters:</p><pre>curl &quot;https://example.com/api/users?id=10&amp;role=admin&quot;</pre><p>Notice that the URL is inside quotes.</p><p>This is especially important when using &amp; in the shell.</p><h3>17. Using curl’s -G</h3><p>You can also construct query parameters using:</p><pre>curl -G https://example.com/api/users \<br>-d &quot;id=10&quot; \<br>-d &quot;role=admin&quot;</pre><p>This produces a GET request with query parameters.</p><p>Conceptually:</p><pre>GET /api/users?id=10&amp;role=admin</pre><h3>18. POST Request</h3><p>Now we get into something much more interesting.</p><p>A POST request can send data to a server.</p><p>Simple example:</p><pre>curl -X POST https://example.com/login</pre><p>But usually you’ll also send data.</p><p>For example:</p><pre>curl -X POST \<br>-d &quot;username=test&amp;password=test123&quot; \<br>https://example.com/login</pre><p>Here:</p><pre>-X POST → use POST method<br>-d      → send data</pre><h3>19. POST Form Data</h3><p>A typical HTML form might send:</p><pre>username=test<br>password=test123</pre><p>You can reproduce it with:</p><pre>curl -X POST \<br>-d &quot;username=test&amp;password=test123&quot; \<br>https://example.com/login</pre><p>This is useful when learning how web forms actually work.</p><h3>20. POST JSON Data</h3><p>Modern APIs commonly use JSON.</p><p>Example:</p><pre>curl -X POST \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;username&quot;:&quot;test&quot;,&quot;email&quot;:&quot;test@example.com&quot;}&#39; \<br>https://example.com/api/users</pre><p>The important parts are:</p><pre>Content-Type: application/json</pre><p>and:</p><pre>{&quot;username&quot;:&quot;test&quot;,&quot;email&quot;:&quot;test@example.com&quot;}</pre><h3>21. Pretty-Print JSON</h3><p>If the server returns JSON, the response can sometimes be difficult to read.</p><p>You can pipe it to jq:</p><pre>curl https://example.com/api/users | jq</pre><p>If jq isn&#39;t installed:</p><pre>sudo apt install jq</pre><p>Now JSON becomes much easier to read.</p><p>For example:</p><pre>curl https://example.com/api/user | jq &#39;.username&#39;</pre><p>This extracts a particular field.</p><h3>22. Send Data From a File</h3><p>Instead of writing JSON directly in the command:</p><pre>curl -X POST \<br>-H &quot;Content-Type: application/json&quot; \<br>-d @data.json \<br>https://example.com/api/users</pre><p>The @ tells curl to read the request body from a file.</p><p>Example data.json:</p><pre>{<br>  &quot;username&quot;: &quot;test&quot;,<br>  &quot;email&quot;: &quot;test@example.com&quot;<br>}</pre><p>This is much cleaner for larger requests.</p><h3>23. Cookies</h3><p>Cookies are very important when working with authenticated web applications.</p><p>You can send a cookie using:</p><pre>curl -b &quot;session=abc123&quot; https://example.com/dashboard</pre><p>-b means:</p><pre>--cookie</pre><p>You can send multiple cookies:</p><pre>curl -b &quot;session=abc123; theme=dark&quot; https://example.com/</pre><p>Only use session cookies from systems and accounts you’re authorized to test.</p><h3>24. Save Cookies</h3><p>You can tell curl to save cookies to a file:</p><pre>curl -c cookies.txt https://example.com</pre><p>Now you have:</p><pre>cookies.txt</pre><h3>25. Reuse Cookies</h3><p>You can then use those cookies later:</p><pre>curl -b cookies.txt https://example.com/dashboard</pre><p>This is useful when testing applications that maintain sessions using cookies.</p><h3>26. Basic Authentication</h3><p>Some websites use HTTP Basic Authentication.</p><p>curl supports it directly:</p><pre>curl -u username:password https://example.com/</pre><p>Example:</p><pre>curl -u admin:test123 https://example.com/admin</pre><p>Be careful with this method because the password may end up in your shell history.</p><p>A safer approach is:</p><pre>curl -u username https://example.com/</pre><p>curl will ask you for the password.</p><h3>27. Form Upload</h3><p>Suppose a website has a file upload endpoint.</p><p>You can send a file using:</p><pre>curl -F &quot;file=@test.txt&quot; https://example.com/upload</pre><p>For multiple fields:</p><pre>curl \<br>-F &quot;username=test&quot; \<br>-F &quot;file=@test.txt&quot; \<br>https://example.com/upload</pre><p>This uses multipart form data.</p><h3>28. HTTP Methods</h3><p>curl supports different HTTP methods.</p><h3>GET</h3><pre>curl -X GET https://example.com/api</pre><h3>POST</h3><pre>curl -X POST https://example.com/api</pre><h3>PUT</h3><pre>curl -X PUT https://example.com/api</pre><h3>PATCH</h3><pre>curl -X PATCH https://example.com/api</pre><h3>DELETE</h3><pre>curl -X DELETE https://example.com/api</pre><p>These methods are commonly used in REST APIs.</p><h3>29. Testing an API Endpoint</h3><p>A basic API request:</p><pre>curl https://example.com/api/users</pre><p>With JSON response:</p><pre>curl \<br>-H &quot;Accept: application/json&quot; \<br>https://example.com/api/users</pre><p>With authentication:</p><pre>curl \<br>-H &quot;Authorization: Bearer YOUR_TOKEN&quot; \<br>-H &quot;Accept: application/json&quot; \<br>https://example.com/api/users</pre><h3>30. PUT Request With JSON</h3><p>Example:</p><pre>curl -X PUT \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;name&quot;:&quot;Rhythm&quot;}&#39; \<br>https://example.com/api/users/10</pre><p>This is commonly used to update an existing resource.</p><h3>31. PATCH Request</h3><p>PATCH is generally used for partial updates.</p><p>Example:</p><pre>curl -X PATCH \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;name&quot;:&quot;Rhythm&quot;}&#39; \<br>https://example.com/api/users/10</pre><h3>32. DELETE Request</h3><p>Example:</p><pre>curl -X DELETE \<br>https://example.com/api/users/10</pre><p>When testing APIs, always understand what the endpoint actually does before sending destructive requests.</p><p>Use a lab or an application where you have permission.</p><h3>33. Check the HTTP Status Code</h3><p>You can print only the status code:</p><pre>curl -s -o /dev/null -w &quot;%{http_code}\n&quot; https://example.com</pre><p>Output:</p><pre>200</pre><p>This is extremely useful for scripts.</p><p>For example:</p><pre>curl -s -o /dev/null -w &quot;%{http_code}\n&quot; https://example.com/login</pre><h3>34. Show Response Time</h3><p>You can measure how long a request takes:</p><pre>curl -o /dev/null -s -w &quot;Time: %{time_total}s\n&quot; https://example.com</pre><p>Example:</p><pre>Time: 0.421s</pre><p>You can also print several metrics:</p><pre>curl -o /dev/null -s -w \<br>&quot;Status: %{http_code}\nTime: %{time_total}s\nSize: %{size_download} bytes\n&quot; \<br>https://example.com</pre><p>This becomes very useful when writing scripts.</p><h3>35. Check TLS / HTTPS Information</h3><p>Use verbose mode:</p><pre>curl -v https://example.com</pre><p>You can see information related to the TLS connection.</p><p>For more detailed TLS inspection, tools such as:</p><pre>openssl s_client</pre><p>are usually more appropriate.</p><p>For example:</p><pre>openssl s_client -connect example.com:443</pre><h3>36. Ignore Certificate Verification</h3><p>You might see this option in labs:</p><pre>curl -k https://example.com</pre><p>-k tells curl not to verify the server certificate.</p><p>This can be useful when working with:</p><ul><li>Local labs</li><li>Test servers</li><li>Self-signed certificates</li></ul><p>But don’t blindly use -k in real environments.</p><p>Certificate verification exists for a reason.</p><h3>37. Set a Request Timeout</h3><p>If a server doesn’t respond, your command may wait for a long time.</p><p>Use:</p><pre>curl --max-time 10 https://example.com</pre><p>This means curl can spend a maximum of 10 seconds on the operation.</p><p>You can also set a connection timeout:</p><pre>curl --connect-timeout 5 https://example.com</pre><h3>38. Retry Failed Requests</h3><p>curl can retry some failed requests:</p><pre>curl --retry 3 https://example.com</pre><p>You can combine this with a delay:</p><pre>curl --retry 3 --retry-delay 2 https://example.com</pre><p>Don’t use aggressive retry loops against systems you don’t own or aren’t authorized to test.</p><h3>39. Limit Download Speed</h3><p>You can limit transfer speed:</p><pre>curl --limit-rate 100K https://example.com/file.zip -o file.zip</pre><p>This limits the transfer rate to approximately:</p><pre>100 KB/s</pre><h3>40. Use a Proxy</h3><p>curl can send requests through a proxy:</p><pre>curl -x http://127.0.0.1:8080 https://example.com</pre><p>This is especially useful with security testing tools.</p><p>For example, if a local HTTP proxy is listening on:</p><pre>127.0.0.1:8080</pre><p>you can route the request through it.</p><h3>41. curl With Burp Suite</h3><p>This is one of the most useful combinations when learning web security.</p><p>If Burp Suite is listening on:</p><pre>127.0.0.1:8080</pre><p>run:</p><pre>curl -x http://127.0.0.1:8080 https://example.com</pre><p>Now the request can pass through Burp.</p><p>You can inspect:</p><ul><li>Request headers</li><li>Response headers</li><li>Parameters</li><li>Cookies</li><li>HTTP methods</li><li>Server responses</li></ul><p>This is a great way to understand what actually happens when a browser communicates with a server.</p><h3>42. Reproduce a Request From Burp</h3><p>Suppose Burp gives you a request like:</p><pre>POST /login HTTP/1.1<br>Host: example.com<br>Content-Type: application/json<br>Cookie: session=YOUR_SESSION</pre><pre>{&quot;username&quot;:&quot;test&quot;,&quot;password&quot;:&quot;test123&quot;}</pre><p>You can reproduce the request using:</p><pre>curl &#39;https://example.com/login&#39; \<br>-H &#39;Content-Type: application/json&#39; \<br>-H &#39;Cookie: session=YOUR_SESSION&#39; \<br>--data-raw &#39;{&quot;username&quot;:&quot;test&quot;,&quot;password&quot;:&quot;test123&quot;}&#39;</pre><p>This is one of the biggest reasons I like curl.</p><p>Instead of manually interacting with a browser, you can reproduce the exact HTTP request from the terminal.</p><h3>43. URL Encoding</h3><p>Suppose you need to send:</p><pre>hello world</pre><p>You can use:</p><pre>curl --data-urlencode &quot;q=hello world&quot; https://example.com/search</pre><p>curl handles the encoding.</p><p>This is useful for:</p><ul><li>Search parameters</li><li>Form parameters</li><li>Special characters</li><li>Spaces</li><li>User input testing</li></ul><h3>44. Test Different Parameters</h3><p>For example:</p><pre>curl -G https://example.com/search \<br>--data-urlencode &quot;q=test&quot;</pre><p>Another example:</p><pre>curl -G https://example.com/search \<br>--data-urlencode &quot;q=hello world&quot;</pre><p>This is cleaner than manually encoding spaces and special characters.</p><h3>45. Inspect Server Headers</h3><p>A quick way to inspect headers:</p><pre>curl -I https://example.com</pre><p>When doing basic web security checks, I usually look for headers such as:</p><pre>Content-Security-Policy<br>Strict-Transport-Security<br>X-Content-Type-Options<br>X-Frame-Options<br>Referrer-Policy<br>Permissions-Policy</pre><p>Missing security headers don’t automatically mean that a website is vulnerable.</p><p>They are only one part of the overall security picture.</p><h3>46. Check a Website’s Response Without Printing the Body</h3><p>Use:</p><pre>curl -s -o /dev/null -w &quot;%{http_code}\n&quot; https://example.com</pre><p>Let’s break it down:</p><pre>-s          → silent<br>-o /dev/null → throw away response body<br>-w          → print custom information<br>%{http_code} → HTTP status</pre><p>This is extremely useful in shell scripts.</p><h3>47. Check Multiple URLs</h3><p>Suppose you have:</p><pre>urls.txt</pre><p>containing:</p><pre>https://example.com<br>https://example.org<br>https://example.net</pre><p>You can use:</p><pre>while read -r url; do<br>    curl -s -o /dev/null -w &quot;%{http_code} $url\n&quot; &quot;$url&quot;<br>done &lt; urls.txt</pre><p>Example output:</p><pre>200 https://example.com<br>200 https://example.org<br>404 https://example.net</pre><p>Now curl becomes part of automation.</p><h3>48. Check Redirects for Multiple URLs</h3><pre>while read -r url; do<br>    curl -Ls -o /dev/null -w &quot;%{http_code} %{url_effective}\n&quot; &quot;$url&quot;<br>done &lt; urls.txt</pre><p>This shows the final URL after redirects.</p><h3>49. Silent Mode</h3><p>If you don’t want curl to show the progress meter:</p><pre>curl -s https://example.com</pre><p>-s means silent.</p><p>This is very useful when using curl inside scripts.</p><h3>50. Silent + Errors</h3><p>Sometimes completely silent mode hides useful errors.</p><p>Use:</p><pre>curl -sS https://example.com</pre><p>This suppresses the progress meter but still shows errors.</p><p>I use this a lot in scripts.</p><h3>51. Fail on HTTP Errors</h3><p>Use:</p><pre>curl -f https://example.com/not-found</pre><p>If the server returns certain HTTP error responses, curl can return a failure status.</p><p>This becomes useful when you’re scripting.</p><h3>52. Check DNS Resolution</h3><p>curl itself isn’t a replacement for DNS tools, but verbose mode can help:</p><pre>curl -v https://example.com</pre><p>For dedicated DNS investigation, use:</p><pre>dig example.com</pre><p>or:</p><pre>nslookup example.com</pre><h3>53. Force curl to Use a Specific IP</h3><p>This is very useful for testing virtual hosts.</p><pre>curl --resolve example.com:443:192.0.2.10 https://example.com/</pre><p>This tells curl:</p><pre>For example.com on port 443,<br>connect to 192.0.2.10</pre><p>while still using:</p><pre>Host: example.com</pre><p>This can be useful when testing your own servers or lab environments.</p><h3>54. Specify an Interface</h3><p>You can tell curl which network interface to use:</p><pre>curl --interface eth0 https://example.com</pre><p>Useful when your machine has multiple network interfaces.</p><p>Check interfaces using:</p><pre>ip addr</pre><h3>55. IPv4 Only</h3><p>Force IPv4:</p><pre>curl -4 https://example.com</pre><p>IPv6 only:</p><pre>curl -6 https://example.com</pre><p>This can help troubleshoot networking problems.</p><h3>56. HEAD vs GET</h3><p>One thing that confused me when I started was the difference between:</p><pre>curl -I https://example.com</pre><p>and:</p><pre>curl https://example.com</pre><p>The first sends a HEAD request.</p><p>The second sends a GET request.</p><p>HEAD generally asks for response headers without downloading the response body.</p><h3>57. HTTP/1.1</h3><p>You can explicitly request HTTP/1.1:</p><pre>curl --http1.1 https://example.com</pre><p>HTTP/2:</p><pre>curl --http2 https://example.com</pre><p>This can be useful when troubleshooting protocol-specific behavior.</p><h3>58. HTTP Response Headers and Security Testing</h3><p>For a quick header review:</p><pre>curl -I https://example.com</pre><p>For a complete request/response view:</p><pre>curl -v https://example.com</pre><p>For a saved response:</p><pre>curl -i https://example.com -o response.txt</pre><p>Then:</p><pre>less response.txt</pre><h3>59. A Practical API Request</h3><p>Here’s a more realistic API example:</p><pre>curl -X POST &#39;https://api.example.com/users&#39; \<br>-H &#39;Authorization: Bearer YOUR_TOKEN&#39; \<br>-H &#39;Content-Type: application/json&#39; \<br>-H &#39;Accept: application/json&#39; \<br>-d &#39;{<br>  &quot;name&quot;: &quot;Rhythm&quot;,<br>  &quot;role&quot;: &quot;student&quot;<br>}&#39;</pre><p>Breaking it down:</p><pre>-X POST</pre><p>Method.</p><pre>-H Authorization</pre><p>Authentication.</p><pre>-H Content-Type</pre><p>Format of our request body.</p><pre>-H Accept</pre><p>Format we want back.</p><pre>-d</pre><p>Request body.</p><h3>60. My Most-Used curl Commands</h3><p>If I had to keep only a small list while working in cybersecurity, these would be it:</p><h3>Basic request</h3><pre>curl https://example.com</pre><h3>Headers</h3><pre>curl -I https://example.com</pre><h3>Verbose</h3><pre>curl -v https://example.com</pre><h3>Follow redirects</h3><pre>curl -L https://example.com</pre><h3>Custom header</h3><pre>curl -H &quot;X-Test: hello&quot; https://example.com</pre><h3>POST data</h3><pre>curl -X POST -d &quot;name=test&quot; https://example.com/api</pre><h3>JSON</h3><pre>curl -X POST \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;name&quot;:&quot;test&quot;}&#39; \<br>https://example.com/api</pre><h3>Cookie</h3><pre>curl -b &quot;session=YOUR_SESSION&quot; https://example.com/dashboard</pre><h3>Proxy</h3><pre>curl -x http://127.0.0.1:8080 https://example.com</pre><h3>Status code</h3><pre>curl -s -o /dev/null -w &quot;%{http_code}\n&quot; https://example.com</pre><h3>61. curl + Cybersecurity</h3><p>This is where curl becomes really interesting.</p><p>When you’re learning web security, don’t think of curl as a “website downloader.”</p><p>Think of it as a way to manually construct HTTP requests.</p><p>A browser might send:</p><pre>GET /profile HTTP/2<br>Host: example.com<br>Cookie: session=...<br>User-Agent: ...<br>Accept: application/json</pre><p>With curl, you can recreate something similar:</p><pre>curl &#39;https://example.com/profile&#39; \<br>-H &#39;Cookie: session=YOUR_SESSION&#39; \<br>-H &#39;Accept: application/json&#39;</pre><p>Now you can modify individual parts of the request and observe how the application responds.</p><p>That makes curl extremely useful for learning:</p><ul><li>HTTP</li><li>APIs</li><li>Authentication</li><li>Cookies</li><li>Sessions</li><li>Headers</li><li>Request methods</li><li>Web application behavior</li><li>Burp Suite workflows</li></ul><h3>62. curl and Bug Bounty</h3><p>If you’re doing bug bounty, curl can be useful for manually verifying things you find during testing.</p><p>For example:</p><pre>curl -I https://target.example</pre><p>Check headers.</p><p>Then:</p><pre>curl -v https://target.example</pre><p>Inspect the request and response.</p><p>For an API:</p><pre>curl -H &quot;Authorization: Bearer YOUR_TOKEN&quot; \<br>https://target.example/api/user</pre><p>For a POST endpoint:</p><pre>curl -X POST \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;test&quot;:&quot;value&quot;}&#39; \<br>https://target.example/api/test</pre><p>The important thing is authorization.</p><p>Only test targets that are explicitly within the scope of a bug bounty program, your own infrastructure, or a lab.</p><h3>63. curl + Burp + Browser</h3><p>One workflow I recommend for learning web security is:</p><pre>Browser<br>   ↓<br>Burp Suite<br>   ↓<br>HTTP Request<br>   ↓<br>Server</pre><p>Then take the request and reproduce it using:</p><pre>curl</pre><p>For example:</p><pre>curl &#39;https://example.com/api/user&#39; \<br>-H &#39;Authorization: Bearer YOUR_TOKEN&#39;</pre><p>Then modify one thing at a time.</p><p>This helps you understand exactly which part of the request changes the server’s response.</p><h3>64. One Important Tip</h3><p>Don’t memorize every curl option.</p><p>Seriously.</p><p>There are too many.</p><p>Instead, understand the core ones:</p><pre>-X<br>-H<br>-d<br>-i<br>-I<br>-v<br>-L<br>-o<br>-O<br>-b<br>-c<br>-F<br>-x</pre><p>Once you understand these, most curl commands become easy to read.</p><p>And when you forget something:</p><pre>curl --help</pre><p>or:</p><pre>man curl</pre><h3>Conclusion</h3><p>When I first started using curl, I thought it was basically a command for downloading things from the internet.</p><p>It isn’t.</p><p>For cybersecurity, curl is basically a small HTTP client that gives you control over the request.</p><p>You can control:</p><pre>Method<br>Headers<br>Cookies<br>Parameters<br>Body<br>Authentication<br>Proxy<br>Redirects<br>Protocol<br>Timeouts</pre><p>And that’s exactly why it is so useful.</p><p>If you’re learning cybersecurity, don’t just memorize curl commands.</p><p>Run them.</p><p>Change one parameter.</p><p>Look at the request.</p><p>Look at the response.</p><p>Put the request through Burp Suite.</p><p>Break it down.</p><p>Once you start doing that, HTTP starts making a lot more sense.</p><p>And honestly, that’s when curl stops being just another Linux command and becomes one of the tools you actually reach for.</p><h3>Quick Reference</h3><pre>curl URL<br>    ↓<br>GET request<br><br>curl -I URL<br>    ↓<br>Headers only<br><br>curl -v URL<br>    ↓<br>Detailed request/connection information<br><br>curl -H &quot;Header: value&quot; URL<br>    ↓<br>Custom header<br><br>curl -d &quot;data=value&quot; URL<br>    ↓<br>Send data<br><br>curl -X POST ...<br>    ↓<br>POST request<br><br>curl -b &quot;cookie=value&quot; URL<br>    ↓<br>Send cookie<br><br>curl -x proxy URL<br>    ↓<br>Use proxy<br><br>curl -L URL<br>    ↓<br>Follow redirects<br><br>curl -s -o /dev/null -w &quot;%{http_code}&quot; URL<br>    ↓<br>Get HTTP status code<br></pre><p>That’s the curl handbook I wish I had when I started learning web security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89f3f2ccfc70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is “python3 -c ‘import pty; pty.spawn(“/bin/bash”)’”???]]></title>
            <link>https://medium.com/@Cy5ec-rhythm/what-is-python3-c-import-pty-pty-spawn-bin-bash-53e5cbbc46ae?source=rss-961956be0605------2</link>
            <guid isPermaLink="false">https://medium.com/p/53e5cbbc46ae</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[pty]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Cy5ec-rhythm]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 18:31:01 GMT</pubDate>
            <atom:updated>2026-09-24T18:31:01.988Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gcsfISHduuSHDmA_PoKQAw.png" /></figure><p>As a beginner I used to get stuck on this bash command. But no worries we will break this whole command into a simple form and understand this one by one.</p><p>First, let’s figure out what this command actually does…?</p><p><strong>If you already have a shell on a Linux machine, but the shell is limited/non-interactive, we use this command so that a basic shell can behave more like a normal interactive terminal, for example supporting better command interaction and terminal behaviour.</strong></p><p>We’ll take an example:</p><p>I was solving a lab and then I got the meterpreter session built between the attacker and victim machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*44P_shzgAMJG7m9fkrYcww.png" /></figure><p>After that we have to type shell to establish a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*-ObMulKt5QXnU8tEXzqoeQ.png" /><figcaption>shell created</figcaption></figure><p>So, it is not that much interactive and doesn’t feel very responsive. To fix this, we use the command.</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*_RGAgoen-AHa3D9zZu1orA.png" /></figure><p>Now, its good to go and we can go for further exploitation.</p><p>It’s time to break down the command.</p><p>python3 -c → runs Python code directly from the terminal.</p><p>The -c option tells Python: <em>“Execute the Python code that I give you directly in the command.”</em></p><p>import pty → loads Python&#39;s pseudo-terminal functionality.</p><h3>What is PTY?</h3><p>PTY means <strong>Pseudo Terminal</strong>.</p><p>Don’t worry about the technical name. Just think of it as a <strong>fake/virtual terminal</strong> that behaves more like a normal terminal.</p><p>When you normally open your Kali terminal, you can easily:</p><ul><li>Type commands</li><li>Use Ctrl+C</li><li>Use Tab for autocomplete</li><li>Run interactive programs</li><li>See the terminal properly</li></ul><p>But sometimes, when you get a shell remotely, it can be very basic.</p><h3>pty.spawn(&quot;/bin/bash&quot;)</h3><p>Finally:</p><pre>pty.spawn(&quot;/bin/bash&quot;)</pre><p>spawn() starts another program through the pseudo-terminal.</p><p>Here, the program we’re starting is:</p><pre>/bin/bash</pre><p>So essentially, we’re saying:<em>“Start Bash inside a pseudo-terminal.”</em></p><p>That’s why this command is commonly used when you have a <strong>limited shell</strong> during a CTF or an authorized penetration-testing lab.</p><p>Hope so this helps you understand the command now….</p><p>~Sh4d0w</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53e5cbbc46ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>