├── FlowPlotterD3 ├── data │ ├── data.csv │ ├── data.tsv │ ├── ms.csv │ └── sensordata.csv ├── output.file ├── notes ├── README ├── templates │ ├── stylesheet.css │ ├── jquery.tipsy.js │ ├── linechart.html │ ├── mslinechart.html │ └── linechart.html.bak ├── mslinechart.html └── flowplotter.sh ├── googlechart ├── geomap.html ├── piechart.html ├── barchart.html ├── histogram.html ├── columnchart.html ├── linechart.html ├── orgchart.html ├── timeline.html ├── bubblechart.html ├── treemap.html └── tablechart.html ├── LICENSE.md ├── AssetDiscoveryTree.sh ├── scripts └── AssetDiscoveryTree.sh ├── d3chart ├── treeasset.html └── forceopacity.html ├── README.md └── flowplotter.sh /FlowPlotterD3/data/data.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FlowPlotterD3/data/data.tsv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FlowPlotterD3/data/ms.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FlowPlotterD3/output.file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FlowPlotterD3/data/sensordata.csv: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FlowPlotterD3/notes: -------------------------------------------------------------------------------- 1 | seriesselect is for the "select sensor" or whatever it might be 2 | titleselect is for the title of the page 3 | optionlist is for the list of items in the series 4 | 5 | -------------------------------------------------------------------------------- /FlowPlotterD3/README: -------------------------------------------------------------------------------- 1 | This is just a test directory for converting all of the old FlowPlotter to newer D3 versions with more capability. 2 | Old FlowPlotter will remain as it is, but this will serve as the newer "better" FlowPlotter once it is complete. 3 | -------------------------------------------------------------------------------- /googlechart/geomap.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /googlechart/piechart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /googlechart/barchart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /googlechart/histogram.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /googlechart/columnchart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /googlechart/linechart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /googlechart/orgchart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /googlechart/timeline.html: -------------------------------------------------------------------------------- 1 | 3 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /googlechart/bubblechart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Jason Smith 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /googlechart/treemap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /googlechart/tablechart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /FlowPlotterD3/templates/stylesheet.css: -------------------------------------------------------------------------------- 1 | 2 | .plot{ 3 | fill: #fff; 4 | } 5 | .axis path, 6 | .axis line { 7 | fill: none; 8 | stroke: #AFBABF; 9 | shape-rendering: crispEdges; 10 | } 11 | .axis text { 12 | font-family: SourceSansPro-Bold; 13 | font-size: 14px; 14 | fill: #AFBABF; 15 | } 16 | 17 | .x.axis path { 18 | display: none; 19 | } 20 | .y.axis path{ 21 | display: none; 22 | } 23 | 24 | .line { 25 | fill: none; 26 | stroke: steelblue; 27 | stroke-linejoin: round; 28 | stroke-linecap:round; 29 | } 30 | 31 | .hed { 32 | font-family: SourceSansPro-Bold; 33 | font-size: 24pt; 34 | margin-bottom:5px; 35 | margin-top:0px; 36 | } 37 | 38 | .dek { 39 | font-family: SourceSansPro-Light; 40 | font-size: 6pt; 41 | margin-bottom:0px; 42 | margin-top:0px; 43 | } 44 | .menuchoice { 45 | font-family: SourceSansPro-Light; 46 | font-size: 10pt; 47 | margin-bottom:0px; 48 | fill: #231F20; 49 | } 50 | .legend { 51 | font-family: SourceSansPro-Light; 52 | font-size: 10pt; 53 | margin-bottom:0px; 54 | fill: #231F20; 55 | } 56 | .legend-off { 57 | font-family: SourceSansPro-Light; 58 | font-size: 10pt; 59 | margin-bottom:0px; 60 | fill: #231F20; 61 | } 62 | .legend-select { 63 | font-family: SourceSansPro-Bold; 64 | font-size: 10pt; 65 | margin-bottom:0px; 66 | fill: #231F20; 67 | } 68 | .tip1 { 69 | font-family: SourceSansPro-Bold; 70 | font-size: 14pt; 71 | text-align: center; 72 | margin-bottom:-12px; 73 | margin-top:0px; 74 | } 75 | 76 | .tip2 { 77 | font-family: SourceSansPro-ExtraLight; 78 | font-size: 10pt; 79 | text-align: center; 80 | margin-bottom:-12px; 81 | } 82 | .tip3 { 83 | font-family: SourceSansPro-ExtraLight; 84 | font-size: 10pt; 85 | text-align: center; 86 | margin-bottom:0px; 87 | } 88 | 89 | @font-face { 90 | font-family: 'SourceSansPro-ExtraLight'; 91 | font-style: normal; 92 | font-weight: 200; 93 | src: local('Source Sans Pro ExtraLight'), local('SourceSansPro-ExtraLight'), url(http://themes.googleusercontent.com/static/fonts/sourcesanspro/v5/toadOcfmlt9b38dHJxOBGC-IiwWNzQT_LXAtr-Ee9Pw.woff) format('woff'); 94 | } 95 | @font-face { 96 | font-family: 'SourceSansPro-Light'; 97 | font-style: normal; 98 | font-weight: 300; 99 | src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url(http://themes.googleusercontent.com/static/fonts/sourcesanspro/v5/toadOcfmlt9b38dHJxOBGMVNtom4QlEDNJaqqqzqdSs.woff) format('woff'); 100 | } 101 | @font-face { 102 | font-family: 'SourceSansPro-Bold'; 103 | font-style: normal; 104 | font-weight: 700; 105 | src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(http://themes.googleusercontent.com/static/fonts/sourcesanspro/v5/toadOcfmlt9b38dHJxOBGIqjGYJUyOXcBwUQbRaNH6c.woff) format('woff'); 106 | } 107 | 108 | .tipsy { font-family:"Source Sans Pro"; font-size: 10px; position: absolute; padding: 5px; z-index: 100000; } 109 | .tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 0; text-align: left; padding:10px;} 110 | /* Rounded corners */ 111 | .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } 112 | 113 | /* Uncomment for shadow */ 114 | /*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/ 115 | 116 | .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; } 117 | 118 | /* Rules to colour arrows */ 119 | .tipsy-arrow-n { border-bottom-color: #000; } 120 | .tipsy-arrow-s { border-top-color: #000; } 121 | .tipsy-arrow-e { border-left-color: #FFF; } 122 | .tipsy-arrow-w { border-right-color: #000; } 123 | 124 | .tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; } 125 | .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;} 126 | .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;} 127 | .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } 128 | .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } 129 | .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } 130 | .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; } 131 | .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; } 132 | 133 | 134 | .gravity { width: 100%; margin: 5px 0; border-spacing: 5px; } 135 | .gravity td { text-align: center; vertical-align: middle; padding: 5px 0; background-color: #d0d0d0; width: 33%; } 136 | .gravity a { } 137 | .gravity a:hover { color: #505050; background: none; } 138 | -------------------------------------------------------------------------------- /AssetDiscoveryTree.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #Generates an Asset List using a pre-existing filter file. 4 | #Based on a combination of works from Applied Network Security Monitoring and http://www.sei.cmu.edu/reports/12tr006.pdf 5 | 6 | #Usage 7 | # Obtain a filter file with a large amount of network data, representative of all hosts on your network 8 | # $ rwfilter --start-date=2014/05/13 --proto=0- --type=all --pass=sample.rw 9 | 10 | # Run AssetDiscoveryTree.sh against the file and send to an output html file 11 | # $ ./AssetDiscoveryTree.sh /home/jason/sample.rw > /home/jason/assetlist.html 12 | 13 | # By default, you will be generating data for servers making up greater than 1 percent of all "server" traffic for a given service. 14 | # If instead you want a static number threshold, you can specify --count=50 to display the top 50 talkers for a service. 15 | # $ ./AssetDiscoveryTree.sh /home/jason/sample.rw --count=50 > /home/jason/assetlistTOP50.html 16 | 17 | # If instead you want to threshold by byte size, you can specify --threshold=75000000 to display the services with greater than 75000000 bytes outbound. 18 | # $ ./AssetDiscoveryTree.sh /home/jason/sample.rw --threshold=75000000 > /home/jason/assetlistBYTETHRESHOLD.html 19 | 20 | limitvalue=$2 21 | if [ -z "${limitvalue}" ]; then 22 | limitvalue="--percentage=1" 23 | fi 24 | 25 | echo '{ "name": "Assets","children": [ ' > flare.temp.json 26 | 27 | rwfilter $1 --type=outweb --sport=80,443,8080 --protocol=6 --packets=4- --ack-flag=1 --pass=stdout|rwstats --fields=sip $limitvalue --bytes --no-titles|cut -f 1 -d "|"|rwsetbuild > web_servers.set 28 | rwfilter $1 --type=outweb --sport=80,443,8080 --protocol=6 --packets=4- --ack-flag=1 --sipset=web_servers.set --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "Web Servers",\n"children": [/' | sed '$s/$/\n\]},/' >> flare.temp.json 29 | 30 | rwfilter $1 --type=out --sport=25,465,110,995,143,993 --protocol=6 --packets=4- --ack-flag=1 --pass=stdout|rwset --sip-file=smtpservers.set 31 | rwfilter $1 --type=out --sport=25,465,110,995,143,993 --sipset=smtpservers.set --protocol=6 --packets=4- --ack-flag=1 --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "SMTP Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 32 | 33 | rwfilter $1 --type=out --sport=53 --protocol=17 --pass=stdout|rwstats --fields=sip $limitvalue --packets --no-titles|cut -f 1 -d "|"| rwsetbuild > dnsservers.set 34 | rwfilter $1 --type=out --sport=53 --protocol=17 --sipset=dnsservers.set --pass=stdout | rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "DNS Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 35 | 36 | rwfilter $1 --type=out --protocol=47,50,51 --pass=stdout|rwuniq --fields=sip --no-titles|cut -f 1 -d "|" |rwsetbuild > vpn.set 37 | rwfilter $1 --type=out --sipset=vpn.set --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "VPN Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 38 | 39 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sport=21 --pass=stdout|rwstats --fields=sip $limitvalue --bytes --no-titles|cut -f 1 -d "|"|rwsetbuild > ftpservers.set 40 | rwfilter $1 --type=out --sipset=ftpservers.set --sport=20 --flags-initial=S/SAFR --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "FTP Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 41 | 42 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sport=22 --pass=stdout|rwstats --fields=sip $limitvalue --bytes --no-titles|cut -f 1 -d "|"|rwsetbuild>sshservers.set 43 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sipset=sshservers.set --sport=22 --pass=stdout | rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "SSH Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 44 | 45 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sport=23 --pass=stdout|rwstats --fields=sip $limitvalue --bytes --no-titles|cut -f 1 -d "|"|rwsetbuild > telnetservers.set 46 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sipset=telnetservers.set --sport=23 --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "Telnet Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 47 | 48 | cat flare.temp.json | sed '$s/,$/\n/' | sed '$s/$/\]\}/' | tr '\n' ' ' | sed "s/^/var myjson = '/"| sed "s/$/';/" > assets.json 49 | 50 | sed '/dataplaceholder/{ 51 | s/dataplaceholder//g 52 | r assets.json 53 | }' d3chart/treeasset.html 54 | 55 | rm *.set 56 | rm flare.temp.json 57 | rm assets.json 58 | -------------------------------------------------------------------------------- /scripts/AssetDiscoveryTree.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #Generates an Asset List using a pre-existing filter file. 4 | #Based on a combination of works from Applied Network Security Monitoring and http://www.sei.cmu.edu/reports/12tr006.pdf 5 | 6 | #Usage 7 | # Obtain a filter file with a large amount of network data, representative of all hosts on your network 8 | # $ rwfilter --start-date=2014/05/13 --proto=0- --type=all --pass=sample.rw 9 | 10 | # Run AssetDiscoveryTree.sh against the file and send to an output html file 11 | # $ ./AssetDiscoveryTree.sh /home/jason/sample.rw > /home/jason/assetlist.html 12 | 13 | # By default, you will be generating data for servers making up greater than 1 percent of all "server" traffic for a given service. 14 | # If instead you want a static number threshold, you can specify --count=50 to display the top 50 talkers for a service. 15 | # $ ./AssetDiscoveryTree.sh /home/jason/sample.rw --count=50 > /home/jason/assetlistTOP50.html 16 | 17 | # If instead you want to threshold by byte size, you can specify --threshold=75000000 to display the services with greater than 75000000 bytes outbound. 18 | # $ ./AssetDiscoveryTree.sh /home/jason/sample.rw --threshold=75000000 > /home/jason/assetlistBYTETHRESHOLD.html 19 | 20 | limitvalue=$2 21 | if [ -z "${limitvalue}" ]; then 22 | limitvalue="--percentage=1" 23 | fi 24 | 25 | echo '{ "name": "Assets","children": [ ' > flare.temp.json 26 | 27 | rwfilter $1 --type=outweb --sport=80,443,8080 --protocol=6 --packets=4- --ack-flag=1 --pass=stdout|rwstats --fields=sip $limitvalue --bytes --no-titles|cut -f 1 -d "|"|rwsetbuild > web_servers.set 28 | rwfilter $1 --type=outweb --sport=80,443,8080 --protocol=6 --packets=4- --ack-flag=1 --sipset=web_servers.set --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "Web Servers",\n"children": [/' | sed '$s/$/\n\]},/' >> flare.temp.json 29 | 30 | rwfilter $1 --type=out --sport=25,465,110,995,143,993 --protocol=6 --packets=4- --ack-flag=1 --pass=stdout|rwset --sip-file=smtpservers.set 31 | rwfilter $1 --type=out --sport=25,465,110,995,143,993 --sipset=smtpservers.set --protocol=6 --packets=4- --ack-flag=1 --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "SMTP Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 32 | 33 | rwfilter $1 --type=out --sport=53 --protocol=17 --pass=stdout|rwstats --fields=sip $limitvalue --packets --no-titles|cut -f 1 -d "|"| rwsetbuild > dnsservers.set 34 | rwfilter $1 --type=out --sport=53 --protocol=17 --sipset=dnsservers.set --pass=stdout | rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "DNS Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 35 | 36 | rwfilter $1 --type=out --protocol=47,50,51 --pass=stdout|rwuniq --fields=sip --no-titles|cut -f 1 -d "|" |rwsetbuild > vpn.set 37 | rwfilter $1 --type=out --sipset=vpn.set --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "VPN Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 38 | 39 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sport=21 --pass=stdout|rwstats --fields=sip $limitvalue --bytes --no-titles|cut -f 1 -d "|"|rwsetbuild > ftpservers.set 40 | rwfilter $1 --type=out --sipset=ftpservers.set --sport=20 --flags-initial=S/SAFR --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "FTP Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 41 | 42 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sport=22 --pass=stdout|rwstats --fields=sip $limitvalue --bytes --no-titles|cut -f 1 -d "|"|rwsetbuild>sshservers.set 43 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sipset=sshservers.set --sport=22 --pass=stdout | rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "SSH Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 44 | 45 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sport=23 --pass=stdout|rwstats --fields=sip $limitvalue --bytes --no-titles|cut -f 1 -d "|"|rwsetbuild > telnetservers.set 46 | rwfilter $1 --type=out --protocol=6 --packets=4- --ack-flag=1 --sipset=telnetservers.set --sport=23 --pass=stdout|rwuniq --fields=sip --bytes --sort-output --no-titles --delimited=,|sed 's/^\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\),\([0-9]\{1,\}\)$/\t{"name": "\1", "size": \2},/g' |sed '$s/,$//g' | sed '1s/^/\{"name": "Telnet Servers",\n"children": [/' | sed '$s/$/\n\]},/' >>flare.temp.json 47 | 48 | cat flare.temp.json | sed '$s/,$/\n/' | sed '$s/$/\]\}/' | tr '\n' ' ' | sed "s/^/var myjson = '/"| sed "s/$/';/" > assets.json 49 | 50 | sed '/dataplaceholder/{ 51 | s/dataplaceholder//g 52 | r assets.json 53 | }' d3chart/treeasset.html 54 | 55 | rm *.set 56 | rm flare.temp.json 57 | rm assets.json 58 | -------------------------------------------------------------------------------- /d3chart/treeasset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 125 | 126 | 127 |dataplaceholder 5 |6 | 94 | 95 | 96 |