Step 1: Download and Install#
Download the client version suitable for your operating system from the ChatBox official website and install it.
https://chatboxai.app/en
Configure the API interface
In the ChatBox settings, configure the API address to the target machine's address, for example:
Step 2: Query Open Ollama Interfaces via FOFA#
FOFA is a powerful cyberspace search engine that can help us filter publicly exposed services worldwide. For machines that have deployed Ollama, as long as their service configuration is improper (for example, bound to 0.0.0.0 and firewall rules are loose), they may be discovered by FOFA.
Step 3: In the ChatBox settings, configure the API address to the target machine's address#
Remember to save.
Then you can use it happily.
Step 4:#
How to Prevent Your Local Deployment from Being Remotely Exploited by Others#
If you have deployed the Ollama model service locally but do not want others to access it freely (i.e., "being exploited"), you can refer to the following security measures and follow the beginner's steps:
4.1 Limit Listening Address#
Steps (taking Linux as an example):#
-
Find the Configuration File
- Locate the configuration file for the Ollama service (e.g.,
/etc/ollama/config.conf
), and look for a setting likebind_address = 0.0.0.0
.
- Locate the configuration file for the Ollama service (e.g.,
-
Modify the Binding Address
- Change the binding address to
127.0.0.1
, for example:bind_address = 127.0.0.1 port = 11434
- Change the binding address to
-
Save and Restart the Service
- After saving the configuration file, run:
sudo systemctl restart ollama
- This way, the service will only listen on the local machine, and external access will not be possible.
- After saving the configuration file, run:
4.2 Configure Firewall Rules#
Windows Environment:#
- Open "Control Panel" → "System and Security" → "Windows Defender Firewall," and click on "Advanced settings."
- Create a new inbound rule, select "Port," specify TCP and port number 11434.
- Choose "Allow the connection," and in "Remote IP addresses," only add the internal IP range you trust (e.g.,
192.168.1.0/24
). - After saving the rule, access requests from other IPs will be denied.
Linux Environment (taking ufw as an example):#
- Enable ufw:
sudo ufw enable
- Allow access from internal IPs:
sudo ufw allow from 192.168.1.0/24 to any port 11434
- If the default policy is not to deny, you can add a deny rule:
sudo ufw deny 11434
- Check the rules to confirm:
sudo ufw status verbose
4.3 Enable Authentication and Access Control#
If the service must be open to the outside, you can add authentication at the application layer:
Simple Authentication Based on Node.js/Express:#
- Use the
basic-auth
module to add authentication middleware in the code, allowing only users who enter the correct username and password to access the service.
Web Server (Apache/Nginx) Basic Authentication Configuration:#
- Use the
htpasswd
tool to generate a password file, then enable basic authentication in Apache's.htaccess
or Nginx configuration.