Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

perl POSIX setuid root

18 views
Skip to first unread message

fakessh

unread,
Sep 28, 2012, 5:41:20 PM9/28/12
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

bonjour les newsgroups

tout le monde se parle nous formons un groupe uni
"special d'accord" mais solide

je cherche de la doocumenation sur je crois la parti posix de perl
pour effectuer l'operation correspondante en c


#include <unistd.h>

void main(void)
{

setuid(0);
setgid(0);
execl("/bin/sh","sh",NULL);

}


ma question ne porte pas sur l ouverture du shell
mais l equivalent de
setuid(0);
setgid(0);

pouvez vous me repondre en m expliquand

merci beaucoup
- --
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC2626742
gpg --keyserver pgp.mit.edu --recv-key C2626742

http://about.me/fakessh
http://urlshort.eu fakessh @
http://gplus.to/sshfake
http://gplus.to/sshswilting
http://gplus.to/john.swilting
https://lists.fakessh.eu/mailman/
This list is moderated by me, but all applications will be accepted
provided they receive a note of presentation
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBmGYAACgkQNgqL0sJiZ0ItJACglauhOvvcVr07N2FL4sQ151C6
lt4AnA8/v0hYUY0YvZi/j43ZRfgar3qS
=YJ43
-----END PGP SIGNATURE-----

fakessh

unread,
Sep 28, 2012, 5:49:23 PM9/28/12
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 28/09/2012 23:41, fakessh a écrit :
> bonjour les newsgroups
>
> tout le monde se parle nous formons un groupe uni "special
> d'accord" mais solide
>
> je cherche de la doocumenation sur je crois la parti posix de perl
> pour effectuer l'operation correspondante en c
>
>
> #include <unistd.h>
>
> void main(void) {
>
> setuid(0); setgid(0); execl("/bin/sh","sh",NULL);
>
> }
>
>
> ma question ne porte pas sur l ouverture du shell mais l equivalent
> de setuid(0); setgid(0);
>
> pouvez vous me repondre en m expliquand
>
> merci beaucoup


serait il possible de donner la valeur 0 à

#!/usr/bin/perl -wT

use POSIX;

my $uid = getuid() or die "Failed to determine user id.";
my $euid = geteuid() or die "Failed to determine effective user id.";

print "UID = $uid, EUID = $euid.\n";



- --
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC2626742
gpg --keyserver pgp.mit.edu --recv-key C2626742

http://about.me/fakessh
http://urlshort.eu fakessh @
http://gplus.to/sshfake
http://gplus.to/sshswilting
http://gplus.to/john.swilting
https://lists.fakessh.eu/mailman/
This list is moderated by me, but all applications will be accepted
provided they receive a note of presentation
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBmG2MACgkQNgqL0sJiZ0LTqQCglNSpv+o4g+wWZkdKD5DfFekZ
dSEAn2DDhsbpv+jYjvBPFqOTOY4gLzNL
=JZFZ
-----END PGP SIGNATURE-----

fakessh

unread,
Sep 28, 2012, 6:11:32 PM9/28/12
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 28/09/2012 23:49, fakessh a écrit :
> Le 28/09/2012 23:41, fakessh a écrit :
>> bonjour les newsgroups
>
>> tout le monde se parle nous formons un groupe uni "special
>> d'accord" mais solide
>
>> je cherche de la doocumenation sur je crois la parti posix de
>> perl pour effectuer l'operation correspondante en c
>
>
>> #include <unistd.h>
>
>> void main(void) {
>
>> setuid(0); setgid(0); execl("/bin/sh","sh",NULL);
>
>> }
>
>
>> ma question ne porte pas sur l ouverture du shell mais l
>> equivalent de setuid(0); setgid(0);
>
>> pouvez vous me repondre en m expliquand
>
>> merci beaucoup
>
>
> serait il possible de donner la valeur 0 à
>
> #!/usr/bin/perl -wT
>
> use POSIX;
>
> my $uid = getuid() or die "Failed to determine user id."; my
> $euid = geteuid() or die "Failed to determine effective user id.";
>
> print "UID = $uid, EUID = $euid.\n";
>
>
>

quand j ecris cela pas de resultat
use POSIX;

my $setuid= POSIX::setuid(0);
print $setuid,"its smart root\n";


- --
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC2626742
gpg --keyserver pgp.mit.edu --recv-key C2626742

http://about.me/fakessh
http://urlshort.eu fakessh @
http://gplus.to/sshfake
http://gplus.to/sshswilting
http://gplus.to/john.swilting
https://lists.fakessh.eu/mailman/
This list is moderated by me, but all applications will be accepted
provided they receive a note of presentation
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBmIJQACgkQNgqL0sJiZ0KvIQCgjyexRloCUnQCiuwpKgILnTIQ
WJgAnigmnIRHi/xA7ezoPplpdtOnWkxL
=MLQb
-----END PGP SIGNATURE-----

Paul Gaborit

unread,
Sep 28, 2012, 7:51:25 PM9/28/12
to

À (at) Sat, 29 Sep 2012 00:11:32 +0200,
fakessh <se...@smtp.fakessh.eu> écrivait (wrote):

> quand j ecris cela pas de resultat
> use POSIX;
>
> my $setuid= POSIX::setuid(0);
> print $setuid,"its smart root\n";

