Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityUbuntu 26.10 adds a Windows-style window snapping panel(25.09.2026 um 00:01 Uhr)
•
AI & KI NachrichtenJulian Goldie SEO: OpenAI Just Dropped Two New GPT-6 Models(25.09.2026 um 01:00 Uhr)
•
KI & AI VideosPatrick Collison on Claude Code at Stripe(25.09.2026 um 00:57 Uhr)
••
AI & KI Nachrichtendeleting-the-trace(24.09.2026 um 23:28 Uhr)
•
IT Security ToolsAjar(25.09.2026 um 00:29 Uhr)
•••
AI & KI NachrichtenGitHub Release: openai/codex vrust-v0.158.0-alpha.11 (25.09.2026)(25.09.2026 um 01:32 Uhr)
••
Windows Tipps & SecurityUbuntu 26.10 adds a Windows-style window snapping panel(25.09.2026 um 00:01 Uhr)
•
AI & KI NachrichtenJulian Goldie SEO: OpenAI Just Dropped Two New GPT-6 Models(25.09.2026 um 01:00 Uhr)
•
KI & AI VideosPatrick Collison on Claude Code at Stripe(25.09.2026 um 00:57 Uhr)
••
AI & KI Nachrichtendeleting-the-trace(24.09.2026 um 23:28 Uhr)
•
IT Security ToolsAjar(25.09.2026 um 00:29 Uhr)
•••
AI & KI NachrichtenGitHub Release: openai/codex vrust-v0.158.0-alpha.11 (25.09.2026)(25.09.2026 um 01:32 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

Stop Being a Script Kiddie: building a Port Scanner with Python 🐍

We all start somewhere. When I first got into cybersecurity, I was fascinated by tools like Nmap. I would type a command, watch the green text scroll by, and feel like a hacker in a movie. But eventually, I realized something important:…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

We all start somewhere.



When I first got into cybersecurity, I was fascinated by tools like Nmap. I would type a command, watch the green text scroll by, and feel like a hacker in a movie. But eventually, I realized something important: running tools doesn't make you a hacker; understanding how they work does.



If you rely 100% on tools other people wrote, you are just a "Script Kiddie."



So, I decided to open the hood and see how network scanning actually works. Today, I want to share a simple Python script I wrote to understand the TCP Handshake process.



It’s not as fast as Nmap (yet!), but it’s mine. And building it taught me more than running nmap -sS ever did.






The Logic: How does it work?



The concept is surprisingly simple. A port scanner is just a program that knocks on doors.




  1. We pick a target (IP Address).

  2. We try to connect to a specific port (like Port 80 for Web).

  3. If the door opens (Connection Accepted) -> The Port is Open.

  4. If the door is locked or no one answers -> The Port is Closed.



We can do this easily using Python’s built-in socket library.






The Code



Here is the script. I kept it simple and added some error handling so it doesn't crash if I press Ctrl+C.




import socket
import sys
from datetime import datetime

# 1. Input Validation
if len(sys.argv) == 2:
# Translate hostname to IPv4
target = socket.gethostbyname(sys.argv[1])
else:
print("Invalid amount of arguments.")
print("Syntax: python scanner.py <ip>")
sys.exit()

# 2. Adding a Banner (Because it looks cool)
print("-" * 50)
print(f"Scanning target: {target}")
print(f"Time started: {str(datetime.now())}")
print("-" * 50)

try:
# 3. Scanning Ports
# I'm scanning 1 to 1000, but you can change this range
for port in range(1, 1000):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.setdefaulttimeout(1) # Don't wait forever

# connect_ex returns 0 if the connection is successful
result = s.connect_ex((target, port))

if result == 0:
print(f"Found Open Port: {port}")
s.close()

except KeyboardInterrupt:
print("\nExiting program.")
sys.exit()

except socket.gaierror:
print("Hostname could not be resolved.")
sys.exit()

except socket.error:
print("Could not connect to server.")
sys.exit()









Breaking it Down



If you are new to Python networking, here is what the weird lines mean:



socket.AF_INET: This tells Python we are using IPv4 addresses.



socket.SOCK_STREAM: This means we are using TCP (Connection-based protocol), not UDP.



s.connect_ex(): This is the secret sauce. Unlike the normal connect() function which crashes your program if a connection fails, connect_ex() just gives you an error code. If it returns 0, we know we got in!



How to Run It

Save the code as scanner.py and run it in your terminal:



Bash

python scanner.py 192.168.1.1

(Make sure to test it on your own router or local machine first!)



What's Next?

This is just V1. The current version is "single-threaded," which means it checks one port at a time. It's a bit slow.



My next goal is to implement Threading to scan hundreds of ports simultaneously.



I hope this encourages you to stop just running commands and start writing your own tools. If you have any tips on how to optimize this code, drop a comment below!



Happy Hacking! 💻🛡️

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Stop Being a Script Kiddie: building a Port Scanner with Python 🐍
id: 7518cda9-fe08-4830-a5ce-8dff2e35482b
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "Stop Being a Script Kiddie: bu" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Stop Being a Script Kiddie building a Po")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Stop Being a Script Kiddie building a Po*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Stop Being a Script Kiddie building a Po"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Stop Being a Script Kiddie: building a P.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Stop Being a Script Kiddie: building a Port Scanner with Python 🐍

Thematisch verwandte Begriffe: Stop, Being, Script, Kiddie · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY Kritische Sicherheitsmeldung
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle