TorBrowser su Debian 10

TorBrowser su Debian 10TorBrowser su Debian 10

Tor (acronimo di The Onion Router) è un sistema di comunicazione anonima per Internet basato sulla seconda generazione del protocollo di rete di onion routing. Tramite l’utilizzo di Tor è molto più difficile tracciare l’attività Internet dell’utente; difatti l’uso di Tor è finalizzato a proteggere la privacy degli utenti, la loro libertà e la possibilità di condurre delle comunicazioni confidenziali senza che vengano monitorate.  Per installare TorBrowser su Debian 10 Buster:

Aggiungere i repository backport:

# printf "deb http://deb.debian.org/debian buster-backports main contrib" > /etc/apt/sources.list.d/buster-backports.list
# apt update

Installazione:

# apt -t buster-backports install torbrowser-launcher tor tor-geoipdb torsocks

Workaround errore black screen all’avvio:

# nano /etc/apparmor.d/local/torbrowser.Browser.firefox

ed aggiungere:

owner /{dev,run}/shm/org.mozilla.*.* rw,
# reboot

poi lanciare tor:

$ torbrowser-launcher

TorBrowser su Debian 10

enjoy 😉

 

Nvidia Optimus con Bumblebee su Debian 10

Nvidia Optimus con Bumblebee su Debian 10Nvidia Optimus con Bumblebee su Debian 10

Tanti laptop hanno la doppia scheda video Intel e Nvidia, e quindi si può installare Bumblebee che supporta i laptop con tecnologia NVIDIA Optimus Praticamente si fa il rendering con Nvidia che sarà visalizzata con la scheda Intel.

Per identificare le schede:

$ su -
# apt install inxi
# inxi -G

output:

Graphics:
Device-1: Intel 4th Gen Core Processor Integrated Graphics driver: i915
v: kernel
Device-2: NVIDIA GM107M [GeForce GTX 860M] driver: N/A
Display: server: X.Org 1.20.4 driver: modesetting unloaded: fbdev,vesa
resolution: 1920x1080~60Hz
OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 18.3.6

Installazione:

# dpkg --add-architecture i386
# apt-get update
# apt-get install bumblebee-nvidia primus primus-libs:i386 libgl1-nvidia-glx:i386 mesa-utils libgl1-nvidia-glx

aggiungere il proprio nome utente al gruppo bumbeblee:

$ sudo adduser $USER bumblebee
$ sudo reboot

per testare scheda intel:

$ glxgears -info

per testare scheda nvidia:

$ optirun glxgears -info

Nvidia Optimus con Bumblebee su Debian 10

enjoy 😉

 

Script Bash per aggiornamento ip dinamico FreePBX Asterisk

Script Bash per aggiornamento ip dinamico FreePBX Asterisk

Script per aggiornamento ip dinamico FreePBX Asterisk

Dopo l’ultima guida su come Configurare un trunk Asterisk su linea Vodafone, il mio centralino personale funziona benissimo (quasi). Naturalmente c’è sempre qualcosa da sistemare qua e là, e la prima cosa è quella dell’ip statico. Nel mio caso, avendo un ip dinamico, nel momento in cui cambia l’indirizzo (non spesso), le chiamate in ingresso non vengono inoltrate. Pur avendo un external FQDN con dyndns, ed aggiungendolo in FreePBX, purtroppo NON funziona. Quindi la soluzione è riscrivere nella tabella mysql il nuovo ip in maniera automatica. A questo proposito ho rispolverato uno script bash, che può essere modificato in base alle proprie esigenze:

