



Within this library, the create_session() function is of particular interest, as shown below.

















In the last few months, I have been testing several Trend Micro products with Steven Seeley ( @steventseeley ). Together, we have found more than 200+ RCE (Remote Code Execution) vulnerabilities and for the first time we presented the outcome of our research at Hack In The Box 2017 Amsterdam in April.The presentation is available as a PDF or as a Slideshare Since it was not possible to cover all discovered vulnerabilities with a single presentation, this blog post will cover and analyze a further vulnerability that did not make it to the slides, and which affects the Trend Micro Threat Discovery Appliance (TDA) product.This was an interesting vulnerability, discovered after observing that two consecutive login attempts against the web interface returned the same session_id token. Following this observation, our inference was that time factor played a role. After further analysis and reversing of the TDA libraries, the session management was found to be defined in the following library: /opt/TrendMicro/MinorityReport/lib/mini_httpd/utils.soThis function performs the following actions:- Gets current time- Use time as “seed”- Use srand() with above seed- MD5 hash the restAll these functions can be shortened as the following:The vulnerability is that the seed is predictable, and therefore an attacker can generate session IDs issued in the past.However, there are two conditions which affect exploitation of this vulnerability:1) A legitimate user has to be authenticated - a session token is associated with an IP address when a user logs in2) Attacker needs to perform the attack with the same IP address of legitimate userThe second condition is not an issue in a NATed environment but in a different environment it's definitely the most significant constraint.A further conclusion is that although the attacker is able to technically predict "future" session_id tokens, there is no point in doing that, since condition (1) has to be to met first and an association between an IP address and session_id has to exist in the database.The exploit Proof-of-Concept (poc) has been published here and below a video showing the attack in action:The exploits for all the other TDA vulnerabilities that were discovered as part of this research can be found below:A Metasploit module has been developed and added to the master branch: