Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sono stato hackerato???
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
wildancer
Guru
Guru


Joined: 02 Apr 2004
Posts: 472

PostPosted: Thu Aug 07, 2008 1:44 am    Post subject: Sono stato hackerato??? Reply with quote

Ragazzi, il mio utente (non root) puo fare il login anche con la pass incompleta... Che succede?!??! Voglio dire... Posso entrare con la pass anche se non introduco gli ultimi 4 caratteri!! (la pass odierna è di 12 caratteri, ma bastano i primi 8! con 8 caratteri casuali non entra vedo...) Aiuto!! Hacker, bug o malconfigurazione di qualcosa??
Back to top
View user's profile Send private message
Laux
n00b
n00b


Joined: 25 Apr 2007
Posts: 44
Location: Monkey Island

PostPosted: Thu Aug 07, 2008 6:08 am    Post subject: Reply with quote

Con ogni probabilità la password è composta da al più 8 caratteri, e la cosa è confortata da quanto ho trovato in rete: una piccola lettura in inglese molto esplicativa, soprattutto per quel che raccomanda con le password (ho evidenziato con "<<--")
Vedi se la risposta è soddisfacente ;)

Quote:
Linux Shadow Passwords

The shadow password suite allows the following features to be added to your system:

* A configuration file to set login defaults (/etc/login.defs)
* Utilities for adding, modifying, and deleting user accounts and groups (chage,
* Password aging and expiration
* Account expiration and locking
* Shadowed group passwords (optional)
-------->>>>>> * Double length passwords (16 character passwords) NOT RECOMMENDED] <<<<<<--------
* Better control over user's password selection
* Dial-up passwords

Replacement programs included are chfn, chsh, id, login, newgrp, passwd, and su. Additional programs included are chage, dpasswd, gpasswd, groupadd, groupdel, groupmod, groups, grpck, lastlog, newusers, pwck, pwconv, pwunconv, useradd, userdel, and usermod. Also libshadow.a is a library included for compiling programs that need to use the user password files or user passwords.

If your system did not come with shadow passwords and you are going to install it you will want to read the Shadow-Password-HOWTO and roughly do the following.

1. Find the latest shadow password suite that will work on your system
2. Backup a copy of your files listed above that the shadow password suite will replace.
3. Install the shadow password suite.
4. Remove old man pages that may interfere with you seeing the correct replacement man pages that came with the shadow password suite.
5. run pwconv which creates /etc/npasswd and /etc/nshadow
6. Backup /etc/passwd and copy the files /etc/npasswd and /etc/nshadow to /etc/passwd and /etc/shadow respectively.
7. Be sure the /etc/shadow and /etc/passwd owners and permissions are the same as shown in listings in this manual.
8. Verify you can login
9. When you are sure the system runs OK, remove backup files such as the backed up copy of /etc/passwd.
10. You may need to upgrade your xlock program to get X working. xlock is the screen saver used to lock the screen.
11. xdm presents the login screen for X. You may need to upgrade xdm.

The shadow password suite of software allows for the user's passwords to be stored in a file, /etc/shadow with the following permissions:

-r-------- 1 root root 729 May 5 12:43 /etc/shadow

This file can only be read by root and looks like:

root:!!:11077:0:99999:7:-1:-1:134550548
bin:*:10942:0:99999:7:::
daemon:*:10942:0:99999:7:::
adm:*:10942:0:99999:7:::
lp:*:10942:0:99999:7:::
sync:*:10942:0:99999:7:::
shutdown:*:10942:0:99999:7:::
halt:*:10942:0:99999:7:::
mail:*:10942:0:99999:7:::
news:*:10942:0:99999:7:::
uucp:*:10942:0:99999:7:::
operator:*:10942:0:99999:7:::
games:*:10942:0:99999:7:::
gopher:*:10942:0:99999:7:::
ftp:*:10942:0:99999:7:::
nobody:*:10942:0:99999:7:::
xfs:!!:10942:0:99999:7:::
gdm:!!:10942:0:99999:7:::
postgres:!!:10942:0:99999:7:::
squid:!!:10942:0:99999:7:::
mark:!!:10942:0:99999:7:-1:-1:134550548
george:!!:11082:0:99999:7:-1:-1:134549460

I have modified the password entries. Its format is:

login:password:Daysince:Daysafter:Daysmust:dayswarn:daysexpire:daysince:reserved

Where:

* login - login name
* password - password in encrypted form, which is 13 to 24 characters long.
* Daysince - Days since Jan 1, 1970 that the password was changed
* Daysafter - Days before the password may be changed
* Daysmust - Days after which the password must be changed
* dayswarn - Days before the password will expire ( A warning to the user)
* daysexpire - Days after the password expires that the account is disabled
* daysince - Days since Jan1, 1970 that the account is disabled.
* reserved - Reserved field.

Shadow password utility programs

The following programs are available as tools to manipulate shadow passwords and user password entry information/requirements.

