Added old posts

Signed-off-by: Ettore <noettore@gmail.com>
This commit is contained in:
2019-05-25 16:52:14 +02:00
parent 845eec3def
commit dd3c6392c5
3 changed files with 144 additions and 0 deletions

19
content/blog/backuppc.md Normal file
View File

@@ -0,0 +1,19 @@
+++
date = "2016-02-14T23:35:41+01:00"
draft = false
title = "BackupPc"
+++
[BackupPC](http://backuppc.sourceforge.net/) is the coolest and best featured open source cross-platform project for disk-to-disk backup. However almost nobody talks about it and therefore many folks unfortunately never heard of it.
It's designed for enterprise environment and will run on any \*nix based server. Moreover it's able to backup UNIX-like and Microsoft Windows systems due to the fact that **no client is necessary**.
Yeah, I know, it could resemble a bit outdated, not keeping up with flashy graphics fashion, but it just works, and it works well, without constant need of maintenance and upgrades.
It supports NFS, SSH, SMB and rsync protocols and **hard linking, data deduplication, pooling and compression**.
It's included in major distribution repositories and with [cygwin](https://cygwin.com/) you're able to use tar, rsync and ssh on windows systems. Why not to use SMB you might ask: ARE YOU FUCKING KIDDING ME?
It's well documented and online you could find plenty of articles on how to set it up on homogeneous and mixed environment.
So go on and spread the word, BackupPC is the answer!

View File

@@ -0,0 +1,44 @@
+++
date = "2017-06-12T11:44:46+02:00"
title = "How to: backup google authenticator app two-factor secrets"
+++
Quick and dirty:
- Connect your device to the PC via USB
- Enable debugging mode
- From the terminal:
```bash
adb root
adb pull /data/data/com.google.android.apps.authenticator2/databases/databases
sqlite3 ./databases "select * from accounts" > ./gauth_backup.txt
```
If you want to generate an auth code from a TOTP secret you can use `oathtool`:
```bash
oathtool --base32 --totp "<secret>"
```
Enjoy!
---
Pro tip: to generate all the QR codes from the `sqlite` database you could use this python script (which requires the `qrcode` module):
```py
import qrcode
import sqlite3
conn = sqlite3.connect('databases')
c = conn.cursor()
for idx, (email, secret, issuer) in enumerate(c.execute("SELECT email,secret,issuer FROM accounts").fetchall()):
url = 'otpauth://totp/{}?secret={}&issuer={}'.format(email, secret, issuer)
print url
im = qrcode.make(url)
im.save('{}.png'.format(idx))
```
(source: [thouis](https://github.com/thouis))

View File

@@ -0,0 +1,81 @@
+++
date = "2016-03-13T01:18:27+01:00"
draft = false
title = "Wireless Monitor Mode and Network-Manager"
+++
Sometimes it could be usefull to capture Wireless Lan packets: it could be done in various ways, with iwconfig, Kismet, Wireshark, nprobe and many others, all of them involving putting the wireless card into "monitor mode" (or promiscous), letting you view and record all packets sent on a defined channel by others WiFi devices nearby.
One of the tools almost every linux distro provides you is [`iw`](https://wireless.wiki.kernel.org/en/users/documentation/iw), meant to replace `iwconfig` being more powerful for configuring wireless devices.
#### Getting Started
The working paradigm of `iw` is based on the identification of hardware lan devices (often referred as the "physical layer") and the network interface using that hardware (such as wlan0, eth0, ...).
First you have to print a list of all devices and relative interfaces:
````
$ sudo iw dev
phy#0
Interface wlan0
ifindex 3
type managed
````
Next you have to check if your wireless card supports "monitor mode":
````
$ sudo iw phy phy0 info
Wiphy phy0
Band 1:
Capabilities: 0x172
HT20/HT40
...
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point
software interface modes (can always be added):
* AP/VLAN
* monitor
...
````
It's important that both supported and software modes include entry for "monitor".
#### Enabling monitor mode
If the wireless card supports monitor mode you have to add a monitor interface:
````
$ sudo iw phy phy0 interface add mon0 type monitor
````
Where `phy0` is the physical layer of the WiFi card and `mon0` is the name of the newly added network interface.
You can check for it being added with:
````
$ sudo iw dev
````
It's now essential to remove the old network interface associated with `phy0`:
````
$ sudo iw dev wlan0 del
````
where `wlan0` is the name of the old network interface. Don't worry, we'll add again it later.
Now enable the new monitor interface using 'ifconfig':
````
$ sudo ifconfig mon0 up
````
#### Reverting
If you have finished capturing packets and you want to revert to the "standard" configuration it's simpler than the going:
````
$ sudo iw dev mon0 del
$ sudo iw phy phy0 interface add wlan0 type managed
$ sudo ifconfig wlan0 up
````
#### The Network-Manager bug
If you're using a gnome distro or any other linux flavours with Network-Manager as your current connections handler there is a known conflict between NM and the manual configuration of interfaces so you'll have to disable it:
````
$ sudo service network-manager stop
$ sudo ifconfig mon0 down
$ sudo iwconfig mon0 mode monitor
$ sudo ifconfig mon0 up
````
Enjoy!