[Iftop-users] Security Issue With iftop

Ali Jawad alijawad1 at gmail.com
Mon, 18 Jan 2010 21:34:27 +0300


--0015175cfd84c38aed047d749baf
Content-Type: text/plain; charset=ISO-8859-1

Hi Paul
I discovered it by accident, and well you are right about bugs for privilege
escalation. But this is not a bug, it is a feature that can be used for
privilege escalation.
I did google around and as you said it is barely known. I can see the
benefits of the feature, to see live changes in traffic shapping by
executing different traffic shapping scripts through the commad prompts and
seeing the results.

For my own needs, I will remove the deb package and recompile from source.

Regards

On Mon, Jan 18, 2010 at 9:24 PM, Paul Warren <pdw@ex-parrot.com> wrote:

> Ali,
>
>
> On 18 Jan 2010, at 16:35, Ali Jawad wrote:
>
>  As you all know a non root user can not run iftop. So the most obvious
>> workaround is to use sudo. Now if you give a regular user sudo access he
>> will execute.
>>
>> sudo iftop
>>
>> Once he is inside iftop. He can execute ! he will get the following promtp
>>
>> command >
>>
>
> I have to say, I'd completely forgotten that that feature existed!
>
>
>  At this point a user can execute su, and he will get a root shell. He can
>> also execute any command in privileged mode. The idea of using sudo
>> initially was giving the user iftop access. However the user ends up with
>> total root access.
>>
>
> Indeed.
>
> There are two answers to this.  The first is that although this provides
> the user with a very direct and simple way of getting a shell, I would not
> warrant that there are not bugs in either iftop or any of it's library
> dependencies that can be exploited to give privilege escalation.  This
> applies to just about any non-trivial program that you may wish to make
> available via sudo.
>
> The second answer is that there's a compile-time option to disable this
> functionality (which I'd also forgotten about, but the change log claims it
> was introduced in 0.17).
>
> I can't remember exactly how to use it, but something like:
>
>        export CFLAGS=-DNO_SYSTEM
>
> then rebuilding may do what you want.
>
> Paul
>
>

--0015175cfd84c38aed047d749baf
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Paul<br>I discovered it by accident, and well you are r=
ight about bugs for privilege escalation. But this is not a bug, it is a fe=
ature that can be used for privilege escalation.<br>I did google around and=
 as you said it is barely known. I can see the benefits of the feature, to =
see live changes in traffic shapping by executing different traffic shappin=
g scripts through the commad prompts and seeing the results.<br>

<br>For my own needs, I will remove the deb package and recompile from sour=
ce.<br><br>Regards<br><br><div class=3D"gmail_quote">On Mon, Jan 18, 2010 a=
t 9:24 PM, Paul Warren <span dir=3D"ltr">&lt;<a href=3D"mailto:pdw@ex-parro=
t.com">pdw@ex-parrot.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Ali,<div class=3D=
"im"><br>
<br>
On 18 Jan 2010, at 16:35, Ali Jawad wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
As you all know a non root user can not run iftop. So the most obvious work=
around is to use sudo. Now if you give a regular user sudo access he will e=
xecute.<br>
<br>
sudo iftop<br>
<br>
Once he is inside iftop. He can execute ! he will get the following promtp<=
br>
<br>
command &gt;<br>
</blockquote>
<br></div>
I have to say, I&#39;d completely forgotten that that feature existed!<div =
class=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At this point a user can execute su, and he will get a root shell. He can a=
lso execute any command in privileged mode. The idea of using sudo initiall=
y was giving the user iftop access. However the user ends up with total roo=
t access.<br>


</blockquote>
<br></div>
Indeed.<br>
<br>
There are two answers to this. =A0The first is that although this provides =
the user with a very direct and simple way of getting a shell, I would not =
warrant that there are not bugs in either iftop or any of it&#39;s library =
dependencies that can be exploited to give privilege escalation. =A0This ap=
plies to just about any non-trivial program that you may wish to make avail=
able via sudo.<br>


<br>
The second answer is that there&#39;s a compile-time option to disable this=
 functionality (which I&#39;d also forgotten about, but the change log clai=
ms it was introduced in 0.17).<br>
<br>
I can&#39;t remember exactly how to use it, but something like:<br>
<br>
 =A0 =A0 =A0 =A0export CFLAGS=3D-DNO_SYSTEM<br>
<br>
then rebuilding may do what you want.<br><font color=3D"#888888">
<br>
Paul<br>
<br>
</font></blockquote></div><br></div>

--0015175cfd84c38aed047d749baf--