* chage - Used to change information on the required number of days between user password changes and date of the last change. Non-root users can only use chage with the -l option to see when their password will expire. Options are:
1. l -
2. m - Set the minimum days between password changes
3. M - Set the maximum days a password will be valid for.
4. W - Sets the number of days the user is warned before their password expires.
5. d - Used to change the time of the last password change.
6. E - Set a date the user's account will not be accessible.
7. I - The days of inactivity after a password has expired until the account is locked.
* pwconv - Used to create the file /etc/shadow from the file /etc/passwd. In short, it converts to a shadow password system. It uses the file /etc/login.defs to get PASS_MIN_DAYS, PASS_MAX_DAYS, and PASS_WARN_AGE values to help generate the /etc/shadow file.
* pwunconv - Uses the files /etc/passwd and /etc/shadow to create /etc/passwd, then deletes /etc/shadow. In short, it removes the shadow password system.
* grpconv - Creates /etc/gshadow form the file /etc/group.
* grpunconv - Uses the files /etc/passwd and /etc/shadow to create /etc/passwd, then deletes /etc/shadow.
* pwck - Checks the /etc/passwd and /etc/shadow files for errors.
* grpck - Checks the /etc/group and /etc/sgroup files for errors.
* usermod - Modify a user's account. Options are:
1. d - Change the user's home directory
2. e - Change the user's account expiration date in the format YYYY-MM-DD.
3. f - Change the number of days after the password expires to when the account is disabled.
4. g - Change the user's initial login group name.
5. G - Supplemental groups that hte user is also a member of.
6. l - Change the user's login name
7. p - The encrypted password
8. s - Change the name of the user's login shell
9. u - The numerical value oif the users ID
10. L - Lock a user's password, disabling it with a ! infront to the value in the /etc/shadow file.
11. U - Unlock a user's password
See the manpage on usermod for more information.
* crypt - The password encryption function.



Il file con l'elenco di tutti gli utenti è, su tutti i sistemi Linux, /etc/passwd, qui ci sono informazioni sulla login dell'utente, la shell utilizzata, la posizione della sua home directory, dove l'utente può liberamente scrivere dati e documenti.
In tutti i Linux moderni, la password, criptata viene scritta nel file /etc/shadow dove vengono mantenute altre informazioni relative alla gestione della stessa.
_________________
In vino veritas, in scarpe adidas, in bagno badedas, in culo........ un ananas!
Back to top
View user's profile Send private message
riverdragon
Veteran
Veteran


Joined: 14 Sep 2006
Posts: 1269
Location: Verona

PostPosted: Thu Aug 07, 2008 8:27 am    Post subject: Reply with quote

Beh puoi vantarti di aver trovato una delle rare "collisioni" nelle sequenze di hash di /etc/shadow!

Per spiegare in breve: nel sistema non è salvata la tua password (per motivi di sicurezza), bensì viene fatto un hash di lunghezza fissa della coppia nome utente + password, e viene salvata quello; all'atto dell'autenticazione, il sistema registra il nome utente che inserisci, quindi fa l'hash spiegato prima: se e solo se il risultato dell'operazione corrisponde a quanto salvato nel sistema, fa entrare l'utente,

Nel tuo caso probabilmente l'hash derivato dal tuo nome utente e dai primi 8 caratteri della password risulta uguale a quello che si ottiene con la password completa (infatti dici anche tu che con 8 caratteri a caso l'autenticazione non va a buon fine). Non sei stato "hackerato". Non so se sia il caso di riportare il caso a qualcuno, ma a te basta cambiare password per vivere tranquillo.
Back to top
View user's profile Send private message
wildancer
Guru
Guru


Joined: 02 Apr 2004
Posts: 472

PostPosted: Thu Aug 07, 2008 9:35 am    Post subject: Reply with quote

allora... quindi mi date due possibilità: hash collision e malconfigurazione (o meglio... buona configurazione visto che le pass lunghe non so perché sono sconsigliate...)

Vediamo....

Ebbene si.... Ho scoperto dopo mille anni che la mia password da 12 caratteri non aveva proprio significato!!! secondo il file di conf:

Code:

# Number of significant characters in the password for crypt().
# Default is 8, don't change unless your crypt() is better.
# Ignored if MD5_CRYPT_ENAB set to "yes".
#
#PASS_MAX_LEN           8


Quindi con MD5_CRYPT_ENAB c'è poco da fare... E cmq, sembrerebbe proprio che la funzione crypt() sia deboluccia...

Dai ragazzi non ci credo! Volete dirmi che Con pass lunga l'hash diventa decriptabile? Aggiungendo che con una pass corta il bruteforce è piu semplice... Direi che c'è qualcosa che non quadra.....
Back to top
View user's profile Send private message
Laux
n00b
n00b


Joined: 25 Apr 2007
Posts: 44
Location: Monkey Island

PostPosted: Thu Aug 07, 2008 9:56 am    Post subject: Reply with quote

Molto probabilmente è più semplice di quanto si pensi: una password di root od utente che subisca un brute force risulta inutile se si ha a disposizione il pc che si vuole "ispezionare", mentre sarebbe concepibile solo da remoto, ma a questo punto qualche sistema di sicurezza dovrebbe fare il suo lavoro e rendere sicura la macchina...

Tuttavia ci sarebbe la strada della ricerca secondo la quale potremmo dibattere sulla questione a puro titolo accademico per approfondire la questione :)

In effetti devo controllare bene poichè, se ben ricordo, la mia password utente variando l'ultimo carattere non va.... Mi capita spesso di battere il carattere "ù" assieme all'invio :x
_________________
In vino veritas, in scarpe adidas, in bagno badedas, in culo........ un ananas!
Back to top
View user's profile Send private message
wildancer
Guru
Guru


Joined: 02 Apr 2004
Posts: 472

PostPosted: Thu Aug 07, 2008 10:03 am    Post subject: Reply with quote

Si beh l'hash si può prendere avendo accesso fisico alla macchina, ok... Quindi potrei impostare a 16 la lunghezza delle pass e via... Però a questo punto credo che potrei anche dare un'occhiata a altre codifiche magari piu forti... Per esempio che ne dite di DES o l'algoritmo SHA512-based?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum