MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / main

Function main

tests/security/test_api_vulnerabilities.py:627–666  ·  view source on GitHub ↗

Run all security tests

()

Source from the content-addressed store, hash-verified

625
626
627def main():
628 """Run all security tests"""
629 print("=" * 80)
630 print("Serial Studio API Security Test Suite")
631 print("=" * 80)
632 print("\nWARNING: This will attempt to exploit the Serial Studio API.")
633 print("Only run this against a test instance!")
634 print()
635
636 tester = SecurityTester()
637
638 try:
639 # Check if server is running
640 with SerialStudioClient() as client:
641 print("[+] Connected to Serial Studio API\n")
642
643 # Run all attack categories
644 test_json_parsing_exploits(tester)
645 test_command_injection(tester)
646 test_buffer_exhaustion(tester)
647 test_batch_abuse(tester)
648 test_connection_exhaustion(tester)
649 test_raw_data_injection(tester)
650 test_parameter_validation(tester)
651 test_information_disclosure(tester)
652 test_state_manipulation(tester)
653
654 except ConnectionError as e:
655 print(f"[ERROR] Cannot connect to Serial Studio API: {e}")
656 print("Make sure Serial Studio is running with API Server enabled.")
657 return 1
658
659 except KeyboardInterrupt:
660 print("\n\n[!] Tests interrupted by user")
661
662 finally:
663 # Generate report
664 tester.report()
665
666 return 0
667
668
669if __name__ == "__main__":

Callers 1

Calls 12

reportMethod · 0.95
SerialStudioClientClass · 0.90
SecurityTesterClass · 0.85
test_command_injectionFunction · 0.85
test_buffer_exhaustionFunction · 0.85
test_batch_abuseFunction · 0.85
test_raw_data_injectionFunction · 0.85
test_state_manipulationFunction · 0.85

Tested by

no test coverage detected