#!/bin/bash
# This program gets the current IP address (as assigned by the ISP) from
# THIS SCRIPT IS STILL CONSIDERED EXPERIMENTAL - USE AT YOUR OWN RISK!!!
user="user"
pass="pw"
check=$(dig +short myip.opendns.com @resolver1.opendns.com) || { echo "Problem getting current IP address"; exit 1; }
if [[ ! $check =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid IP address"; exit 1;
fi
readip=$(mysql asterisk -u $user -p$pass -se 'SELECT val FROM kvstore_Sipsettings where `key` = "externip"') || { echo "Can't read externip from MySQL asterisk database"; exit 1; }
if [ "$check" != "$readip" ]; then
# IP address has changed
# Send email
echo "This is an automated message - please do not reply. It appears that our external IP address has been changed to $check" | mail -s "External IP address may have been changed" you@someaddress.com
# Save new IP address to Asterisk SIP settings
mysql_response=$(mysql asterisk -u $user -p$pass -se 'update kvstore_Sipsettings set val='\"$check\"' where `key`="externip" ')
# Reload Asterisk
/var/lib/asterisk/bin/module_admin reload
fi

se ci sono problemi di formattazione, si può scaricare con:

$ wget https://www.dropbox.com/s/lrvyd83ezu62fb7/checkip.sh?dl=0 -O checkip.sh

le voci importanti da modificare sono: user, pw, ed aggiungere la propria mail eventualmente, per essere avvisati al cambiamento ip. Quindi:

# chmod u+rx checkip.sh
# mv checkip.sh /var/lib/asterisk/agi-bin/

se non presente dig, scaricarlo:

# apt install dnsutils

per testarlo subito eseguire:

# /var/lib/asterisk/agi-bin/./checkip.sh

Adesso è utile programmare un cron job che controlli l’indirizzo ip ad intervalli regolari. Io ho optato per un check ogni ora, anche se il mio ip non cambia così spesso:

# crontab -e

ed incollare qualcosa del genere:

*/60 * * * * /var/lib/asterisk/agi-bin/checkip.sh

adesso il nostro centralino asterisk non avrà più problemi a causa dell’ip dinamico. Testato e funzionante con Asterisk 14 FreePBX 14

Script Bash per aggiornamento ip dinamico FreePBX Asterisk

enjoy 😉

 

Trovare informazioni sensibili su Facebook con FBI

Trovare informazioni sensibili su Facebook con FBI

Trovare informazioni sensibili su Facebook con FBI

Questa guida, testata su Debian 10, fa vedere come dopo avere installato un interessante tool di Information gathering, FBI (Facebook Information)) si possono ottenere velocemente dati sensibili sui propri amici di Facebook.

$ sudo apt update; apt upgrade -y
$ sudo apt install git python2
$ git clone https://github.com/xHak9x/fbi.git
$ cd fbi/
$ sudo pip2 install -r requirements.txt

Avviare con:

$ python2 fbi.py

loggarsi con il proprio id facebook e dare il comando:

token

scaricare le info di tutti gli amici:

get_data
get_info

ottenere i numeri di telefono:

dump_phone

Trovare informazioni sensibili su Facebook con FBI

scoprire tutte le mail:

dump_mail

Trovare informazioni sensibili su Facebook con FBI

Trovare informazioni sensibili su Facebook con FBI

ecc. ecc. ecc.

enjoy 😉

Muovere files diversi simultaneamente da terminale

Muovere files diversi simultaneamente da terminale

Guida su come muovere files con estensione diversa da una directory ad un’altra. Può capitare di avere all’interno di una directory centinaia di files, ma se si necessita di muoverne solo alcuni. Il comando mv sotto può venerci incontro:

$ mv dir1/*.{doc,pdf,jpg} dir2/

enjoy 😉

Trovare profili Social col riconoscimento immagine

trovare profili Social col riconoscimento immagine

Come trovare profili Social col riconoscimento immagine, utilizzando Eagle Eye su Debian 1o. L’obiettivo sarà quello di partire da una immagine, e tramite una scansione della rete trovare i profili social, come Facebook, Instagram, Pinterest e Twitter.

$ sudo apt update; sudo apt upgrade -y
$ sudo apt install build-essential devscripts cmake python3-pip git python3 python3-dev libffi-dev libgtk-3-dev libboost-all-dev
$ git clone https://github.com/ThoughtfulDev/EagleEye
$ cd EagleEye
$ sudo pip3 install -r requirements.txt
$ sudo pip3 install --upgrade beautifulsoup4 html5lib spry

Scaricare geckodriver

$ wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
$ tar xvf geckodriver-v0.23.0-linux64.tar.gz
$ chmod +x geckodriver
$ sudo mv geckodriver /usr/bin/

per avviare Eagle Eye

$ cd EagleEye
$ python3 eagle-eye.py

di seguito un video screen fatto da me che ne mostra il funzionamento:

enjoy 😉

 

Anonsurf su Debian 10

Anonsurf su Debian 10

Anonsurf su Debian 10

Anonsurf è la modalità anonima di ParrotOS per forzare le connessioni attraverso Tor e/o la rete i2p.  Tor è un protocollo di crittografia SOCKS4 e SOCKS5. Tor esegue il tunnelling di tutto il traffico che circola nella rete dell’utente in modo anonimo. Tor nasconde la posizione di un utente e i dati di rete da chiunque monitora l’utente localmente e in remoto. L’utilizzo di Anonsurf si può avviare anche da terminale, ed oltre ad essere integrato in ParrotOS ed in Kali Linux, si può installare in Debian 9 Stretch o Debian 10 Buster.

$ sudo apt install git
$ git clone https://github.com/ParrotSec/anonsurf
$ cd anonsurf/
$ chmod a+x ./anonsurf.sh
$ sudo ./anonsurf.sh start

Anonsurf su Debian 10i comandi sono i seguenti:

anonsur start - Start system-wide TOR tunnel
anonsurf stop - Stop anonsurf and return to clearnet
anonsurf restart - Combines "stop" and "start" options
anonsurf changeid - Restart TOR to change identity
anonsurf status - Check if AnonSurf is working properly
anonsurf myip - Check your ip and verify your tor connection
anonsurf mymac - Check your mac and verify your change mac address

enjoy 😉

Video utilizzo Systemback-1.9.3

 

Video utilizzo Systemback-1.9.3

Questo video mostra come installare una copia del proprio OS, utilizzando Systemback-1.9.3. Nell’esempio sopra, utilizzo Ubuntu 18-04, installato in EFI mode. Nel caso si trattasse di una installazione in legacy mode, assicurarsi che il pacchetto grub-pc-bin sia installato correttamente, sopratutto se si parte da chiavetta usb live.

enjoy 😉

Server DHCP su Debian 10 Buster

Server DHCP su Debian 10 Buster

Server DHCP su Debian 10 Buster. Installazione e configurazione di un server dhcp su Debian Buster:

# apt install isc-dhcp-server

settare la scheda di rete da utilzzare, nel mio caso eth0:

# nano /etc/default/isc-dhcp-server
# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPD_CONF=/etc/dhcp/dhcpd.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPD_PID=/var/run/dhcpd.pid

# Additional options to start dhcpd with.
#       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0"

poi modificare il file dhcpd.conf inserendo i parametri della nostra rete, nel mio caso 192.168.100.0/24:

# nano /etc/dhcp/dhcpd.conf
# Sample configuration file for ISC dhcpd for Debian
#
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.150 192.168.100.160;
option routers 192.168.100.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.100.254;
option domain-name-servers 192.168.100.1, 192.168.100.2;
option ntp-servers 192.168.100.1;
option netbios-name-servers 192.168.100.1;
option netbios-node-type 8;
}
#subnet 10.254.239.0 netmask 255.255.255.224 {
#  range 10.254.239.10 10.254.239.20;
#  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {
#  range dynamic-bootp 10.254.239.40 10.254.239.60;
#  option broadcast-address 10.254.239.31;
#  option routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
#  range 10.5.5.26 10.5.5.30;
#  option domain-name-servers ns1.internal.example.org;
#  option domain-name "internal.example.org";
#  option routers 10.5.5.1;
#  option broadcast-address 10.5.5.31;
#  default-lease-time 600;
#  max-lease-time 7200;
#}

# Hosts which require special configuration options can be listed in
# host statements.   If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.

#host passacaglia {
#  hardware ethernet 0:0:c0:5d:bd:95;
#  filename "vmunix.passacaglia";
#  server-name "toccata.fugue.com";
#}

# Fixed IP addresses can also be specified for hosts.   These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
#  hardware ethernet 08:00:07:26:c0:a5;
#  fixed-address fantasia.fugue.com;
#}

# You can declare a class of clients and then do address allocation
# based on that.   The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

#class "foo" {
#  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}

#shared-network 224-29 {
#  subnet 10.17.224.0 netmask 255.255.255.0 {
#    option routers rtr-224.example.org;
#  }
#  subnet 10.0.29.0 netmask 255.255.255.0 {
#    option routers rtr-29.example.org;
#  }
#  pool {
#    allow members of "foo";
#    range 10.17.224.10 10.17.224.250;
#  }
#  pool {
#    deny members of "foo";
#    range 10.0.29.10 10.0.29.230;
#  }
#}

dopo le modifiche riavviare il servizio:

# systemctl restart isc-dhcp-server.service
Server DHCP su Debian Buster

enjoy ?

Asterisk 16 Freepbx 15 su Raspbian-Debian Stretch

Asterisk 16 Freepbx 15 e Raspbian-Debian Stretch

 

Installazione su Raspberri py 3 con OS Raspbian Stretch Lite, di Asterisk 16 e Freepbx 15. Guida testata e funzionante, sia su Raspberry che su Pc con os Debian Stretch. La novità rispetto al passato è che freepbx 15 supporta php 7. I miei test li ho fatti senza hardware pstn. I passaggi successivi saranno eseguiti come utente root e su una nuova installazione di Raspbian Stretch, su Raspberry py 3.

Aggiornare il sistema
# apt update; apt upgrade

se viene installato un nuovo kernel riavviare.

Scaricare le dipendenze ed i servizi necessari
$ sudo su
# apt install -y wget mysql-server mysql-client bison flex php php-pear php-cgi php-common php-curl php-mbstring php-gd php-mysql php-gettext php-bcmath php-zip php-xml php-imap php-json php-snmp php-fpm libapache2-mod-php git curl libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libjansson-dev libxml2-dev uuid-dev dh-make libssl-dev sox
Installare nodejs
# curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
# apt install -y nodejs
Reboot server
# reboot
Scaricare Asterisk 16 e FreePBX 15
# cd /usr/src
# wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
# wget https://mirror.freepbx.org/modules/packages/freepbx/freepbx-15.0-latest.tgz
Installare Asterisk 16
# cd /usr/src
# tar xvfz asterisk-16-current.tar.gz
# cd asterisk-16.*
# contrib/scripts/get_mp3_source.sh
# ./contrib/scripts/install_prereq install
# ./configure --with-jansson-bundled
# make menuselect

inserire il prefisso internazionale, nel nostro caso 39:

Asterisk 14 Freepbx 14 su Debian Stretch 9.1e poi abilitare  format_mp3:

Installare Asterisk 13 con Freepbx 12 su Raspberry pi 2 e Debian Jessie

# make -j4
# make install
# make samples
# make config
# ldconfig
Creazione utente Asterisk e permessi
# groupadd asterisk
# useradd -r -d /var/lib/asterisk -g asterisk asterisk
# usermod -aG audio,dialout asterisk
# chown -R asterisk.asterisk /etc/asterisk
# chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk
# chown -R asterisk.asterisk /usr/lib/asterisk
# sed -i 's/#AST_USER="asterisk"/AST_USER="asterisk"/g' /etc/default/asterisk
# sed -i 's/#AST_GROUP="asterisk"/AST_GROUP="asterisk"/g' /etc/default/asterisk
# systemctl restart asterisk
# systemctl enable asterisk

verificare che asterisk funzioni correttamente:

# asterisk -rvvv

output:

root@raspytest:/home/pi# asterisk -rvv
Asterisk 16.1.1, Copyright (C) 1999 - 2018, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 16.1.1 currently running on raspytest (pid = 660)
raspytest*CLI>
Configurazione Apache2
# cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
# sed  -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
# sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
# mv /var/www/html /var/www/html.bak
# a2enmod rewrite
# systemctl restart apache2
Installare FreePBX 15
# cd /usr/src/
# tar xvfz freepbx-15.0-latest.tgz
# cd freepbx
# ./start_asterisk start
# ./install -n
# fwconsole chown
# fwconsole reload
# fwconsole restart

se tutto è andato bene il server Asterisk è raggiungibile all’indirizzo http://ip_raspberry. La prima cosa da fare è quella di scegliere nome utente, password e mail, per accedere al pannello di amministrazione. Andare poi nel menu Admin-Module Admin e scaricare ed aggiornare tutti i moduli.

enjoy 😉