Archivio per la Categoria “Sicurezza”

 

 

 

 

Trovandomi ad installare Aircrck-ng, con il classico metodo, ho avuto un sacco di errori:

 

 

edmond@Debianbox:~/aircrack-ng-1.1$ make
make -C src all
make[1]: Entering directory `/home/edmond/aircrack-ng-1.1/src'
make -C osdep
make[2]: Entering directory `/home/edmond/aircrack-ng-1.1/src/osdep'
Building for Linux
make[3]: Entering directory `/home/edmond/aircrack-ng-1.1/src/osdep'
gcc -g -W -Wall -Werror -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -fPIC -I..    -c -o osdep.o osdep.c
gcc -g -W -Wall -Werror -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -fPIC -I..    -c -o network.o network.c
gcc -g -W -Wall -Werror -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -fPIC -I..    -c -o linux.o linux.c
linux.c: In function ‘is_ndiswrapper’:
linux.c:165:17: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
linux.c: In function ‘linux_set_rate’:
linux.c:334:22: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
linux.c: In function ‘linux_set_channel’:
linux.c:807:22: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
linux.c: In function ‘linux_set_freq’:
linux.c:896:22: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
linux.c: In function ‘set_monitor’:
linux.c:1022:22: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
linux.c: In function ‘do_linux_open’:
linux.c:1366:12: error: variable ‘unused_str’ set but not used [-Werror=unused-but-set-variable]
linux.c:1352:15: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
linux.c: In function ‘get_battery_state’:
linux.c:1982:35: error: variable ‘current’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[3]: *** [linux.o] Error 1
make[3]: Leaving directory `/home/edmond/aircrack-ng-1.1/src/osdep'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/edmond/aircrack-ng-1.1/src/osdep'
make[1]: *** [osd] Error 2
make[1]: Leaving directory `/home/edmond/aircrack-ng-1.1/src'
make: *** [all] Error 2

 

il problema è dovuto alla versionde di gcc, che è alla versione 4.6.2 (Debian 4.6.2-3), mentre aircrack-ng deve essere compilato con una versione precedente…io ho usato la 4.4, ma dovrebbe funzionare anche la 4.5.

 

# gcc -v

 

quindi non rimane che cambiare versione del compilatore. Se si usa il comando:

 

# update-alternatives --install /usr/bin/gcc gcc-4.4 /usr/bin/gcc-4.4 20

 

la risposta sarà:

 

root@Debianbox:/home/edmond# update-alternatives –install /usr/bin/gcc gcc-4.4 /usr/bin/gcc-4.4 20
update-alternatives: viene usato /usr/bin/gcc-4.4 per fornire /usr/bin/gcc (gcc-4.4) in modalità automatica.

 

per ritornare alla versione precedente, io ho usato:

 

# rm /usr/bin/gcc

# ln -sf /usr/bin/gcc-4.6 /usr/bin/gcc

 

Comunque il pacchetto deb si trova nel repository.

 

ps:ci sarebbe da mettere anche a posto /etc/alternatives/gcc

 

enjoy ;)

Share on Twitter
Tag:,

Comments 2 Commenti »

 

 

 

 

Volendo provare il file system xfs, e quindi non volendo fare una reinstallazione, ho optato per la clonazione della mia attuale Debian Sid, spostandola in una partizione xfs. Quindi diciamo che questa guida serve al cambio di file system sulla propria distro preferita senza perdere i dati.

 

Requisiti:

una partizione formattata ext4, nell'esempio sarà /dev/sda1

un'altra partizione formattata in xfs, nell'esempio sarà /dev/sda2 dove verra spostata Debian Sid

 

Start:

formattare partizione /dev/sda1 in ext4:

 

# mkfs -t ext4 /dev/sda1

 

formattare partizione /dev/sda2 in xfs:

 

# mkfs.xfs /dev/sda2

 

poi, copiare il nostro sistema sulla partizione ext4

 

# mkdir /mnt/xfs

# mount -t ext4 /dev/sda1 /mnt/xfs

# cd /

# tar lcf - .|(cd /mnt/xfs; tar xpvf - )

# umount /dev/sda1

 

montare la partizione xfs e trasferire il sistema:

 

# mount -t xfs /dev/sda2 /mnt/xfs

# cd /

# tar lcf - .|(cd /mnt/xfs; tar xpvf -)

 

adesso inserire in /etc/fstab la nuova Debian Sid con xfs:

 

# echo '/dev/sda2 / xfs defaults 1 1' >> /etc/fstab

 

aggiornare grub:

 

# update-grub

 

e con il comando:

 

# grub-mkconfig

 

si può già vedere il cambio del file system:

 

menuentry "Debian GNU/Linux, con Linux 3.0.0-2-686-pae (on /dev/sda2)" –class gnu-linux –class gnu –class os {
    insmod part_msdos
    insmod xfs
    set root='(hd0,msdos2)'
    search –no-floppy –fs-uuid –set=root 6bd4fb51-8482-4af3-8cd9-897b1c0c0b8e
    linux /boot/vmlinuz-3.0.0-2-686-pae root=UUID=30b78306-283a-487d-8896-e47ecb8c7ed5 ro quiet
    initrd /boot/initrd.img-3.0.0-2-686-pae
}
 

 

enjoy ;)

Share on Twitter
Tag:

Comments 11 Commenti »

 

Exiftool è uno strumento a riga di comando per la lettura/scrittura/modifica dei metadati, ne supporta tanti, da quelli EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP ID3, a tanti altri. Comunque io l'ho usato per la lettura di una foto fatta con l'iphone e per la visualizzazione dei Geotags. Nelle macchine fotografiche come negli smartphone esiste un ricevitore GPS che al momento dello scatto di una  foto registra la posizione. Per installare exiftool:

 

$ wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-8.60.tar.gz

$ gunzip < Image-ExifTool-8.60.tar.gz | tar xvf -

$ cd Image-ExifTool-8.60

$ perl Makefile.PL

$ make test

$ sudo make install

 

Per conoscere tutti i dati inclusi nella foto usare il comando-,

 

$ exiftool -a -u -g1 foto.jpg

 

questi sono tutti quelli inclusi in una foto che ho appena scattato con l'iphone:

 

—- ExifTool —-
ExifTool Version Number         : 8.60
—- System —-
File Name                       : franco.jpg
Directory                       : .
File Size                       : 896 kB
File Modification Date/Time     : 2011:07:10 12:34:11+02:00
File Permissions                : rw-r–r–
—- File —-
File Type                       : JPEG
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Image Width                     : 1200
Image Height                    : 1600
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
—- JFIF —-
JFIF Version                    : 1.01
Resolution Unit                 : inches
X Resolution                    : 72
Y Resolution                    : 72
—- IFD0 —-
Make                            : Apple
Camera Model Name               : iPhone 3G
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : GIMP 2.6.10
Modify Date                     : 2011:07:10 12:34:08
Y Cb Cr Positioning             : Centered
—- ExifIFD —-
F Number                        : 2.8
Exposure Program                : Program AE
Exif Version                    : 0221
Date/Time Original              : 2011:07:10 11:55:05
Create Date                     : 2011:07:10 11:55:05
Components Configuration        : Y, Cb, Cr, -
Aperture Value                  : 2.8
Metering Mode                   : Average
Flash                           : No flash function
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 1200
Exif Image Height               : 1600
Sensing Method                  : One-chip color area
Exposure Mode                   : Auto
White Balance                   : Auto
Scene Capture Type              : Standard
—- GPS —-
GPS Latitude Ref                : North
GPS Latitude                    : 45 deg 36' 6.60"
GPS Longitude Ref               : East
GPS Longitude                   : 9 deg 10' 22.20"
GPS Altitude Ref                : Above Sea Level
GPS Altitude                    : 194.9008264 m
GPS Time Stamp                  : 09:55:04.4
—- IFD1 —-
Compression                     : JPEG (old-style)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Thumbnail Offset                : 770
Thumbnail Length                : 5568
—- Composite —-
Aperture                        : 2.8
GPS Altitude                    : 194.9 m Above Sea Level
GPS Latitude                    : 45 deg 36' 6.60" N
GPS Longitude                   : 9 deg 10' 22.20" E
GPS Position                    : 45 deg 36' 6.60" N, 9 deg 10' 22.20" E
Image Size                      : 1200×1600
Thumbnail Image                 : (Binary data 5568 bytes, use -b option to extract)

 

come si può vedere exiftool mostra tutti i dati che possono aiutare a ricostrure la storia della foto, partendo dalla macchina che l'ha scattata al software usato successivamente per modificare la foto, finendo con le coordinate sulla posizione. Una volta avute le coordinate si può risalire alla posizione inserendo i dati su questo sito. Quindi è indispensabile prima di fare l'upload di una foto sul web di cancellare tutti i metadati. Per conoscere solo i Geotags:

 

$ exiftool -a -gps:all foto.jpg

 

tutte le foto in una cartella:

 

$ exiftool -a -gps:all *.jpg

 

 

enjoy ;)

Share on Twitter
Tag:,

Comments 4 Commenti »

 

E' molto importante monitorare le fasi del boot del nosto O.S preferito, perchè proprio in quel frangente si possono trovare informazioni su un determinato problema. Infatti mamma Debian è impostata di default ad avviarsi in modalità verbose, senza loghi, che pur essendo carini, ti nascondono informazioni che possono risultare importanti. Comunque per ovviare a problemi simili, possiamo usare Bootlogd per registrare i messaggi di boot:

 

# nano /etc/default/bootlogd

 

ed abilitiamo bootlogd all'avvio:

 

BOOTLOGD_ENABLE=yes

 

dal prossimo avvio siamo in grado di leggere le informazioni custodite in /var/log/boot:

 

# nano /var/log/boot

 

oppure:

 

# sed $'s/\^\[/\E/g' /var/log/boot | less -R

 

 

enjoy ;)

Share on Twitter
Tag:,

Comments 1 Commento »

 

Questo è un piccolo trucchetto che serve a bloccare le porte usb. Immaginando uno scenario dove ci sono tante persone e ci si deve assentare lasciando il pc acceso, può succedere che qualche malintenzionato, approfittando della nostra assenza, inserisca una chiavetta usb,un ipod, un hard disk esterno ecc ecc, per copiare un file che per noi è importante. Per ovviare a questa situazione c'è un metodo veloce veloce:

 

# nano /etc/modprobe.d/blacklist.conf

 

ed inserire:

 

# Blocco accesso USB.
blacklist usb_storage

 

quindi riavviare. A questo punto chiunque inserirà una usb, non riuscirà ad utilizzarla. Per tornare ad una situazione di "normalità" basta commentare la stringa #blacklist usb_storage, e si potranno utilizzare le porte usb immediatamente.

 

enjoy ;)

Share on Twitter
Tag:,

Comments 10 Commenti »

 

 

RarCrack usa un algoritmo bruteforce per trovare la password di un archivio rar,zip,7z. Per una corretta compilazione su Debian Squeeze:

 

# apt-get install libxml2-dev build-essential

$ wget http://surfnet.dl.sourceforge.net/sourceforge/rarcrack/rarcrack-0.2.tar.bz2

$ tar -xjf rarcrack-0.2.tar.bz2

$ cd rarcrack-0.2

$ make

# make install

 

ipotizzando di avere un archivio compresso con password, chiamato file.rar, si può iniziare il cracking usando un comando simile:

 

# rarcrack file.rar --type rar --threads 5

 

dove i threads sono al massimo 12. La password "123" è stata trovata in 2 minuti circa.

 

GOOD: password cracked: '123'

real    2m15.301s

 

enjoy ;)

Share on Twitter
Tag:,

Comments 7 Commenti »

 

 

Per avere un buono anonimato in rete, servono tre strumenti, due presenti in ogni repository, Tor e Polipo, e l'altro è un addons per i browser Firefox/iceweasel oppure Chrome.

 

Installazione:

 

# apt-get install tor polipo

 

Configurazione:

 

# nano /etc/polipo/config

 

e configurarlo/copiarlo come questo:

 

### Basic configuration
### *******************
## Replace with the default polipo.conf file in /etc/polipo/config

# Uncomment one of these if you want to allow remote clients to
# connect:

# proxyAddress = "::0"        # both IPv4 and IPv6
# proxyAddress = "0.0.0.0"    # IPv4 only

proxyAddress = "127.0.0.1"
proxyPort = 8118

# If you do that, you'll want to restrict the set of hosts allowed to
# connect:

# allowedClients = "127.0.0.1, 134.157.168.57"
# allowedClients = "127.0.0.1, 134.157.168.0/24"

allowedClients = 127.0.0.1
allowedPorts = 1-65535

# Uncomment this if you want your Polipo to identify itself by
# something else than the host name:

proxyName = "localhost"

# Uncomment this if there's only one user using this instance of Polipo:

cacheIsShared = false

# Uncomment this if you want to use a parent proxy:

# parentProxy = "squid.example.org:3128"

# Uncomment this if you want to use a parent SOCKS proxy:

socksParentProxy = "localhost:9050"
socksProxyType = socks5

### Memory
### ******

# Uncomment this if you want Polipo to use a ridiculously small amount
# of memory (a hundred C-64 worth or so):

# chunkHighMark = 819200
# objectHighMark = 128

# Uncomment this if you've got plenty of memory:

# chunkHighMark = 50331648
# objectHighMark = 16384

chunkHighMark = 67108864

### On-disk data
### ************

# Uncomment this if you want to disable the on-disk cache:

diskCacheRoot = ""

# Uncomment this if you want to put the on-disk cache in a
# non-standard location:

# diskCacheRoot = "~/.polipo-cache/"

# Uncomment this if you want to disable the local web server:

localDocumentRoot = ""

# Uncomment this if you want to enable the pages under /polipo/index?
# and /polipo/servers?.  This is a serious privacy leak if your proxy
# is shared.

# disableIndexing = false
# disableServersList = false

disableLocalInterface = true
disableConfiguration = true

### Domain Name System
### ******************

# Uncomment this if you want to contact IPv4 hosts only (and make DNS
# queries somewhat faster):
#
# dnsQueryIPv6 = no

# Uncomment this if you want Polipo to prefer IPv4 to IPv6 for
# double-stack hosts:
#
# dnsQueryIPv6 = reluctantly

# Uncomment this to disable Polipo's DNS resolver and use the system's
# default resolver instead.  If you do that, Polipo will freeze during
# every DNS query:

dnsUseGethostbyname = yes

### HTTP
### ****

# Uncomment this if you want to enable detection of proxy loops.
# This will cause your hostname (or whatever you put into proxyName
# above) to be included in every request:

disableVia = true

# Uncomment this if you want to slightly reduce the amount of
# information that you leak about yourself:

# censoredHeaders = from, accept-language
# censorReferer = maybe

censoredHeaders = from,accept-language,x-pad,link
censorReferer = maybe

# Uncomment this if you're paranoid.  This will break a lot of sites,
# though:

# censoredHeaders = set-cookie, cookie, cookie2, from, accept-language
# censorReferer = true

# Uncomment this if you want to use Poor Man's Multiplexing; increase
# the sizes if you're on a fast line.  They should each amount to a few
# seconds' worth of transfer; if pmmSize is small, you'll want
# pmmFirstSize to be larger.

# Note that PMM is somewhat unreliable.

# pmmFirstSize = 16384
# pmmSize = 8192

# Uncomment this if your user-agent does something reasonable with
# Warning headers (most don't):

# relaxTransparency = maybe

# Uncomment this if you never want to revalidate instances for which
# data is available (this is not a good idea):

# relaxTransparency = yes

# Uncomment this if you have no network:

# proxyOffline = yes

# Uncomment this if you want to avoid revalidating instances with a
# Vary header (this is not a good idea):

# mindlesslyCacheVary = true

# Suggestions from Incognito configuration
maxConnectionAge = 5m
maxConnectionRequests = 120
serverMaxSlots = 8
serverSlots = 2
tunnelAllowedPorts = 1-65535

 

La configurazione di default per Torbutton dovrebbe essere già così:

 

Proxy HTTP :  127.0.0.1  Porta :  8118
Proxy SSL : 127.0.0.1 Porta : 8118
Host SOCKS : 127.0.0.1 Porta : 9050
flag su SOCKS v5

 

per iniziare ad utilizzare tor e polipo::

 

# /etc/init.d/tor start
# /etc/init.d/polipo start

 

avviare torbutton e verificare l'anonimato quà e quà.

 

 

enjoy ;)

 

Share on Twitter
Tag:,

Comments 9 Commenti »

 

 

Scrivo due righe per chi si trovasse ad avere lo stesso problema che ho avuto io in una fresca installazione di LMDE 64 bit. I problemi in /etc/fstab sono sempre più frequenti, anzi credo che siano gravemente proporzionali al numero di partizioni che si hanno su hard disk, ossia più partizioni più errori. Come già ho avuto modo di lamentarmi, non solo scambia /dev/sda1 windows con ext3 /, ma questa volta ha aggiunto una partizione inesistente e cioè /dev/sda2, più un kernel panic.

# / was on /dev/sda1 during installation
UUID=385ecae6-bd34-41c3-a524-974b8cd6d17f /               ext3    errors=remount-ro 0       1
# swap was on /dev/sda2 during installation
UUID=c6876978-438f-4a1e-ae53-dacdf22d1e4a none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
proc    /proc    proc    nodev,noexec,nosuid    0    0
/dev/sda12    /    ext4    rw,errors=remount-ro    0    0
 

Sopra si vede la partizione /dev/sda1 dove c'è Windows, identificata come / ext3, e la partizione /dev/sda2 con swap, errata sia nell'uuid, sia nella partizione. Comunque una volta finita l'installazione al momento di riavviare ho ottenuto una specie di kernel panic, dove in quelle poche righe l'unica cosa che si capiva era: UUID=xxxxxx-xxxx-xxxxx-xxxx inesistente. Quindi il passo successivo è stato avviare da un'altra distro e montare la nuova installazione, e controllare l'uuid, che da un controllo con blkid risultava esatto. Quali le stringhe incriminate?
 

menuentry "Debian GNU/Linux, with Linux 2.6.32-5-amd64 (on /dev/sda12)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos12)'
    search –no-floppy –fs-uuid –set dc199cb8-c4ee-48e1-9e8c-69b304cd12d9
    linux /boot/vmlinuz-2.6.32-5-amd64 root=UUID=1f084bbd-a556-4e8b-9ab4-c9049cfda7e3 ro quiet
    initrd /boot/initrd.img-2.6.32-5-amd64
}
 

guardando più attentamente si nota che i due uuid sono diversi, il primo esatto il secondo errato, ecco da dove arrivava il kernel panic, infatti una volta modificato il secondo uuid, LMDE riesce a bootare. Successivamente si deve cambiare l'uuid anche in /etc/initramfs-tools/conf.d/resume. Quindi ho l'impressione che piu partizioni si hanno e più si può incorrere in errori, tutto questo in attesa della risoluzione. Una nota positiva dell'installer è che riconosce la partizione zfs :) mentre quello Debian no.

 

enjoy ;)
 

Share on Twitter
Tag:

Comments 3 Commenti »