The increasing digitalization of transportation systems exposes them to growing cybersecurity risks, including SQL injection, XSS, CSRF, and DDoS attacks. This paper proposes a multi-layered web application security framework tailored for smart mobility platforms, integrating traditional OWASP practices with machine learning techniques. A Ruby on Rails-based tool, Risk Hunter is designed to detect and respond to malicious traffic using behavioral analysis and customizable CSRF checking, as well as detecting data strings related to malicious XSS scripts and SQL injections. Testing confirms the tool's effectiveness in mitigating threats such as DDoS, XSS, CSRF, and SQL injections. The framework offers a scalable, modular solution to enhance cyber resilience in transportation infrastructure.