View previous topic :: View next topic |
Author |
Message |
CarloJekko Veteran


Joined: 31 Mar 2005 Posts: 1315 Location: Baia Domizia :-)
|
Posted: Sat Feb 16, 2008 1:43 pm Post subject: [risolto] ubuntu e gentoo e suid |
|
|
Allora, ho generato questo codice
Code: | #include <cstdlib>
using namespace std;
int main(){system("cat /etc/shadow");}
|
compilato in root e fatto
Quindi ho suiddato per farlo partire con utente root...
Allora faccio partire a.out con utente pippo e quello che mi esce con fedora, hackin9 (derivato da gentoo) e la mia gentoo-box
Code: | cat: /etc/shadow: Permission denied |
Mentre su Ubuntu mi fa vedere /etc/shadow
a questo punto la domanda è: perchè?
Scusate ma ps non ha bisogno di privilegi di root per accedere alla memoria etc... quindi non è suiddato per essere eseguito come root?
come sa che ps può essere esguito come root e il mio no? _________________ C.
Last edited by CarloJekko on Sun Feb 17, 2008 11:21 pm; edited 1 time in total |
|
Back to top |
|
 |
randomaze Bodhisattva


Joined: 21 Oct 2003 Posts: 9985
|
Posted: Sat Feb 16, 2008 1:46 pm Post subject: |
|
|
Moved from Forum italiano (Italian) to Forum di discussione italiano.
Prova a controllare i vari id numerici per vedere se coincidono, e/o verifica l'output di "ls -l" sulle distribuzioni che non vanno. _________________ Ciao da me! |
|
Back to top |
|
 |
CarloJekko Veteran


Joined: 31 Mar 2005 Posts: 1315 Location: Baia Domizia :-)
|
Posted: Sat Feb 16, 2008 2:18 pm Post subject: |
|
|
randomaze wrote: | Moved from Forum italiano (Italian) to Forum di discussione italiano.
Prova a controllare i vari id numerici per vedere se coincidono, e/o verifica l'output di "ls -l" sulle distribuzioni che non vanno. |
Code: | ls -l a.out
-rwsrwxrwx 1 root root 6988 16 feb 14:34 a.out |
i permessi sono a posto....(comunque l'avevo messo sul main perchè è una cosa che riguarda gentoo... cmq ok qui ) _________________ C. |
|
Back to top |
|
 |
randomaze Bodhisattva


Joined: 21 Oct 2003 Posts: 9985
|
Posted: Sat Feb 16, 2008 2:41 pm Post subject: |
|
|
CarloJekko wrote: | i permessi sono a posto....(comunque l'avevo messo sul main perchè è una cosa che riguarda gentoo... cmq ok qui ) |
Cioè tutte le distribuzioni ti danno quell'output identificando correttamente l'owner e il group di quel file?
CarloJekko wrote: | (comunque l'avevo messo sul main perchè è una cosa che riguarda gentoo... cmq ok qui ) |
Beh l'ho spostato perchè "su gentoo funziona"  _________________ Ciao da me! |
|
Back to top |
|
 |
CarloJekko Veteran


Joined: 31 Mar 2005 Posts: 1315 Location: Baia Domizia :-)
|
Posted: Sat Feb 16, 2008 3:10 pm Post subject: |
|
|
randomaze wrote: | CarloJekko wrote: | i permessi sono a posto....(comunque l'avevo messo sul main perchè è una cosa che riguarda gentoo... cmq ok qui ) |
Cioè tutte le distribuzioni ti danno quell'output identificando correttamente l'owner e il group di quel file?
CarloJekko wrote: | (comunque l'avevo messo sul main perchè è una cosa che riguarda gentoo... cmq ok qui ) |
Beh l'ho spostato perchè "su gentoo funziona"  |
I permessi sono uguali su tutte le distro: owner root gruppo root e suid su root
chiuenque lo esegue lo fa eseguire a root... ma su gentoo mi dice con un utente che non sono in grado di vedere /etc/shadow (come se il suid non fosse settato) mentre su ubuntu si...
Da questo punto di vista gentoo è di gran lunga più sicuro di ubuntu.. basti pensare che io faccio un sw sul mio pc, lo compilo con root lo suiddo etc e poi lo porto su una penna usb su ubuntu... conservando i diritti, esegue quel sw come root (in quanto l'id 0 è root ovunque) con qualsiasi utente...
Comunque ritorno al tema principale: Come capisce qual'è il SUID di ps e quale del mio sw? Sicuro c'è lo zampino del kernel... ma come lo capisce!
questo è l'output con su
Code: |
-rws--x--x 1 root root 35596 28 lug 2007 /bin/su
ls -l a.out
-rwsrwxrwx 1 root root 6988 16 feb 14:34 a.out
|
_________________ C. |
|
Back to top |
|
 |
djinnZ Advocate


Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Sat Feb 16, 2008 3:35 pm Post subject: |
|
|
versioni di bash e libc sui vari sistemi? Quello che c'è scritto in man system lo hai letto? _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist  |
|
Back to top |
|
 |
CarloJekko Veteran


Joined: 31 Mar 2005 Posts: 1315 Location: Baia Domizia :-)
|
Posted: Sat Feb 16, 2008 4:41 pm Post subject: |
|
|
djinnZ wrote: | versioni di bash e libc sui vari sistemi? Quello che c'è scritto in man system lo hai letto? |
bash=3.22_p33
libc=2.7_r1
ubuntu è quella di default della 7.10 quindi credo bash=3.22 e libc =2.6.22
credo che siano questi quelli di ubuntu
Comunque provate per credere... non va... che mistero ! _________________ C. |
|
Back to top |
|
 |
CarloJekko Veteran


Joined: 31 Mar 2005 Posts: 1315 Location: Baia Domizia :-)
|
Posted: Sun Feb 17, 2008 1:18 pm Post subject: |
|
|
C'è qualcuno che può provare? Almeno vediamo se è un problema localizzato... _________________ C. |
|
Back to top |
|
 |
Onip Advocate


Joined: 02 Sep 2004 Posts: 2912 Location: Parma (Italy)
|
Posted: Sun Feb 17, 2008 4:23 pm Post subject: |
|
|
da me funziona come a te ( permission denied ) con
bash-3.2_p17-r1
glibc-2.6.1
gcc-4.1.2 _________________ Linux Registered User n. 373835
Titus Lucretius Carus, De Rerum Natura - Tantum religio potuit suadere malorum |
|
Back to top |
|
 |
djinnZ Advocate


Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Sun Feb 17, 2008 4:59 pm Post subject: Re: ubuntu e gentoo e suid |
|
|
Code: | #include <cstdlib>
using namespace std;
int main(){system("set");}
|
_________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist  |
|
Back to top |
|
 |
.:deadhead:. Advocate


Joined: 25 Nov 2003 Posts: 2963 Location: Milano, Italy
|
|
Back to top |
|
 |
CarloJekko Veteran


Joined: 31 Mar 2005 Posts: 1315 Location: Baia Domizia :-)
|
Posted: Sun Feb 17, 2008 11:09 pm Post subject: |
|
|
.:deadhead:. wrote: | djinnZ wrote: | Quello che c'è scritto in man system lo hai letto? | è abbastanza illuminante  |
Grazie... system era il problema !!
ho risolto con execv _________________ C. |
|
Back to top |
|
 |
|