function updateChart(e){var t,a,o,i,r=e.chart;if(delete e.chart,e.filter=filter.getFilter(),e.detail)if(e.detailChartType=detailChartType,e.filter.start=currentStartDate,e.filter.end=currentEndDate,"typeDate"==detailChartType)e.pie=!0,t={text:"Types of Incidents"},a={text:"per day"},i={text:"Incidents per day"};else{if("countryDate"!=detailChartType)return void console.log("error: unknown type: "+detailChartType);e.pie=!0,t={text:"Source countries"},a={text:"per day"},i={text:"Incidents per day"}}(t||a)&&r.setTitle(t,a),o&&r.xAxis[0].setTitle(o),i&&r.yAxis[0].setTitle(i),r.showLoading("loading.."),socket.emit("getStatistics",e,function(t){if(console.log("getStatistics returned: ",t),!t||0==t.length)return void r.showLoading("No data for that selection!");var a=createChartSeries(t,e);setChartData(r,a)})}function setChartData(e,t){for(var a=e.series.length,o=0;oi;i++)e.series[0].remove(!1);e.hideLoading(),e.redraw(),$(".highcharts-legend-item > span").each(function(e,t){t.onclick=null})}function createChartSeries(e,t){function a(e){return e%8==0?"#0000FF":e%8==1?"#FF0000":e%8==2?"#00FF00":e%8==3?"#FFFF00":e%8==4?"#FF00FF":e%8==5?"#00FFFF":e%8==6?"#FF7F00":e%8==7?"#808080":void 0}console.log("createChartSeries",e,t);var o,i=[];t.pie&&(o={type:"pie",name:"Total incidents",center:[160,55],size:100,showInLegend:!1,data:[]});for(var r=0;r"),e.append("
Click and drag the mouse across the above timeline to choose a timespan."),createMasterChart(),!0}return!1}function loadStats(e,t){e&&(detailChartType=e);var a=createCharts();a||(updateChart({chart:detailChart,detail:!0}),t&&updateChart({chart:masterChart,detail:!1}))}function filterUpdateStats(){loadStats(null,!0)}function showLog(e){console.log("showLog "+e),socket.emit("getLog",e,function(t){console.log("showLog content: "+t),$("#showLogLabel").text("Log for id "+e),$("#showLogBody").html(t),$("#showLog").modal()})}function requestAttackUpdate(){requestAttacks()}function requestAttacks(){if(!$("#getIncidents").hasClass("disabled")){$(".bar").css("width",0),refreshMap(),$("#getIncidents").text("Loading Data"),$("#getIncidents").addClass("disabled"),enableRequestControl();var e=filter.getFilter();e.start=$("#jrange").jrange("getStartDate"),e.end=$("#jrange").jrange("getEndDate"),console.log("filter: ",e),socket.emit("requestAttacks",e)}}function enableRequestControl(){$("#stopButton").removeClass("disabled"),$("#playButton").removeClass("disabled"),$("#slowerButton").removeClass("disabled"),$("#fasterButton").removeClass("disabled"),$("#showAllButton").removeClass("disabled")}function disableRequestControl(){$("#stopButton").addClass("disabled"),$("#playButton").addClass("disabled"),$("#slowerButton").addClass("disabled"),$("#fasterButton").addClass("disabled"),$("#showAllButton").addClass("disabled")}function addPanelSelectButton(e){setTimeout(function(){var t=$(e).datepicker("widget").find(".ui-datepicker-buttonpane"),a=$('');a.unbind("click").bind("click",function(){setTimeout(function(){$("#hideTable").html("")},300);var t=$("#ui-datepicker-div .ui-datepicker-month :selected").val(),a=$("#ui-datepicker-div .ui-datepicker-year :selected").val();$(e).datepicker("option","defaultDate",new Date(a,t)),$(e).datepicker("setDate",new Date(a,t)),currentRequestID="inputDateNoDay"}),0==t.has("#customClearButton").length&&a.appendTo(t)},1)}function showHelpPopovers(){titleHelp(),mainMenuHelp(),dbHelp(),statsHelp()}function hideHelpPopovers(){help=!1,$("[onHelpActive]").each(function(e,t){$(t).popover("destroy")})}function titleHelp(){$("#header").popover({title:"Project: TraCINg",content:'This project deals with cyber attacks (mostly malware). The attacks origin is marked on one of the maps or on the table below or will be as soon as an attack occurs unless you want to view stored data and switch to database view. It might take some time for an attack to occur, so be patient. We can only show attacks aimed at our sensors (which are not marked on the map). If you need more information, go to our "About" or browse around the "Help". Have fun exploring!',trigger:trigger,placement:"bottom"})}function mainMenuHelp(){$("#toggleView").popover({html:!0,title:"Toogle View",content:"Click one of these buttons to toggle between live and dabase view.
Live View: Shows you attacks currently detected by our sensors, updating with every attack.
Database View: Enables you to request past attacks which will be shown on the maps and globe and in the table.",trigger:trigger,placement:"bottom"}),$("#2DViewEntry").popover({title:"2D Map View",content:"Click here for a 2D view of the attacks. This map shows the sources of attacks detected by our sensors. For more detailed information, hover over countries and markers. A countries color represents the number of attacks originating from there; the darker the red, the more attacks originate from this country. You can also zoom in and out using the mouse wheel and move around the map by moving the mouse while holding down the left mouse button (if zoomed in). Keyboard controls are described in the bottom left corner.",trigger:trigger,placement:"bottom"}),$("#StreetViewEntry").popover({title:"Streetmap View",content:"Click here for a streetmap view of the attacks (also in 2D). This map shows the sources of attacks detected by our sensors. For more detailed information, click the markers. Coloring and country hover is not supported here. You can also zoom in and out using the mouse wheel and move around the map by moving the mouse while holding down the left mouse button. Keyboard controls are described in the bottom left corner.",trigger:trigger,placement:"bottom"}),$("#3DViewEntry").popover({title:"3D Globe View",content:'Click here for a 3D view of the attacks. This globe shows the sources of attacks detected by our sensors. For more detailed information, hover over countries and markers. A countries color represents the number of attacks originating from there; the darker the red, the more attacks originate from this country. Toggle a heatmap by pressing "t" on your keyboard. You can also zoom in and out using the mouse wheel and move the globe by moving the mouse while holding down the left mouse button. Keyboard controls are described in the bottom left corner.',trigger:trigger,placement:"bottom"}),$("#tableViewEntry").popover({title:"Table View",content:'Click here for a table representation of the attack data received from the sensors. This table always shows exactly the attacks which are currently represented on the maps/globe (no less, no more). This behavior is independent from live or database view. Hover over the entries in "Attack Types" to learn more about them.',trigger:trigger,placement:"bottom"}),$("#statsEntry").popover({title:"Statistic View",content:"Click here for a statistic on our assembled attack data. The top left pie chart gives you an overview of the relative distribution of the number of attacks given attack types or countries. The major statistic shows the number of attacks by type or country over time (addatively).",trigger:trigger,placement:"bottom"});var e;"hover"==trigger&&(e='To view helpful information hover over the elements (marked with a green frame). Click "Help" again to deactivate the information display.'),"click"==trigger&&(e='To view helpful information click the elements (marked with a green frame). Click "Help" again to deactivate the information display.'),"focus"==trigger&&(e='To view helpful information focus the elements (marked with a green frame). Click "Help" again to deactivate the information display.'),$("#helpEntry").popover({title:"Help",content:e,trigger:trigger,placement:"bottom"}),$("#aboutViewEntry").popover({title:"About View",content:"Click here for information about the project, about what you see on the page and which software is being used.",trigger:trigger,placement:"bottom"}),$("#advMarkerInfo").popover({title:"Display Advanced Marker Information",content:"Activate this button to get more information on marker hover. Deactivate it to show less information.",trigger:trigger,placement:"bottom"}),$("#resetMap").popover({title:"Reset Map Button",content:"Click here to reset the map, i.e. delete all markers plus marker and region information and change the region coloring to default. The table will also be cleared in the progress.",trigger:trigger,placement:"bottom"})}function dbHelp(){$("#jrange").popover({title:"Datepicker",content:'Click here to open a datepicker and choose a date for a request. You may select a single day or a range of days by clicking either one day or a start and end day. You can pick a range longer than a month. The "Done" button will save your selection and close the datepicker. If you have not selected anything the selection will not change. If you want to choose the current month you can click on "Select Month". Click on the "Get Incidents" button to start the request or use "Filter" at the bottom.',trigger:trigger,placement:function(){return $(window).width()<980?"bottom":"right"}}),$("#getIncidents").popover({html:"true",title:"Request Incidents Button (resets map automatically)",content:"Click here to load the entries from the Database which correspond to the request specified in the above menu. If no request is specified todays attack data will be requested automatically. The attacks will load one after the other starting with the first of the day so you may interact with the loading progress using the control buttons below.
Warning: This will reset the map, i.e. delete all markers plus marker and region information and change the region coloring to default!",trigger:trigger,placement:function(){return $(window).width()<980?"bottom":"right"}}),$("#loadingProgressBar").popover({title:"Request Progress Bar",content:"This bar will show you the progress of your database request, i.e. the percentage of the data which is already shown.",trigger:trigger,placement:function(){return $(window).width()<980?"bottom":"right"}}),$("#stopButton").popover({title:"Stop Request",content:"Click here to cancel the request so you will be able to make a new request. It will not reset the map automatically. Note: Switching back to live view will always stop the loading progress!",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#playButton").popover({title:"Pause or Play Data",content:"Click here to toggle between pause and play which enables you to pause the loading, explore the maps/globe, table etc. and start the request from where you paused it again whenever you like. This will not work however, if you switch back to the live view because switching to live view will stop the loading progress!",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#fasterSlowerButton").popover({title:"Speed Control",content:"These buttons enable you to control the loading speed in which database requests show. The left button will slow down the speed with which attacks will be shown, the right button will make it faster.",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#showAllButton").popover({title:"Show All Data At Once",content:"Click here to immediately load all the data.",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#selectStatsCountries2").popover({html:!0,title:"Filter Request",content:"Click here to open a filter menu to do a customized request.
Warning: This will reset the map, i.e. delete all markers plus marker and region information and change the region coloring to default!",trigger:trigger,placement:"top"})}function statsHelp(){$("#getStatstypeDate").popover({title:"Show Timeline of attacks by Type",content:"Click here to show a statistic of the number of attacks over time by attack type.",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#getStatscountryDate").popover({title:"Show Timeline of attacks by Country",content:"Click here to show a statistic of the number of attacks over time by country (from which the attack originated).",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#chartdivmaster").popover({title:"Timeline",content:"This timeline shows a miniature graph of all available database data. Click and drag the mouse here to show a more detailed excerpt of the data. The time range you choose will be marked in orange and the statistics graph will update to show you the data that has been collected within the orange timespan.",trigger:trigger,placement:"top"}),$("#selectStatsCountries1").popover({title:"Filter Graph",content:"Click here to open a filter menu to customize the statistics graph.",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}})}function setLeftContent(e){$("#leftWin").children("div").each(function(t,a){a.id==e?$(a).show():$(a).hide()})}function updateMainWidth(){$("[LeftWinAdd], [LeftWinRemove]").each(function(e,t){var a=$(t).attr("LeftWinAdd"),o=$(t).attr("LeftWinRemove");$("#leftWin").is(":visible")?(toggleCenterDivs(),$(t).removeClass(o),$(t).addClass(a)):($(t).removeClass(a),$(t).addClass(o),toggleCenterDivs())})}function updateWins(e,t,a,o){setLeftContent(e),t?$("#leftWin").show():$("#leftWin").hide(),a?($("#liveView").removeClass("disabled"),$("#dbView").removeClass("disabled")):($("#liveView").addClass("disabled"),$("#dbView").addClass("disabled")),o?filter.load(o):filter.unload(),updateMainWidth()}function updateHelpElements(){$("[onHelpActive]").each(function(e,t){var a=$(t).attr("onHelpActive");help?$(t).addClass(a):$(t).removeClass(a)})}function updateMenu(e){if("map"==e)world.showMap(),world.jvmHasMarker()?$("#tableWaitingAlert").remove():showInfoNoData(),help&&$("#helpEntry").addClass("active"),$("#map").resize(),updateWins("dbWin",!live,!0,!live&&requestAttackUpdate),$("#advMarkerInfo").removeClass("disabled"),$("#resetMap").removeClass("disabled");else if("streetmap"==e)world.showStreetmap(),world.stMapHasMarker()?$("#tableWaitingAlert").remove():showInfoNoData(),help&&$("#helpEntry").addClass("active"),updateWins("dbWin",!live,!0,!live&&requestAttackUpdate),$("#advMarkerInfo").removeClass("disabled"),$("#resetMap").removeClass("disabled");else if("globe"==e)world.showGlobe(),world.globeHasMarker()?$("#tableWaitingAlert").remove():showInfoNoData(),help&&$("#helpEntry").addClass("active"),updateWins("dbWin",!live,!0,!live&&requestAttackUpdate),$("#advMarkerInfo").removeClass("disabled"),$("#resetMap").removeClass("disabled");else if("table"==e)world.leaveMap(),help&&$("#helpEntry").addClass("active"),$("#table .dataTables_empty").length>0?showInfoNoData():$("#tableWaitingAlert").remove(),updateWins("dbWin",!live,!0,!live&&requestAttackUpdate),$("#advMarkerInfo").addClass("disabled"),$("#resetMap").removeClass("disabled"),world.resize();else if("stats"==e){world.leaveMap(),$("#tableWaitingAlert").remove(),help&&$("#helpEntry").addClass("active"),updateWins("statsWin",!0,!1,filterUpdateStats);var t=createCharts();t||filterUpdateStats(),$("#advMarkerInfo").addClass("disabled"),$("#resetMap").addClass("disabled")}else console.log("menue: unknown tab: "+e)}function showInfoNoData(){!$("#tableWaitingAlert").length>0&&showalert("tableWaitingAlert","Waiting for data...","Once attacks occur or are requested in the dabase view they will show up below. To display attacks on both maps and the globe you need to load them separately (i.e. click their menu entry once). Otherwise they will stay empty even if attacks occur until you load them.","info",!1)}function refreshMap(){$("#stats").is(":visible")||showInfoNoData(),world.reset(),world.resetTable()}function jVectorMap2GeoIP(e){return"_"!=e[0]?e:"_0"==e?"TR":"_1"==e?"RS":"_2"==e?"EH":"_3"==e?"SO":void console.log("Can not map cc '"+e+"' to GeoIP!")}function GeoIP2jVectorMap(e){return"TR"==e?["_0","TR"]:"RS"==e?["_1","RS"]:"EH"==e?["_2"]:"SO"==e?["_3","SO"]:-1!=$.inArray(e,filter.allCountriesJVectorMap)?[e]:[]}function goToLocationHash(){if(!window.location.hash)return void(window.location.hash="/map");$("#mainContent > div").hide(),$("#errorOutput").show(),$("#menutabs > li").removeClass("active");var e=window.location.hash&&window.location.hash.split("/")[1]||"map",t=$("#"+e);t.show(),updateMenu(e);var a=$("#tab_"+e).parent();a&&a.addClass("active")}function toggleCenterDivs(){$("#leftWin").is(":visible")?$(".center").css("margin-left",""):$(".center").css("margin-left",function(){return $(window).width()/20})}function showalert(e,t,a,o,i){var r='

'+t+"

"+a+"
";$("#errorOutput").append(r),i&&setTimeout(function(){$("#"+e).remove()},1e4)}function typeid2str(e){return fields&&fields.type.hasOwnProperty(e)?fields.type[e]:fields&&fields.type[0]||"Unknown"}function typeid2descr(e){return fields&&fields.type_description.hasOwnProperty(e)?fields.type_description[e]:fields&&fields.type_description[0]||""}var countryName={A1:"Anonymous Proxy",A2:"Satellite Provider",O1:"Other Country",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AP:"Asia/Pacific Region",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Aland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Bartelemey",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Saint Eustatius and Saba Bonaire",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"The Democratic Republic of the Congo",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curacao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",EU:"Europe",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (Malvinas)",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Islamic Republic of Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"Democratic People's Republic of Korea",KR:"Republic of Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao People's Democratic Republic",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libyan Arab Jamahiriya",MA:"Morocco",MC:"Monaco",MD:"Republic of Moldova",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestinian Territory",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syrian Arab Republic",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"United Republic of Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"British Virgin Islands",VI:"U.S. Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},map=function(e,t,a){function o(e){var t=c[e];s[t]>0&&(l--,s[t]=s[t]-1,d.removeMarkers([e]),i())}function i(){d.series.regions[0].setValues(s)}var r=0,n=500,s={},l=0,c=[n],d=new jvm.Map({container:e,map:t,backgroundColor:a,markers:[],series:{regions:[{attribute:"fill",min:-1,max:-2,scale:["#FFFFFF","#FF0000"],normalizeFunction:function(e){return-1==e?0:-2==e?1:0==l?0:Math.pow(e/l,1/3)}}]},onRegionLabelShow:function(e,t,a){var o=s[a]||0;t.html(1==o?t.html()+" ("+o+" attack of "+l+" total)":t.html()+" ("+o+" attacks of "+l+" total)")},onMarkerLabelShow:function(e,t){if(advInfo)t.html(t.text());else{var a=t.text().split(";");t.html(a[0])}}});this.reset=function(){d.removeAllMarkers(),d.series.regions[0].clear(),r=0,l=0,s={}},this.zoom=function(e){d.setScale(d.scale*e,d.width/2,d.height/2)},this.move=function(e,t){var a=d.scale;d.transX+=e/a,d.transY+=t/a,d.applyTransform()},this.addMarker=function(e,t,a,u){void 0!=d.markers[r]&&o(r),l++,s[e]=(0|s[e])+1,c[r]=e,d.addMarker(r,{latLng:t.reverse(),style:{r:5,fill:a},name:u},[]),i();var h=r;return r=(r+1)%n,h},this.removeMarker=o,this.getPosition=function(e,t){return d.latLngToPoint(e,t)},this.hasMarker=function(){return l>0?!0:!1}},streetmap=function(e){function t(e){void 0!=i[e]&&(a.removeLayer(i[e]),i[e]=void 0)}var a=new L.Map(e),o=500,i=[o],r=0,n=100,s=0;a.setView([35,0],3,{animate:!1}),a.keyboard.disable(),L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",noWrap:!0,minZoom:1}).addTo(a),a.setMaxBounds(new L.LatLngBounds([-190,-290],[190,290])),this.addMarker=function(e,l,c){s++;var d=500,u=new L.LatLng(e[0],e[1]),h=L.circle(u,d,{color:l,fillColor:l,fillOpacity:.5});h.addTo(a);var p=new L.Popup({autoPan:!1}).setContent(c);h.bindPopup(p);var f;h.on("mouseover",function(){var e=c.split(";");this._popup.setContent(advInfo?c:e[0]),this.openPopup();var t=this;p._container.addEventListener("mouseleave",function(){f=setTimeout(function(){t.closePopup()},n)}),p._container.addEventListener("mouseenter",function(){clearTimeout(f)})}),t(r),i[r]=h;var m=r;return r=(r+1)%o,m},this.removeMarker=t,this.reset=function(){for(var e=0;e0?!0:!1}};$(function(){$("body").on("shown","#StreetViewEntry",function(){stmap.invalidateSize(!1)})});var detailChartType="typeDate",defaultEndDate=Date.now(),defaultStartDate=defaultEndDate-12096e5,currentStartDate=defaultStartDate,currentEndDate=defaultEndDate,detailChart,masterChart,createdCharts=!1,Controller=function(){function e(e){o={},l=!0,i={IN:0,OUT:1,UP:2,DOWN:3,LEFT:4,RIGHT:5},document.addEventListener("keydown",a,!1),document.addEventListener("keyup",t,!1),e.args=i}function t(e){var t=e.keyCode;17==t&&(o.STRG=!1),18==t&&(o.ALT=!1),91==t&&(o.SUPER=!1),225==t&&(o.ALT_GR=!1)}function a(e){var t=e.keyCode;17==t&&(o.STRG=!0),18==t&&(o.ALT=!0),91==t&&(o.SUPER=!0),225==t&&(o.ALT_GR=!0);var a=!1;for(var c in o)a|=o[c];if(!a&&l)switch(t){case 38:void 0!=r&&(e.preventDefault(),r(i.IN));break;case 40:void 0!=r&&(e.preventDefault(),r(i.OUT));break;case 87:void 0!=n&&(e.preventDefault(),n(i.UP));break;case 65:void 0!=n&&(e.preventDefault(),n(i.LEFT));break;case 83:void 0!=n&&(e.preventDefault(),n(i.DOWN));break;case 68:void 0!=n&&(e.preventDefault(),n(i.RIGHT));break;case 84:void 0!=s&&(e.preventDefault(),s())}}var o,i,r,n,s,l;this.registerCallbacks=function(e){r=e.zoom,n=e.move,s=e.toggle},this.unregisterCallbacks=function(){r=void 0,n=void 0,s=void 0},this.toggleEnabled=function(){return l=!l},e(this)},world=new function(){function e(e,a){var o="";o+=a?"Live data":"Database data";var i=new String(e.src.ll?e.src.ll[0]:"")+new String(e.src.ll?e.src.ll[1]:""),r=b[i];null!=r&&(o+=1==r?": "+r+" attack":": "+r+" attacks"),o+="
Attack source (marked here): ",""!=e.src.city&&void 0!=e.src.city&&(o+=e.src.city+", "),o+=e.src.country,o+=";
Destination: ",""!=e.dst.city&&void 0!=e.dst.city&&(o+=e.dst.city+", "),o+=""!=e.dst.country&&void 0!=e.dst.country?e.dst.country:"Unknown",o+=";
Date: "+t(e);var n=typeid2str(e.type);return o+=";
Type: "+n,o+=e.authorized?";
Authorized Sensor":";
Unauthorized Sensor"}function t(e){var t=e.date&&new Date(e.date)||new Date,a=t.getDate();t.getDate()<10&&(a="0"+t.getDate());var o=t.getMonth()+1;t.getMonth()+1<10&&(o="0"+(t.getMonth()+1));var i=t.getHours();t.getHours()<10&&(i="0"+t.getHours());var r=t.getMinutes();t.getMinutes()<10&&(r="0"+t.getMinutes());var n=a+"."+o+"."+t.getFullYear()+" "+i+":"+r;return n}function a(e){void 0==e.src.city&&(e.src.city=""),void 0==e.dst.country&&(e.dst.country=""),void 0==e.dst.city&&(e.dst.city=""),0==e.src.port&&(e.src.port=""),0==e.dst.port&&(e.dst.port=""),dateFormat=t(e);var a="";e.hasLog&&(a="show log");var o=typeid2str(e.type),i=typeid2descr(e.type),r="";if(e.md5sum&&""!=e.md5sum){var n="https://www.virustotal.com/en/search/?query="+e.md5sum,s="Md5sum of malware hash: "+e.md5sum+"
Get more information about this malware from virustotal: Click here (by doing so you will open a different website)!",l='"./extern/bootstrap/images/glyphicons-halflings.png"';r=""}var c="";c=e.authorized?"

Yes

":"

No

";var d=[e.sensortype,e.sensorname,''+o+"",dateFormat,e.src.country,e.src.city,e.src.port,e.dst.country,e.dst.city,e.dst.port,c,r,a];return d}function o(e){$("#attackTable").dataTable().fnAddData(e),i()}function i(){console.log("makePopovers"),$("a[rel=popover]").popover({})}function r(e,t,a,o,i){var r={"background-color":a,position:"absolute","border-radius":"100px",height:"40px",width:"40px","margin-top":"-20px","margin-left":"-20px",left:e+"px",top:t+"px"};$(o).append('
"+countryName[e]+"";$("#selectCountriesSelection").html(html),filter.countrySelection=$("#selectCountriesSelection").multiselect({selectedText:"# of # countries selected",noneSelectedText:"Pick countries manually by clicking on the map or choose them here",position:{my:"left bottom",at:"left top"},minWidth:550,header:!1,click:filter.clickGeoIP});for(var e in filter.countrySelectionMap.regions)filter.allCountriesJVectorMap.push(e);$("#selectCountriesAll").click(filter.selectAllCountries),$("#selectCountriesClear").click(filter.clearCountries)},this.initAttackTypes=function(){this.attackTypeSelection=$("#filterAttackType").multiselect({selectedText:"# of # attack types selected",noneSelectedText:"Filter attack types",position:{my:"left bottom",at:"left top"}})},this.initSensorTypes=function(){this.sensorTypeSelection=$("#filterSensorType").multiselect({selectedText:"# of # sensor types selected",noneSelectedText:"Filter sensor types",position:{my:"left bottom",at:"left top"}})},this.show=function(){filter.countrySelection.val(filter.countries),filter.countrySelection.multiselect("refresh"),filter.disableOnRegionSelected=!0,filter.countrySelectionMap.setSelectedRegions(filter.countriesMap),filter.disableOnRegionSelected=!1,filter.attackTypeSelection.val(filter.types),filter.attackTypeSelection.multiselect("refresh"),filter.sensorTypeSelection.val(filter.sensors),filter.sensorTypeSelection.multiselect("refresh"),$("#selectCountriesView").modal("show")},this.finish=function(){filter.countries=filter.countrySelection.val(),filter.countriesMap=filter.countrySelectionMap.getSelectedRegions(),filter.types=filter.attackTypeSelection.val(),filter.sensors=filter.sensorTypeSelection.val(),$("#selectCountriesView").modal("hide"),filter.updateCallback?filter.updateCallback():console.log("filter.updateCallback is null")},this.selectAllCountries=function(){filter.disableOnRegionSelected=!0,filter.countrySelectionMap.setSelectedRegions(filter.allCountriesJVectorMap),filter.countrySelection.multiselect("checkAll"),filter.disableOnRegionSelected=!1},this.clearCountries=function(){filter.disableOnRegionSelected=!0,filter.countrySelectionMap.clearSelectedRegions(),filter.countrySelection.multiselect("uncheckAll"),filter.disableOnRegionSelected=!1},this.reset=function(){filter.clearCountries(),filter.attackTypeSelection.multiselect("uncheckAll"),filter.sensorTypeSelection.multiselect("uncheckAll"),filter.countrySelection.multiselect("uncheckAll"),filter.authorizedCheckbox.prop("checked",!1)},this.clickJVectorMap=function(e,t,a){if(!filter.disableOnRegionSelected){var o=jVectorMap2GeoIP(t);filter.updateJVectorMap(o,a),filter.updateGeoIP(o,a)}},this.clickGeoIP=function(e,t){filter.updateJVectorMap(t.value,t.checked)},this.updateJVectorMap=function(e,t){var a=GeoIP2jVectorMap(e);if(a&&a.length>0){for(var o={},i=0;i0&&(e.types=filter.types),filter.sensors&&filter.sensors.length>0&&(e.sensors=filter.sensors),filter.countries&&0!=filter.countries.length&&filter.countries.length!=filter.allCountriesGeoIP.length&&(e.countries=filter.countries),e}};$(function(){filter.initialize()});var socket=io.connect("/");$(function(){$("[rel=tooltip]").tooltip(),advInfo=!1,$("#map").css("height",function(){return Math.min($("#map").width()/2+50,.8*$(window).height())}),$(leftWin).hide(),toggleCenterDivs(),goToLocationHash(),$(window).on("hashchange",goToLocationHash),disableRequestControl(),$("#inputDateDay").datepicker("setDate","null"),$("#inputDateNoDay").datepicker("setDate","null"),$("div.jvectormap-zoomin").each(function(){$(this).rel+="tooltip",$(this).attr("title","Zoom in")}),$("div.jvectormap-zoomout").each(function(){$(this).rel+="tooltip",$(this).attr("title","Zoom out")})}),$(window).resize(function(){toggleCenterDivs(),$("#map").css("height",function(){return Math.min($("#map").width()/2+50,.8*$(window).height())})}),socket.on("error",function(e){var t="Errno: "+e.errno+"
Code: "+e.code;showalert("dbAlert","Database Error!",t,"error",!0),$("#getIncidents").text("Get Incidents"),$("#getIncidents").removeClass("disabled"),disableRequestControl()}),socket.on("incidents",function(e){console.log(e),world.delayedMarking(e,live),0==e.length&&showalert("noDataAlert","Request Error!","No data found for this request.","error",!0)}),socket.on("markIncident",function(e){if(live){world.markIncident(e,live);var t=world.generateTableEntry(e);world.makeTableEntry(t)}});var fields;socket.on("setFields",function(e){fields=e;var t="";for(var a in e.type)t+="";$("#filterAttackType").html(t),filter.initAttackTypes()}),socket.on("setSensors",function(e){for(var t="",a=0;a"+o+""}$("#filterSensorType").html(t),filter.initSensorTypes()});