rapid7 / metasploitable3

Metasploitable3 is a VM that is built from the ground up with a large amount of security vulnerabilities.
Other
4.69k stars 1.14k forks source link

Linux Box does not have Sinatra Server Running on Port 8181 #484

Open usmcfiredog opened 3 years ago

usmcfiredog commented 3 years ago

Issue Description

Please check the General Issues section in the wiki before you submit the issue. If you didn't find your issue mentioned, please give a thorough description of the issue you're seeing. Also, please be sure to include any troubleshooting steps that you've already attempted.

Host System

When I build the Linux machine either with the script or build it manually I notice that port 8181 is not open when I run netstat on it. There are no errors when building the box. This also has to do with the Readme.app that is supposed to be running.

deargle commented 3 years ago

I'm looking at this. The recipe for sinatra includes a binary file that seems to be associated with specific builds. Either the binary in the "aws" folder or the "virtualbox" folder is used.

https://github.com/rapid7/metasploitable3/blob/b0eaed0ae89c2c2b3b464e19f1a2927988596518/chef/cookbooks/metasploitable/recipes/sinatra.rb#L32-L35

https://github.com/rapid7/metasploitable3/tree/master/chef/cookbooks/metasploitable/files/sinatra

service start sinatra echoes "starting sinatra" and then runs that binary.

https://github.com/rapid7/metasploitable3/blob/b0eaed0ae89c2c2b3b464e19f1a2927988596518/chef/cookbooks/metasploitable/files/sinatra/sinatra.conf#L6-L9

But same for me on libvirt, nothing happens when I run that binary. Nor on virtualbox.

deargle commented 3 years ago

@wchen-r7 any insight?

deargle commented 3 years ago

Those two loaders hash to the same value

dave@kali:~/metasploitable3/chef/cookbooks/metasploitable/files/sinatra$ sha256sum aws/loader virtualbox/loader 
be502e97ad7b4538060c558d66d53789ee552d71174a7d6bbecac004ab1b001e  aws/loader
be502e97ad7b4538060c558d66d53789ee552d71174a7d6bbecac004ab1b001e  virtualbox/loader
deargle commented 3 years ago

Here's the original commit, with the raw ruby server code

https://github.com/rapid7/metasploitable3/commit/1b2191100550c8859da7e1bd2ba38a0997506c1c#diff-b1000863cb56df3d5823441f89b2bd30