How to learn Shell Scripting by installing Tor Browser

La seventh (7th) class of the practical theoretical course of "Learn Shell Scripting" we will study how through a Script we can achieve an easy installation and configuration programmed of the famous and useful Internet browser Tor Browser, while, as always, we invest valuable time understanding how each line, each command, each variable works, to understand and learn Shell Scripting.

Shell scripting

But for those few who understand, we will clarify that it is TorBrowser. It is a multiplatform application (Windows / Linux) that allows us to hide or mask our identity on the network. It provides an anonymous route through proxy servers for our internet communications and efficiently prevents external traffic analysis. So using Tor it is possible make a connection to a host, almost imperceptibly, that is, without it or any other having the possibility of knowing our IP.

To execute Tor Browser in a GNU / Linux Operating System, normally works separately with a graphical manager called Vidalia and on an Internet browser compatible with Torbutton, a plugin for Mozilla Firefox that allows us to activate it from the browser itself. However, in Tor Browser, its creators have managed to simplify everything, designing a solid and robust application (package) in an integral way, that is, with everything necessary to work immediately in any distribution.

Tor Browser It is very easy to use, once installed and running there is little or nothing to configure, unless you are a very advanced user or paranoid about security and privacy.

Here is the Bash Shell Script:

================================================== ====================
#!/bin/bash
#####################################################################
# EN ESTA SECCIÓN INCLUYA LOS DATOS DEL CREADOR Y EL PROGRAMA
#
#####################################################################


#####################################################################
# EN ESTA SECCIÓN INCLUYA LOS DERECHOS DE AUTOR Y LICENCIAMIENTO 
# DEL SOFTWARE
# 
#####################################################################

#####################################################################
# INICIO DEL MODULO DE TOR BROWSER                                     
#####################################################################

USER_NAME=`cat /etc/passwd | grep 1000 | cut -d: -f1`

HOME_USER_NAME=/home/$USER_NAME

cd $HOME_USER_NAME

rm -rf /opt/tor-browser*

rm -f /usr/bin/tor-browser*

rm -rf /usr/bin/tor-browser*

rm -f $HOME_USER_NAME/Escritorio/tor-browser.desktop

rm -f $HOME_USER_NAME/Desktop/tor-browser.desktop

rm -f $HOME_USER_NAME/.local/share/applications/tor-browser.desktop

rm -f /usr/share/applications/tor-browser.desktop

update-menus

#####################################################################

# wget -c https://dist.torproject.org/torbrowser/5.0.7/tor-browser-linux32-5.0.7_es-ES.tar.xz

# wget -c https://dist.torproject.org/torbrowser/5.0.7/tor-browser-linux64-5.0.7_es-ES.tar.xz

# Nota: Puede descargarlos manualmente desde esta URL: https://dist.torproject.org/torbrowser/

#####################################################################

unxz *tor-browser*.tar.xz

tar xvf *tor-browser*.tar

mv -f tor-browser_es-ES /opt/tor-browser

ln -f -s /opt/tor-browser/Browser/start-tor-browser /usr/bin/tor-browser

#####################################################################

chown $USER_NAME:$USER_NAME -R /opt/tor-browser/


echo '
[Desktop Entry]
Name=TOR Browser
GenericName=TOR Browser
GenericName[es]=Navegador web TOR
Comment=Navegador de Internet seguro
Exec=/usr/bin/tor-browser
Icon=/opt/tor-browser/Browser/browser/icons/mozicon128.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Network;Application;
MimeType=x-scheme-handler/mozilla;
X-KDE-Protocols=mozilla
' > /opt/tor-browser/tor-browser.desktop


ln -s /opt/tor-browser/tor-browser.desktop $HOME_USER_NAME/Escritorio/tor-browser.desktop

chown $USER_NAME:$USER_NAME $HOME_USER_NAME/Escritorio/tor-browser.desktop

chmod 755 $HOME_USER_NAME/Escritorio/tor-browser.desktop

chmod +x $HOME_USER_NAME/Escritorio/tor-browser.desktop


ln -s /opt/tor-browser/tor-browser.desktop $HOME_USER_NAME/Desktop/tor-browser.desktop

chown $USER_NAME:$USER_NAME $HOME_USER_NAME/Desktop/tor-browser.desktop

chmod 755 $HOME_USER_NAME/Desktop/tor-browser.desktop

chmod +x $HOME_USER_NAME/Desktop/tor-browser.desktop


ln -s /opt/tor-browser/tor-browser.desktop $HOME_USER_NAME/.local/share/applications/tor-browser.desktop

chown $USER_NAME:$USER_NAME $HOME_USER_NAME/.local/share/applications/tor-browser.desktop

chmod 755 $HOME_USER_NAME/.local/share/applications/tor-browser.desktop

chmod +x $HOME_USER_NAME/.local/share/applications/tor-browser.desktop


ln -s /opt/tor-browser/tor-browser.desktop /usr/share/applications/tor-browser.desktop

chown $USER_NAME:$USER_NAME /usr/share/applications/tor-browser.desktop

chmod 755 /usr/share/applications/tor-browser.desktop

