fields.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * TraCINg-Server - Gathering and visualizing cyber incidents on the world
  3. *
  4. * Copyright 2013 Matthias Gazzari, Annemarie Mattmann, André Wolski
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. // default is for all fields: 0
  19. var fields = {
  20. "type": {
  21. 0: "Unknown",
  22. 1: "ECHO",
  23. 2: "GHOST",
  24. 10: "Transport Layer",
  25. 11: "Portscan",
  26. 20: "Shellcode Injection",
  27. 30: "SQL",
  28. 31: "MySQL",
  29. 32: "MS SQL",
  30. 40: "SMB",
  31. 50: "VoIP",
  32. 60: "FTP",
  33. 70: "HTTP",
  34. 71: "HTTPS",
  35. 80: "TELNET"
  36. },
  37. "type_description": {
  38. 0: "The sensor could not determine the attack type",
  39. 1: "Attack on ECHO",
  40. 2: "Attack that was mirrored (GHOST)",
  41. 10: "The attacker connected to an open port, but did not interact with it",
  42. 11: "The attacker tried to connect to a closed port",
  43. 20: "The attacker successfully used an emulated security issue and would have been able to execute malicious code",
  44. 30: "Attack on a database server",
  45. 31: "Attack on a MySQL database server",
  46. 32: "Attack on a Microsoft database server",
  47. 40: "Attack on a SMB file server",
  48. 50: "Attack on a Voice over IP device",
  49. 60: "Attack on an FTP Server",
  50. 70: "Attack on an HTTP Server",
  51. 71: "Attack on an HTTPS Server",
  52. 80: "Attack on an TELNET"
  53. }
  54. };
  55. exports.fields = fields;
  56. exports.translate = function(serieField, currentSerie) {
  57. if(fields[serieField].hasOwnProperty(currentSerie))
  58. return fields[serieField][currentSerie];
  59. else
  60. return fields[serieField][0];
  61. };
  62. function getKeys(obj) {
  63. var keys = [];
  64. for(var key in obj) {
  65. keys.push(key);
  66. }
  67. return keys;
  68. }
  69. exports.validTypes = getKeys(fields.type);