Home Tips And Tricks Maltrail – Malicious Traffic Detection System

Maltrail – Malicious Traffic Detection System

by Unallocated Author

Maltrail is a malicious traffic detection system, using publicly available lists containing malicious and/or generally suspicious trails, along with static trails compiled from various AV reports and custom user defined lists, where trail can be anything from domain name , URL  or IP address. Also, it has advanced heuristic mechanisms that can help in discovery of new malware.

How Maltrail works ?

Maltrail is based on the Traffic > Sensor > Server > Client architecture.

Sensor is a standalone component that runs on the monitoring node or at the standalone machine where it “monitors” the passing Traffic for blacklisted items/trails (URLs or IPs).

In case of a positive match, it sends the event details to the main Server where they are being stored inside the appropriate logging directory. If Sensor is being run on the default machine as Server, logs are stored directly into the local logging directory. Otherwise, they are being sent via UDP messages to the remote server.


Image Credit: GitHub

Server’s primary role is to store the event details and provide back-end support for the reporting web application. In default configuration, server and sensor will run on the same machine. So, to prevent potential disruptions in sensor activities, the front-end reporting part is based on the “Fat client” architecture.

Events for the chosen period are transferred to the Client, where the reporting web application is solely responsible for the presentation part. Data is sent toward the client in compressed chunks, where they are processed sequentially.

The final report is created in a highly condensed form, practically allowing presentation of virtually unlimited number of events.

Note: Server component can be skipped altogether, and just use the standalone Sensor. In such case, all events would be stored in the local logging directory, while the log entries could be examined either manually or by some CSV reading application.


  • Python 2.6.x or 2.7.x
  • pcapy (sudo apt-get install python-pcapy)
  • Sensor component with the admin/root privileges.


Enter the following commands

  • sudo apt-get install python-pcapy
  • git clone https://github.com/stamparm/maltrail.git
  • cd maltrail
  • sudo python sensor.py

Now to start the server on same machine, open a new terminal and type the following command

  • [[ -d maltrail ]] || git clone https://github.com/stamparm/maltrail.git
  • cd maltrail
  • python server.py

After starting the server now you have to test that everything is up

  • ping -c 1
  • cat /var/log/maltrail/$(date +"%Y-%m-%d").log

Access the interface by visiting from your web browser.

For more information about Maltrails you can visit GitHub for change of sensor configuration settings, server configuration settings and user guide.

Free Download: Maltrails (from GitHub)

You may also like

Latest Hacking News

Privacy Preference Center


The __cfduid cookie is used to identify individual clients behind a shared IP address and apply security settings on a per-client basis.

cookie_notice_accepted and gdpr[allowed_cookies] are used to identify the choices made from the user regarding cookie consent.

For example, if a visitor is in a coffee shop where there may be several infected machines, but the specific visitor's machine is trusted (for example, because they completed a challenge within your Challenge Passage period), the cookie allows Cloudflare to identify that client and not challenge them again. It does not correspond to any user ID in your web application, and does not store any personally identifiable information.

__cfduid, cookie_notice_accepted, gdpr[allowed_cookies]


DoubleClick by Google refers to the DoubleClick Digital Marketing platform which is a separate division within Google. This is Google’s most advanced advertising tools set, which includes five interconnected platform components.

DoubleClick Campaign Manager: the ad-serving platform, called an Ad Server, that delivers ads to your customers and measures all online advertising, even across screens and channels.

DoubleClick Bid Manager – the programmatic bidding platform for bidding on high-quality ad inventory from more than 47 ad marketplaces including Google Display Network.

DoubleClick Ad Exchange: the world’s largest ad marketplace for purchasing display, video, mobile, Search and even Facebook inventory.

DoubleClick Search: is more powerful than AdWords and used for purchasing search ads across Google, Yahoo, and Bing.

DoubleClick Creative Solutions: for designing, delivering and measuring rich media (video) ads, interactive and expandable ads.



The _ga is asssociated with Google Universal Analytics - which is a significant update to Google's more commonly used analytics service. This cookie is used to distinguish unique users by assigning a randomly generated number as a client identifier. It is included in each page request in a site and used to calculate visitor, session and campaign data for the sites analytics reports. By default it is set to expire after 2 years, although this is customisable by website owners.

The _gat global object is used to create and retrieve tracker objects, from which all other methods are invoked. Therefore the methods in this list should be run only off a tracker object created using the _gat global variable. All other methods should be called using the _gaq global object for asynchronous tracking.

_gid works as a user navigates between web pages, they can use the gtag.js tagging library to record information about the page the user has seen (for example, the page's URL) in Google Analytics. The gtag.js tagging library uses HTTP Cookies to "remember" the user's previous interactions with the web pages.

_ga, _gat, _gid