Comme conseillé par la doc, il faut lire ce qui concerne la variable
$UID (ou $<) dans perlvar. En résumé, il faut regarder ce que contient
$! après l'appel à setuid...

--
Paul Gaborit - <http://perso.mines-albi.fr/~gaborit/>
Perl en français - <http://perl.mines-albi.fr/>

Marc Espie

unread,
Sep 29, 2012, 3:14:27 AM9/29/12
to
In article <k455hs$nh7$1...@speranza.aioe.org>,
fakessh <se...@smtp.fakessh.eu> wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>bonjour les newsgroups
>
>tout le monde se parle nous formons un groupe uni
>"special d'accord" mais solide
>
>je cherche de la doocumenation sur je crois la parti posix de perl
>pour effectuer l'operation correspondante en c
>
>
> #include <unistd.h>
>
> void main(void)
int main()
> {
>
> setuid(0);
> setgid(0);
> execl("/bin/sh","sh",NULL);
>
> }
>
>
>ma question ne porte pas sur l ouverture du shell
>mais l equivalent de
>setuid(0);
>setgid(0);
>
>pouvez vous me repondre en m expliquand

C'est curieux, on vous a deja vu passer sur fr.comp.lang.c.

La-aussi, la question etait relativement simple, et le theme
encore plus clair.

Donc maintenant, vous avez votre petit serveur de pirate qui
marche, et vous etes en train de bidouiller pour voir pourquoi
votre attaque initiale ne vous donne pas directement les
droits de root, c'est bien ca ?

fakessh

unread,
Sep 29, 2012, 5:54:01 PM9/29/12
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

je suis tombe sur cela

http://www.cpan.org/src/5.0/fixsperl-0
- --
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC2626742
gpg --keyserver pgp.mit.edu --recv-key C2626742

http://about.me/fakessh
http://urlshort.eu fakessh @
http://gplus.to/sshfake
http://gplus.to/sshswilting
http://gplus.to/john.swilting
https://lists.fakessh.eu/mailman/
This list is moderated by me, but all applications will be accepted
provided they receive a note of presentation
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBnbfkACgkQNgqL0sJiZ0JbvACg0dBj/dhNxzUf6f1ScErLbDPS
UBQAn0uic8HN3kY9HPse6T1ZfrUYxHH6
=1SAf
-----END PGP SIGNATURE-----

Olivier Miakinen

unread,
Sep 29, 2012, 6:12:09 PM9/29/12
to
Le 29/09/2012 23:54, fakessh a écrit :
>
> je suis tombe sur cela
>
> http://www.cpan.org/src/5.0/fixsperl-0
> - --
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC2626742
> gpg --keyserver pgp.mit.edu --recv-key C2626742
>
> http://about.me/fakessh
> http://urlshort.eu fakessh @
> http://gplus.to/sshfake
> http://gplus.to/sshswilting
> http://gplus.to/john.swilting
> https://lists.fakessh.eu/mailman/
> This list is moderated by me, but all applications will be accepted
> provided they receive a note of presentation
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.14 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAlBnbfkACgkQNgqL0sJiZ0JbvACg0dBj/dhNxzUf6f1ScErLbDPS
> UBQAn0uic8HN3kY9HPse6T1ZfrUYxHH6
> =1SAf
> -----END PGP SIGNATURE-----

Aïe ! Tu es tombé sur une liste de plus d'une demi-douzaine d'URL,
avec du texte en anglais, et une bouillie infâme de clé PGP ? Toutes
mes condoléances parce que c'est assez rude sur un groupe usenet où
généralement on parle en français, où les signatures sont courtes et
correctement signalées, et où il n'y a pas de binaire (fût-il encodé
en ASCII).

[suivi vers la poubelle]

--
Olivier Miakinen

fakessh

unread,
Sep 29, 2012, 7:35:03 PM9/29/12
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 29/09/2012 01:51, Paul Gaborit a écrit :
>
> À (at) Sat, 29 Sep 2012 00:11:32 +0200, fakessh
> <se...@smtp.fakessh.eu> écrivait (wrote):
>
>> quand j ecris cela pas de resultat use POSIX;
>>
>> my $setuid= POSIX::setuid(0); print $setuid,"its smart root\n";
>
> Comme conseillé par la doc, il faut lire ce qui concerne la
> variable $UID (ou $<) dans perlvar. En résumé, il faut regarder ce
> que contient $! après l'appel à setuid...
>


en ecrivant ceci

$< = 0;
my $setuid= POSIX::setuid($<) or die "erreur setuid $!";
print $setuid," its smart root\n"

j obtiens dans le terminal
0 but true its smart root


que veut dire le resultat
- --
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC2626742
gpg --keyserver pgp.mit.edu --recv-key C2626742

http://about.me/fakessh
http://urlshort.eu fakessh @
http://gplus.to/sshfake
http://gplus.to/sshswilting
http://gplus.to/john.swilting
https://lists.fakessh.eu/mailman/
This list is moderated by me, but all applications will be accepted
provided they receive a note of presentation
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBnhacACgkQNgqL0sJiZ0KrZACgqOKZRnRdYBxeL2BMW9upNKNT
RyIAn3FaSf/bDwDdJGgRkO6TWPols8YJ
=+VDA
-----END PGP SIGNATURE-----
0 new messages