<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://bliki.rimuhosting.com/rdf'>
    <s:Snip rdf:about='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/webmin'
         s:cUser='retep'
         s:oUser=''
         s:mUser='john'>
        <s:name>knowledgebase/linux/miscapplications/webmin</s:name>
        <s:content>1 Webmin (pre 1.290) Exploit&#xD;&#xA;&#xD;&#xA;In late June 2006 Security researchers discovered a webmin flaw that lets anyone (even someone without a webmin login) read any file on your server.&#xD;&#xA;&#xD;&#xA;http://www.webmin.com/security.html&#xD;&#xA;&#xD;&#xA;This is obviously quite serious. e.g. we believe this security flaw could be used to read the /etc/shadow file. And hackers could then more easily identify what user accounts are on your server and what passwords are being used.&#xD;&#xA;&#xD;&#xA;If you have not had webmin running since June 2006 then you are likely not affected by this.&#xD;&#xA;&#xD;&#xA;If you have been using webmin then:&#xD;&#xA;&#xD;&#xA;- log in to stop it.&#xD;&#xA;- upgrade webmin to the latest version.&#xD;&#xA;- change your passwords _and_ any other user&apos;s passwords you may have set on the server.&#xD;&#xA;- check the output of last -a to identify any unknown logins&#xD;&#xA;&#xD;&#xA;1 Action Taken By RimuHosting&#xD;&#xA;&#xD;&#xA;RimuHosting installs webmin for customers who request/select it when ordering.  So we have had customers running vulnerable versions of Webmin.  On servers we have access to we have:&#xD;&#xA;- initially tried to stop webmin running on any server we have access to&#xD;&#xA;- upgraded webmin on servers that have webmin installed already&#xD;&#xA;- disabled webmin on servers that did not want to upgrade&#xD;&#xA;&#xD;&#xA;Additionally we have written this bliki entry to assist customers.  And we will shortly be emailing customers whose servers we do not have access to so that they can upgrade or stop/disable webmin.&#xD;&#xA;&#xD;&#xA;1 Stopping Webmin&#xD;&#xA;&#xD;&#xA;To stop webmin you can run the following code.  Just paste it into an ssh session while running as root.  It will stop webmin via the init script.  Else it will find/kill webmin processes.&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;if [ -e /etc/init.d/webmin ]; then&#xD;&#xA;&#xD;&#xA;/etc/init.d/webmin stop&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;webminline=$(ps auxf --width=200 | grep &apos;[m]iniserv.co&apos;)&#xD;&#xA;&#xD;&#xA;if [ ! -z &quot;$webminline&quot; ] ; then&#xD;&#xA;&#xD;&#xA;echo killing off webmin&#xD;&#xA;&#xD;&#xA;kill -9 $(echo $webminline | awk &apos;{print $2}&apos;)&#xD;&#xA;&#xD;&#xA;ps auxf --width=200 | grep &apos;[m]iniserv.co&apos;&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Upgrading Webmin&#xD;&#xA;&#xD;&#xA;To see what version of webmin you have, execute {code}cat /etc/webmin/version{code}&#xD;&#xA;&#xD;&#xA;If the version is 1.290 or newer (and webmin is not running) then just start it up with /etc/init.d/webmin start.&#xD;&#xA;&#xD;&#xA;If the version is older than 1.290 then you will need to upgrade webmin (or just not use it any more).&#xD;&#xA;&#xD;&#xA;You can upgrade webmin via the webmin UI if webmin is running.  Else run the following code:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;if which rpm 2&gt;&amp;1 &gt; /dev/null ; then&#xD;&#xA;&#xD;&#xA;mkdir -p /etc/webmin&#xD;&#xA;&#xD;&#xA;rpm -Uvfh &quot;http://apt.rimuhosting.com/webmin.rpm&quot;&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;if which dpkg 2&gt;&amp;1 &gt; /dev/null ; then&#xD;&#xA;&#xD;&#xA;wget -q &quot;http://apt.rimuhosting.com/webmin.deb&quot;&#xD;&#xA;&#xD;&#xA;dpkg -i webmin.deb&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Disabling Webmin For Good&#xD;&#xA;&#xD;&#xA;If you do not use webmin then now may be a good time to disable it to protect yourself from any future vulnerabilities.  Run this:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;if [ -e /etc/init.d/webmin ]; then&#xD;&#xA;&#xD;&#xA;echo taking care of the webmin init script&#xD;&#xA;&#xD;&#xA;which chkconfig 2&gt;&amp;1 &gt; /dev/null &amp;&amp; chkconfig --del webmin&#xD;&#xA;&#xD;&#xA;which update-rc.d 2&gt;&amp;1 &gt; /dev/null &amp;&amp; update-rc.d webmin purge&#xD;&#xA;&#xD;&#xA;/etc/init.d/webmin stop&#xD;&#xA;&#xD;&#xA;rm -rf /etc/init.d/webmin&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;webminline=$(ps auxf --width=200 | grep &apos;[m]iniserv.co&apos;)&#xD;&#xA;&#xD;&#xA;if [ ! -z &quot;$webminline&quot; ] ; then&#xD;&#xA;&#xD;&#xA;echo killing off webmin&#xD;&#xA;&#xD;&#xA;kill -9 $(echo $webminline | awk &apos;{print $2}&apos;)&#xD;&#xA;&#xD;&#xA;ps auxf --width=200 | grep &apos;[m]iniserv.co&apos;&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;if [ -e /etc/webmin ]; then&#xD;&#xA;&#xD;&#xA;mv /etc/webmin /etc/webmin.insecureversion&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Changing Passwords&#xD;&#xA;&#xD;&#xA;If you were running a non-1.290 webmin at any point after June 2006 then your passwords may have been compromised.  And other files on your server may have been viewed.&#xD;&#xA;&#xD;&#xA;You can see who has logged in recently by running last -a.&#xD;&#xA;&#xD;&#xA;You can change passwords via the passwd username command.&#xD;&#xA;&#xD;&#xA;You can see which users have passwords set by running (via ssh, as root):&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;cat /etc/shadow | grep -v --fixed-strings &apos;:!!:&apos; | grep -v --fixed-strings &apos;:*:&apos;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;The first name in each of those lines is a user that has a password set.&#xD;&#xA;&#xD;&#xA;To see what attempts have been made to exploit your webmin setup run:&#xD;&#xA;{code}&#xD;&#xA;logfile=/var/webmin/miniserv.log&#xD;&#xA;if [ -e /var/log/webmin/miniserv.log ] ; then&#xD;&#xA;logfile=/var/log/webmin/miniserv.log&#xD;&#xA;fi&#xD;&#xA;grep unauthen $logfile  | grep -v jpg | grep -v 404&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;e.g. if that command outputs something like the following then someone has attempted to access (in this example) the /etc/shadow file:&#xD;&#xA;{code}&#xD;&#xA;64.62.158.196 - - [05/Aug/2006:16:26:32 -0400] &quot;GET /unauthenticated//..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/etc/shadow HTTP/1.1&quot; 200 1634&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;The 200 bit (at the end of the line) indicates the file was found/returned OK.&#xD;&#xA;&#xD;&#xA;1 Running Webmin on LocalHost&#xD;&#xA;&#xD;&#xA;OK,  the latest version fixes the problem.  But what if there is another problem in the future.  Well, you can make it so that webmin is only accessible via ssh.  You can do this via a SSH tunnel.&#xD;&#xA;&#xD;&#xA;To setup a tunnel via SSH use:  ssh -L 10000:localhost:10000 yourserverip to ssh to the server.  If you are using Putty as your SSH client you can go to the SSH Tunnel page and add a Source port of 10000 and a Destination of localhost:10000.&#xD;&#xA;&#xD;&#xA;Now you can access webmin from your PC as https://localhost:10000/ while you have that SSH session running.&#xD;&#xA;&#xD;&#xA;Then use Webmin&apos;s Ports and Addresses to set webmin to listen only on the 127.0.0.1 IP/address.&#xD;&#xA;&#xD;&#xA;1 Webalizer module problems&#xD;&#xA;&#xD;&#xA;Is webalizer showing stats for all sites, and not the virtual host log you want it to?  Go to the modules main page, look down at the bottom of the page for the button that says &quot;Edit Global Options&quot;.  &#xD;&#xA;&#xD;&#xA;Delete the absolute path for the history and incremental files, usually just webalizer.hist and webalizer.current should appear in these boxes with no path specified.  You want to leave an absolute path for the DNS cache file, usually /var/lib/webalizer/dns_cache.db. That way all vhosts can share the cache.  &#xD;&#xA;&#xD;&#xA;Webalizer-mod docs are here:  http://doxfer.com/Webmin/WebalizerLogfileAnalysis&#xD;&#xA;&#xD;&#xA;1 Getting Help&#xD;&#xA;&#xD;&#xA;If you have any _general_ comments/suggestions/questions then these can be posted at http://forums.rimuhosting.com/forums/showthread.php?p=795#post795 . If you (are a rimuhosting customer and) need _specific_ help with anything related to this issue, please pop in a support ticket.</s:content>
        <s:mTime>2007-04-18 22:10:45.0</s:mTime>
        <s:cTime>2006-08-11 16:17:01.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux'/>
                <rdf:li rdf:resource='#knowledgebase'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/filtered webmin'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/ruby on rails'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/rimuhosting ssh access'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/ajax autocomplete'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfixadmin on debian sarge'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/moving servers'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/java/liferay install on tomcat 5.5'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/distros/ubuntu'/>
                <rdf:li rdf:resource='#domingos'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/rpm based php5.1 install'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/svn notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/vps setup on dedicated servers'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
