Cyber Security GeoIP Attack Map

该项目为一款实时显示网络攻击的地理IP攻击地图可视化工具。它通过解析系统日志文件来获取源IP、目的IP等信息,并根据不同协议类型改变颜色显示。此项目借鉴了2015年帕尔梅托网络安全竞赛中使用的网络流量可视化工具。

First and Foremost

I do not have much time in my life right now to maintain this project. I undertook this challenge as a means to learn JavaScript, and to improve upon the Python I already knew. I'm sure there are several things I could have done differently in my implementation, and I won't be offended if I receive constructive criticism from someone who downloads and views my code. I know I learned a ton when working on this, and I hope the open source community will continue to teach me things :)

Cyber Security GeoIP Attack Map Visualization

This geoip attack map visualizer was developed to display network attacks on your organization in real time. The data server follows a syslog file, and parses out source IP, destination IP, source port, and destination port. Protocols are determined via common ports, and the visualizations vary in color based on protocol type. CLICK HERE for a demo video. This project would not be possible if it weren't for Sam Cappella, who created a cyber defense competition network traffic visualizer for the 2015 Palmetto Cyber Defense Competition. I mainly used his code as a reference, but I did borrow a few functions while creating the display server, and visual aspects of the webapp. I would also like to give special thanks to Dylan Madisetti as well for giving me advice about certain aspects of my implementation.

Important

This program relies entirely on syslog, and because all appliances format logs differently, you will need to customize the log parsing function(s). If your organization uses a security information and event management system (SIEM), it can probably normalize logs to save you a ton of time writing regex.

  1. Send all syslog to SIEM.
  2. Use SIEM to normalize logs.
  3. Send normalized logs to the box (any Linux machine running syslog-ng will work) running this software so the data server can parse them.

Configs

  1. Make sure in /etc/redis/redis.conf to change bind 127.0.0.1 to bind 0.0.0.0 if you plan on running the DataServer on a different machine than the AttackMapServer.
  2. Make sure that the WebSocket address in /AttackMapServer/index.html points back to the IP address of the AttackMapServer so the browser knows the address of the WebSocket.
  3. Download the MaxMind GeoLite2 database, and change the db_path variable in DataServer.py to the wherever you store the database.
    • ./db-dl.sh
  4. Add headquarters latitude/longitude to hqLatLng variable in index.html
  5. Use syslog-gen.py, or syslog-gen.sh to simulate dummy traffic "out of the box."
  6. IMPORTANT: Remember, this code will only run correctly in a production environment after personalizing the parsing functions. The default parsing function is only written to parse ./syslog-gen.sh traffic.

Bugs, Feedback, and Questions

If you find any errors or bugs, please let me know. Questions and feedback are also welcome, and can be sent to mcmay.web@gmail.com, or open an issue in this repository.

Deploy example

Tested on Ubuntu 16.04 LTS.

  • Clone the application:

    git clone https://github.com/matthewclarkmay/geoip-attack-map.git
  • Install system dependencies:

    sudo apt install python3-pip redis-server
  • Install python requirements:

    cd geoip-attack-map
    sudo pip3 install -U -r requirements.txt
  • Start Redis Server:

    redis-server
  • Configure the Data Server DB:

    cd DataServerDB
    ./db-dl.sh
    cd ..
  • Start the Data Server:

    cd DataServer
    sudo python3 DataServer.py
  • Start the Syslog Gen Script, inside DataServer directory:

    • Open a new terminal tab (Ctrl+Shift+T, on Ubuntu).

      ./syslog-gen.py
      ./syslog-gen.sh
  • Configure the Attack Map Server, extract the flags to the right place:

    • Open a new terminal tab (Ctrl+Shift+T, on Ubuntu).

      cd AttackMapServer/
      unzip static/flags.zip
  • Start the Attack Map Server:

    sudo python3 AttackMapServer.py
  • Access the Attack Map Server from browser:

    • http://localhost:8888/ or http://127.0.0.1:8888/

    • To access via browser on another computer, use the external IP of the machine running the AttackMapServer.

    • Edit the IP Address in the file "/static/map.js" at "AttackMapServer" directory. From:

      var webSock = new WebSocket("ws:/127.0.0.1:8888/websocket");
    • To, for example:

      var webSock = new WebSocket("ws:/192.168.1.100:8888/websocket");
    • Restart the Attack Map Server:

      sudo python3 AttackMapServer.py
    • On the other computer, points the browser to:

      http://192.168.1.100:8888/

转载于:https://my.oschina.net/baiyuanlab/blog/1575314

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值