HeadlinesBriefing favicon HeadlinesBriefing.com

Fixing Metasploit Build Error on Termux

DEV Community •
×

Installing Metasploit on Termux currently fails due to a Ruby 3.4.0 compatibility issue. The build process for the nokogiri gem crashes because it cannot locate the `nokogiri_gumbo.h` header file. This error stems from Termux's environment not correctly passing temporary compilation paths to the compiler during a standard `bundle install`.

Developer Raj Aryan offers a solution with Metasploit-Termux v2.5.0. His script automates a manual 'Header Injection' technique. It unpacks the problematic gem, injects the missing C-headers into the `$PREFIX/include` path, and forces a compilation before Bundler starts. This bypasses the environment path issue entirely.

The fix is delivered via a simple shell script that clones and executes the project. For those needing a deeper architectural understanding, Aryan has published a full tutorial on his website. This workaround is crucial for security professionals and hobbyists who rely on Termux for mobile penetration testing workflows.

Key entities mentioned include Metasploit, Termux, Ruby 3.4.0, nokogiri, and developer Raj Aryan (@h4ck3r0). The project is hosted on GitHub.