CommandLine.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef CommandLine_h
  2. #define CommandLine_h
  3. #include "configs.h"
  4. #ifdef HAS_SCREEN
  5. #include "MenuFunctions.h"
  6. #include "Display.h"
  7. #endif
  8. #include "WiFiScan.h"
  9. #ifdef HAS_SCREEN
  10. extern MenuFunctions menu_function_obj;
  11. extern Display display_obj;
  12. #endif
  13. extern WiFiScan wifi_scan_obj;
  14. extern LinkedList<AccessPoint>* access_points;
  15. extern const String PROGMEM version_number;
  16. //// Commands
  17. // Admin
  18. const char PROGMEM CH_CMD[] = "channel";
  19. const char PROGMEM CLEARAP_CMD[] = "clearap";
  20. const char PROGMEM REBOOT_CMD[] = "reboot";
  21. // WiFi sniff/scan
  22. const char PROGMEM SCANAP_CMD[] = "scanap";
  23. const char PROGMEM SNIFF_BEACON_CMD[] = "sniffbeacon";
  24. const char PROGMEM SNIFF_DEAUTH_CMD[] = "sniffdeauth";
  25. const char PROGMEM SNIFF_PMKID_CMD[] = "sniffpmkid";
  26. const char PROGMEM STOPSCAN_CMD[] = "stopscan";
  27. // WiFi attack
  28. const char PROGMEM ATTACK_CMD[] = "attack";
  29. const char PROGMEM ATTACK_TYPE_DEAUTH[] = "deauth";
  30. const char PROGMEM ATTACK_TYPE_BEACON[] = "beacon";
  31. const char PROGMEM ATTACK_TYPE_PROBE[] = "probe";
  32. // WiFi Aux
  33. const char PROGMEM LIST_AP_CMD[] = "listap";
  34. const char PROGMEM SEL_CMD[] = "select";
  35. class CommandLine {
  36. private:
  37. String getSerialInput();
  38. LinkedList<String> parseCommand(String input, char* delim);
  39. void runCommand(String input);
  40. int argSearch(LinkedList<String>* cmd_args, String key);
  41. const char* ascii_art =
  42. "\r\n"
  43. " @@@@@@ \r\n"
  44. " @@@@@@@@ \r\n"
  45. " @@@@@@@@@@@ \r\n"
  46. " @@@@@@ @@@@@@ \r\n"
  47. " @@@@@@@ @@@@@@@ \r\n"
  48. " @@@@@@ @@@@@@ \r\n"
  49. " @@@@@@@ @@@@@@@ \r\n"
  50. " @@@@@@ @@@@@@ \r\n"
  51. "@@@@@@@ @@@@@@@@@@@@@@@@ \r\n"
  52. "@@@@@ @@@@@@@@@@@@@@@ \r\n"
  53. "@@@@@ @@@@@@@ \r\n"
  54. "@@@@@ @@@@@@ \r\n"
  55. "@@@@@@ @@@@@@@ \r\n"
  56. " @@@@@@ @@@@@@@@@@@@\r\n"
  57. " @@@@@@@ @@@@@@ \r\n"
  58. " @@@@@@ @@@@@@ \r\n"
  59. " @@@@@@@ @@@@@@ \r\n"
  60. " @@@@@@ @@@@@@ \r\n"
  61. " @@@@@@@ @@@@@@ \r\n"
  62. " @@@@@@ @@@@@@ \r\n"
  63. " @@@@@@@@@ \r\n"
  64. " @@@@@@ \r\n"
  65. " @@@@ \r\n"
  66. "\r\n";
  67. public:
  68. CommandLine();
  69. void RunSetup();
  70. void main(uint32_t currentTime);
  71. };
  72. #endif