Nice work - but i have found that input values are not checked, so invalid input will crash the script e.g.here:
+-v0.23---------------------------------------------------------------by-0x7c2-+
| Troubleshooting Options |
+------------------------------------------------------------------------------+
| 1. Run fw monitor with filter |
| 2. Run tcpdump with filter |
| 3. Run tcpdump, capture fragmented packets |
| 4. Run zdebug with options |
| 5. Print connection table - raw |
| 6. Print connection table - formatted |
| 7. Clear connection table (ALL!) |
| 8. Clear specific connections from table |
| 9. STOP CheckPoint Services |
| 10. STOP CheckPoint Services and keep policy |
| 11. UNLOAD Security/TP Policy |
| 12. FETCH Security/TP Policy |
| 13. Disable Antispoofing |
| 14. Enable Antispoofing |
| 15. ClusterXL Status |
| 16. SecureXL DoS Mitigation Status |
| 17. Display VPN Tunnel Status |
| 18. TOP 15 heavy F2F Connections (specific worker) |
| 19. TOP 15 heavy F2F Connections (all worker!) |
| 20. Measure kernel delay (EXPERIMENTAL!) |
| 21. Disable IPS on the fly |
| 22. Enable IPS on the fly |
| 23. Print heavy conns detected by CoreXL |
| 24. Back to Main Menu |
| 0. Exit from Script |
+------------------------------------------------------------------------------+
Enter your choice [0-24]: 8
Please enter common ip addresses. If you wish to disable filter, just
leave those fields empty.
Enter source ip : ^[
Enter destination ip: ^^q
Traceback (most recent call last):
File "/home/admin/cpme-py/cpme.py", line 122, in <module>
menu_display(menu_cur)
File "/home/admin/cpme-py/cpme.py", line 108, in menu_display
eval(exec_menu)
File "<string>", line 1, in <module>
File "/home/admin/cpme-py/troubleshooting.py", line 434, in clear_table_input
iphex_src=ip2hex(ip_src)
File "/home/admin/cpme-py/troubleshooting.py", line 229, in ip2hex
b = hex(int(a[0]))[2:].zfill(2) + hex(int(a[1]))[2:].zfill(2) + hex(int(a[2]))[2:].zfill(2) + hex(int(a[3]))[2:].zfill(2)
ValueError: invalid literal for int() with base 10: '\x1b'
Only cosmetic: Formatting of the last line in Health Analysis > Run All Checks is incorrect.
And a UI hint: Always having zero to Exit the script is nice, but Back to Main Menue number should not change from submenue to submenu, too 😎.
CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist