Instantly share code, notes, and snippets.

Embed
What would you like to do?
[
{
"id": "46afa3b4.450884",
"type": "tab",
"label": "Threat Grid Submit URL",
"disabled": false,
"info": ""
},
{
"id": "c1bae7ba.842af8",
"type": "e-mail in",
"z": "46afa3b4.450884",
"name": "Check E-mail",
"protocol": "IMAP",
"server": "imap.gmail.com",
"useSSL": true,
"port": "993",
"box": "INBOX",
"disposition": "Read",
"repeat": "300",
"x": 101.5,
"y": 74,
"wires": [
[
"c45da71.af6df58"
]
]
},
{
"id": "c45da71.af6df58",
"type": "change",
"z": "46afa3b4.450884",
"name": "Find URLs",
"rules": [
{
"t": "set",
"p": "urls",
"pt": "msg",
"to": "$match(payload,/(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?(\\S+)/)",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 480,
"y": 56,
"wires": [
[
"486f53cb.fa98ac"
]
]
},
{
"id": "6baf2e02.17fce8",
"type": "inject",
"z": "46afa3b4.450884",
"name": "Test URL",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 98.5,
"y": 213,
"wires": [
[
"27dd7ed2.ed02ba"
]
]
},
{
"id": "486f53cb.fa98ac",
"type": "function",
"z": "46afa3b4.450884",
"name": "Split URLs",
"func": "if (msg.urls.length > 0){\n msg.urls.forEach(function(element) {\n node.send({\"payload\": element});\n });\n} else {\n node.send({\"payload\": msg.urls});\n}",
"outputs": 1,
"noerr": 0,
"x": 482,
"y": 107,
"wires": [
[
"b042d668.500118"
]
]
},
{
"id": "f9cbf9e.436ff08",
"type": "comment",
"z": "46afa3b4.450884",
"name": "Add Your E-mail Credentials Here",
"info": "E-mail box where URLs will be sent for submission.",
"x": 156.5,
"y": 39,
"wires": []
},
{
"id": "d1768178.bd74e8",
"type": "change",
"z": "46afa3b4.450884",
"name": "Output Match",
"rules": [
{
"t": "set",
"p": "url",
"pt": "msg",
"to": "payload.match",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 478.5,
"y": 214,
"wires": [
[
"7562413b.21009"
]
]
},
{
"id": "b042d668.500118",
"type": "json",
"z": "46afa3b4.450884",
"name": "",
"property": "payload",
"action": "obj",
"pretty": false,
"x": 471.5,
"y": 158,
"wires": [
[
"d1768178.bd74e8"
]
]
},
{
"id": "1b9c4ed8.ac92d1",
"type": "json",
"z": "46afa3b4.450884",
"name": "",
"property": "payload",
"action": "obj",
"pretty": false,
"x": 434.5,
"y": 377,
"wires": [
[
"b23f4ae8.80cce",
"b923b154.79427"
]
]
},
{
"id": "27dd7ed2.ed02ba",
"type": "template",
"z": "46afa3b4.450884",
"name": "Bad Guy URLs",
"field": "payload",
"fieldType": "msg",
"format": "text",
"syntax": "plain",
"template": "This is a test e-mail. \nThis integration will parse for http and https\n\nhttp://www.cisco.com/c/dam/en/us/products/collateral/switches/nexus-7000-series-switches/at_a_glance_c45-727153.pdf\n\nTesting just one",
"output": "str",
"x": 240,
"y": 170,
"wires": [
[
"c45da71.af6df58"
]
]
},
{
"id": "b23f4ae8.80cce",
"type": "debug",
"z": "46afa3b4.450884",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 666.5,
"y": 441,
"wires": []
},
{
"id": "7562413b.21009",
"type": "change",
"z": "46afa3b4.450884",
"name": "Strip protocol",
"rules": [
{
"t": "change",
"p": "url",
"pt": "msg",
"from": "https://",
"fromt": "str",
"to": "",
"tot": "str"
},
{
"t": "change",
"p": "url",
"pt": "msg",
"from": "http://",
"fromt": "str",
"to": "",
"tot": "str"
},
{
"t": "change",
"p": "url",
"pt": "msg",
"from": "ftp://",
"fromt": "str",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 315.5,
"y": 263,
"wires": [
[
"f25cd3f8.4a60b"
]
]
},
{
"id": "b923b154.79427",
"type": "dxl-core-event out",
"z": "46afa3b4.450884",
"name": "",
"topic": "/cisco/threatgrid/urlresults",
"client": "",
"x": 714,
"y": 381,
"wires": []
},
{
"id": "f25cd3f8.4a60b",
"type": "threatgrid-urlsubmit",
"z": "46afa3b4.450884",
"name": "Threat Grid URL Submit",
"api": "",
"x": 279.5,
"y": 324,
"wires": [
[
"1b9c4ed8.ac92d1"
]
]
},
{
"id": "538b9229.8049d4",
"type": "comment",
"z": "46afa3b4.450884",
"name": "DXL Topic for Submissions",
"info": "When submitting to Threat Grid a JSON object is returned which gives information about the submission. This information is published to the DXL topic for later use.",
"x": 704,
"y": 341,
"wires": []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment