http-ui only binds to localhost (127.0.0.1) - bettercap

Im having an issue where when I try to start the ui, it will only bind to localhost. If i run http.server start it binds to my address 192.168.1.x, which I can then browse however it is not the UI just the root directory, if I run http-ui it then starts but only binds to 127.0.0.1:80 and also the api.rest also only binds to 127.0.0.1, so I cannot access it from another machine.

Running the armhf release on raspberrypi launching with sudo ./bettercap

Is there a way around this?

Thanks

Asked Sep 28 '21 01:09
avatar deanfourie1
deanfourie1

6 Answer:

Ok I set http.proxy.address to 192,168.1.x, then started the ui and started the proxy. It enabled forwarding with port 8080 however im getting multiple errors

2021/09/22 13:01:03 http: Accept error: accept tcp 192.168.99.47:8080: accept4: too many open files; ring in 640ms

These just repeat and web browser spits out

dial tcp 192.168.99.47:8080: socket: too many open files

pi@raspberrypi:~ $ cat /proc/sys/fs/file-max 2147483647

1
Answered Sep 22 '21 at 12:03
avatar  of deanfourie1
deanfourie1

Believe if you set *server.address and/or api.rest.address to 0.0.0.0 it should be reachable on all interfaces.

1
Answered Sep 22 '21 at 12:33
avatar  of geekskunk
geekskunk

Thanks for the reply, Still when running the http-ui, it reverts back to 127.0.0.1:80 however the http server does run now binding to 0.0.0.0, but still no GUI.

If I understand this correctly, the http.server is just for browsing the directories and should not be pointing to the www root? When launching the http-ui this is when the UI starts and points to the www root directory?

Thanks for the help

1
Answered Sep 22 '21 at 12:46
avatar  of deanfourie1
deanfourie1

just a thought, is it possible that external connections are not possible without the use of HTTPS?

1
Answered Sep 22 '21 at 12:47
avatar  of deanfourie1
deanfourie1

Ok ive browsed to

http://192.168.99.47/usr/local/share/bettercap/ui/

Thats progress, however I seem to just be getting a blank page now. I just seem to be running into problem after problem here :(

1
Answered Sep 22 '21 at 12:53
avatar  of deanfourie1
deanfourie1

You likely should be hitting (in your case) http://192.168.99.47:port (don't add all the/usr/local/ect path. No path at all.)

Port as defined by http.server.port (believe 80 may be the default so http://192.168.99.47:80 if http)

Also, rule out the basics on the above. Make sure your browser isn't redirecting to https when you intend http. Click Advanced Settings/developer tools. Load page, see if content is loading.

On your box itself, also make sure nothing else also using the same port defined in http.server.port

1
Answered Sep 22 '21 at 15:44
avatar  of geekskunk
geekskunk