chmod +x /usr/share/applications/tor-browser.desktop


su - $USER_NAME -c "tor-browser https://addons.mozilla.org/firefox/downloads/latest/11356/addon-11356-latest.xpi?src=dp-btn-primary" &

#####################################################################

rm -f $HOME_USER_NAME/tor-browser*.*

rm -f $HOME_USER_NAME/*.xpi

clear

su - $USER_NAME -c "xdg-open 'https://dist.torproject.org/torbrowser/'" &

clear

echo ''
echo ''
echo '#--------------------------------------------------------------#'
echo '#  GRACIAS POR USAR ESTE SCRIPT DE INSTALACIÓN DE TOR BROWSER  #'
echo '#--------------------------------------------------------------#'
echo ''
echo ''

sleep 3

#####################################################################
# FINAL DEL MODULO DE TOR BROWSER                                      
#####################################################################
================================================== ====================

Note: I personally DO NOT USE Tor Browser because I do not navigate the Deep Web or do I fear a robo o hack of my information or violation of my privacy, but I know that many do and for them this installation script, which will make their lives easier.

The advantage of these scripts is that they allow both the Mozilla Firefox such as Tor Browser are configured in such a way that allow updating of the same, as it is done in windows. That is, Opening the Menu Button of the Charms Bar, Opening the Help Menu (Question Icon) and in the pop-up window that comes out (About ...) He scans for pending updates and the update is performed transparently as in Windows.

Remember that in case of creating a Script (Example: mid-script-tor-browser.sh) with this code, I recommend manually downloading the file from Tor Browser updated manually, so you should keep commented wget download lines, and place it in the path / home / my_user together with the file tar.gz de Tor Browser downloaded and run it with the command command $ bash mid-script-tor-browser.sh . And in less than 30 seconds you will have everything functional. After this you can navigate any Website with the version of your browser chosen by you Tor Browser.

Until the next post, which will be about LibreOffice. As I leave you with this new publication and exciting task of analysis and research.

GRAPHIC TUTORIAL OF THE PROCEDURE

Personal folder_001

Personal folder_002

root @ hostmovil-sysadmin: -home-sysadmin_003

Work area 1_004

Network Configuration Tor_005

Tor_006 Status

Tor_007 browser

Index of -torbrowser - Tor_008 Browser

About Tor_009 Browser

About Tor - Tor_010 Browser


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   dayane qua said

    Although the Firefox browser adapted by the TOR Project to run sites with .onion, is also used to navigate normal sites, not everything is the "deep web", which are simply non-idexed and hidden pages To take advantage of TOR and the At the same time, do not provide compromising information, there are recommendations:
    1. Never visit the same sites on the same computer at the same time, alternating the normal network and the onion network.
    2. Never log into TOR, eg Facebook, TORbook or any email.
    3. Use a secure search engine that does not track you, eg DuckDuckGo link: https://duckduckgo.com
    as well as its mirror in .onion
    4. Disable JavaScript, as it can run parts of proprietary code and damage your privacy and integrity of your computer.
    5. Use TAILS or another privacy-oriented distro, your applications and connections are forced to be encrypted through the TOR network.
    6. Install HTTPS Everywhere and encrypt your traffic.

    There may be more recommendations from other users, I invite you to share experiences and suggestions for this project. Donate, develop, use, contribute!
    Regards!

  2.   Jose Albert said

    Very good your comment and contributions!

    I congratulate you on your aptitude.

  3.   Raul P. said

    Greetings engineer, I love your tutorials.

    A gazapo: «that allows us to hide»

  4.   Jose Albert said

    Yes, something always goes, everything is perfectly imperfect!

  5.   Jose Linares placeholder image said

    The method you use to obtain the current user is wrong, it returns the user with UID 1000. Ok, if there is only one user, it is usually that, but this does not have to be the case. Wouldn't it be better to use user = $ (whoami)?
    Nor does the home have to be called the same as the user. Luckily, the variable ~ always contains the home path.

  6.   Jose Albert said

    Remember that with Shell Scripting you can do many complex things that are cross-platform (Different Distros) using very small files. I will leave you this small screencast of something that I will soon teach, to those who continue watching the course, and that with only 50Kb promises a lot! And it is only half of what can be done with Shell Scripting.

    LPI-SB8 Test ScreenCast (LINUX POST INSTALL - SCRIPT BICENTENARIO 8.0.0)
    (lpi_sb8_adaptation-audiovisual_2016.sh / 43Kb)

    See Screencast: https://www.youtube.com/watch?v=cWpVQcbgCyY

  7.   Jose Albert said

    Greetings to all those who are following the Online Course of "Learn Shell Scripting" soon we will continue with other basic scripts to continue appropriating the knowledge and continue socializing it to all.

    I hope you stay tuned because soon I will start with more advanced codes but exposed in a way that is visually understandable despite its complexity.

    LPI-SB8 Test ScreenCast (LINUX POST INSTALL - SCRIPT BICENTENARIO 8.0.0)
    (lpi_sb8_adaptation-audiovisual_2016.sh / 43Kb)

    See Screencast: https://www.youtube.com/watch?v=cWpVQcbgCyY