This blog is NOT OFFICIAL website of Kali Linux. We just share Tutorials to learn Cybersecurity.

Own Private Search Engine in Linux Will Save Our Privacy

Home
Surfing the internet has become a passion for everyone but most of the search engines keep the log of our search behavior and track us. They can share our searching data with the government. Recently Forbes warned us that some company sends our data to China in this article.

They make a huge database using our data and make category of consumers. We have noticed that if we search for “Adidas football” on Google, then after sometime we got Adidas football's ads on the internet. They use our search behavior to show us ads. This might be not against Google's terms and conditions but against our privacy.

create own private search engine

Not only showing ads, they keep an extra eye on us. They always monitor our search results and using them.

Some privacy search engines (such as Duckduckgo, Privado) claim that they did not store any log, but we don’t know what is running on their back end.

It will be better that we create our own search engine and use it. This will be the best option to keep our privacy.

In this detailed tutorial we create our own search engine and surf the internet in a very private way in our Kali Linux or any Debian based Linux distributions like Ubuntu Parrot and other.

To do this we use the Searx tool published on GitHub. This is an python2 based open-source privacy search engine. Open-Source means we can read the codes in it and we know what Searx is doing in the background, it is open for all.

We can host this search engine on our localhost and use it to surf the internet. We need to have Python2 installed in our machine. Python comes pre-installed in Kali Linux.

First we open the terminal window and type the following command and hit enter.

git clone https://github.com/asciimoo/searx
This command will clone the Searx tool in our machine.

clonning searx from github
Now we need to go inside the searx directory by using cd command:

cd searx

Here we need to install dependencies to run searx. To do this we apply following command:

./manage.sh update_packages
Then it will install the dependencies or update them. This may take some time depending on the internet speed and machine configuration. The screenshot is following:

installing the dependencies

Here we need to change our secret key inside /searx/settings.yml. To do this we use following command:
nano searx/settings.yml
The screenshot is following.
changing ultrasecret_key of searx

Here we need to change this key to whatever we want(any thing like 2gvjyGDH68gtplaHuvrty45), inside the quotation mark. What we did shown in the following screenshot:

changedsecrect_key in searx search engine
We should not publish or share it anywhere. After assign the secret_key We just save and close it by pressing CTRL+X and then pressing Y, then ENTER.

Now we are ready to rock. We can run this on our localhost server by applying following command:

python3 searx/webapp.py
The output of the preceding command shows in the following screenshot:

searx running on our localhost

We can see that Searx is running on our localhost. Now we can open this link on our browser and our own private search engine is ready.

own search engine
own private search engine hosted on localhost

Here we search for our website and we got search results as shown in the following screenshot:

search result of own private search engine
Search result of private search engine
The search results are come from various popular search engines like Google, Bing, Duckduckgo, Yahoo and more. But this search engine didn't compromise our privacy.

Some Customization

How it becomes own? It uses Searx branding in search engine homepage. Well it is an open-source search engine that means we can customize it as our own. For an example we change the logo of Searx in the homepage.

From file manager we need to go to this directory /home/kali/searx/searx/static/themes/oscar/img/ , here we got the icons of Searx search engine. The screenshot is following:

searx static images
We need to change the highlighted one
We change the highlighted png image file with our custom png logo file. To do this we need a little image editing knowledge(same size will provide a perfect result). Keep in mind that the name of our custom image file should be the same(logo_searx_a.png).

custom image for this search engine
custom logo for Searx search engine
Then we can see that our logo in the search engine has been changed.

customised private search engine
personalized Private Search Engine

For More Privacy

Searx is hosted on our localhost but it collects search results from the internet (other search engines). When Searx does this other search engines could get our IP address. In simple words the IP address that Searx passes to other search engines is the same as the outgoing IP address of our device.

To prevent this we need to link our searx search engine with a proxy server. Then the requests made to other search engines are made via the proxy server, rather than wherever the Searx instance is running. We also can use Tor or VPN to do the same thing. This is how we can create our own private search engine easily that maintains our privacy.

If you liked our tutorial then share this with privacy concern friends. For more tutorials visit our site regularly and for a quick update follow us on Twitter and Medium.

For any kind of questions or problems feel free to comment down below. We always reply.
author-img
Kali Linux

Comments

4 comments
Post a Comment
  • vishwa photo
    vishwaOctober 18, 2020 at 1:34 AM

    ERROR:searx:server.secret_key is not changed. Please use something else instead of ultrasecretkey
    Please help me

    Delete Comment
    • Kali Linux photo
      Kali LinuxOctober 18, 2020 at 12:02 PM

      Check the updated article. Any problem please contact us. We will reply soon.

      Delete Comment
    • AnonymousOctober 22, 2020 at 12:51 AM

      ./manage.sh: 22: pip: not found

      stuck on this error

      Delete Comment
      • Kali Linux photo
        Kali LinuxOctober 22, 2020 at 8:07 AM

        It looks your machine doesn't have pip installed try one of the following command:
        apt-get install python3-pip
        sudo easy_install pip

        Delete Comment
      google-playkhamsatmostaqltradent