<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="https://uname.pingveno.net/blog/index.php/feed/rss2/xslt" ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title># uname -a - Mot-clé - hack</title>
    <link>https://uname.pingveno.net/blog/index.php/</link>
    <atom:link href="https://uname.pingveno.net/blog/index.php/feed/tag/hack/rss2" rel="self" type="application/rss+xml" />
    <description>Le blog de uname.pingveno.net</description>
    <language>fr</language>
    <pubDate>Tue, 18 Aug 2026 13:46:21 +0200</pubDate>
    <copyright>Mathieu Pellegrin</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>Dotclear</generator>
          <item>
        <title>About ToBeHost : the last of my student's projects</title>
        <link>https://uname.pingveno.net/blog/index.php/post/2015/09/24/About-ToBeHost-%3A-the-last-of-my-student-s-projects</link>
        <guid isPermaLink="false">urn:md5:1e13d19d1de92f79d00916da194c7137</guid>
        <pubDate>Thu, 01 Oct 2015 23:55:00 +0200</pubDate>
        <dc:creator>Mathieu</dc:creator>
                  <category>My Life</category>
                          <category>debian</category>
                  <category>drupal</category>
                  <category>hack</category>
                  <category>puppet</category>
                  <category>serie-hosting-panel-drupal-puppet</category>
                  <category>tobehost</category>
                  <category>vhffs</category>
                <description>&lt;p&gt;Hello there, this is not your ordinary reading on this blog. This post is a sort of introduction for a series of posts about the making of a free web hosting provider, implementing a web panel from scratch using &lt;a href=&quot;https://www.drupal.org/&quot;&gt;Drupal&lt;/a&gt; for front-end and &lt;a href=&quot;https://puppetlabs.com/&quot;&gt;Puppet&lt;/a&gt; as back-end.&lt;/p&gt;&lt;p&gt;But first, let me introduce you the reason why we started the project. I said &amp;#8220;we&amp;#8221; because I am not the only one in the boat, but it&amp;#8217;s me who will make all the technical choices, and implement it. I am also the one who was saying &amp;#8220;give up&amp;#8221; to my colleague a few months ago, before going back with this new and exciting crazy idea.&lt;/p&gt;          &lt;h3&gt;Genesis&lt;/h3&gt;&lt;p&gt;&lt;a href=&quot;http://www.tobehost.net/&quot;&gt;ToBeHost&lt;/a&gt; is a project we started around 2008~2009. Before that, I was an active member at a free hosting provider (&amp;#8220;Chez Mémé .net&amp;#8221;). When this hosting provider closed, due to the lack of time from its founders, me and a friend I met on this hosting provider stated that we had both the technical and time resources to make our own hosting provider. It was just loaning a dedicated server and configuring all the stuff you need to have your site working. We were not experts (yet), but be were confident in the fact that we had the capacities to learn, and to make it working. This is also the moment where I started &lt;a href=&quot;http://www.catb.org/esr/faqs/hacker-howto.html&quot;&gt;hacking&lt;/a&gt; on GNU/Linux&lt;/p&gt;&lt;p&gt;We tried several web panels. Between love and hate, we finally choose &lt;a href=&quot;http://www.vhffs.org&quot;&gt;VHFFS&lt;/a&gt;. VHFFS is a great piece of software. For the kiddie I was, it was the sort of &amp;#8220;perfect-even-scary&amp;#8221; piece of Linux engineering. Because mass web hosting involves dealing with a lot of &amp;#8220;subsystems&amp;#8221; to make it work, what VHFFS was doing was simply amazing to me. Using &lt;em&gt;libnss&lt;/em&gt; and &lt;em&gt;nscd&lt;/em&gt; to make system user from a database was for me the cleverest way to make system users without having to deal with system commands. Using unix permissions and system users and groups instead of hacky chroots, safe_mode, and open_basedir was definitely feeling right to me. I learned a lot about Linux and Debian, and my first (and actually unique) &lt;a href=&quot;http://listengine.tuxfamily.org/vhffs.org/vhffs-dev/2011/07/msg00025.html&quot;&gt;contributed patch&lt;/a&gt; made me feel so proud of me.&lt;/p&gt;&lt;h3&gt;The long love (and hate) story&lt;/h3&gt;&lt;p&gt;Dealing with a single server, on a student time, was not complicated. When something went wrong, I was looking for the answer by myself because I was (and I am still) afraid of what people can think or say to me on a public IRC channel. We had some downtimes, and a few fears while restoring backups, but things were globally going well.&lt;/p&gt;&lt;p&gt;Some things were a little bit cumbersome, but I was thinking that it was part of the job. Re-compiling PureFTPD ans MySQL package at each upgrade was not actually a problem, because I was eager to learn how to patch, compile, and hack into Debian. I even &lt;a href=&quot;http://uname.pingveno.net/wiki/wiki.php/Vhffs_Nss&quot;&gt;rewrote the SQL queries when we upgraded to Debian Lenny&lt;/a&gt;, which was using libnss2.&lt;/p&gt;&lt;p&gt;The years passed, I was growing and becoming older (hey, don&amp;#8217;t laugh). My years at university was taking much and much time over my &amp;#8220;internet time&amp;#8221;, as I was getting involved in the students&amp;#8217; association and my final exams were approaching. Finally, the project was in an informal standby, we decided that we had to close it, because we were both very busy elsewhere.&lt;/p&gt;&lt;p&gt;We officially closed. We sent the mail to users, I was ready to backup my configuration files and delete the data. We didn&amp;#8217;t do it. Because of our sloppy feelings, and the fact that &amp;#8220;it worked&amp;#8221;, without &amp;#8220;touching anything&amp;#8221;. It was such a pity to let it go.&lt;/p&gt;&lt;h3&gt;The last breath (or not)&lt;/h3&gt;&lt;p&gt;Some months ago, we realized it had been several years that the project was officially dead. I didn&amp;#8217;t stop hacking Linux. I had left my full-time job because I was working too much on projects I didn&amp;#8217;t like (&lt;a class=&quot;ref-post&quot; href=&quot;https://uname.pingveno.net/blog/index.php/post/2013/02/01/Pourquoi-j-ai-chang%C3%A9-de-job&quot;&gt;and some other reasons&lt;/a&gt;), and was running a freelance activity. My colleague was running &lt;a href=&quot;http://hawaii.do/&quot;&gt;a successful IT company&lt;/a&gt; with his associates, and we were working together on some professional projects (we still are).&lt;/p&gt;&lt;p&gt;New tools and software have appeared since my last glance to ToBeHost, and I also learned how to use new tools. I asked my colleague to let the project go, but we finally paid another month for the server.&lt;/p&gt;&lt;p&gt;And then, I thought: web hosting is actually what I am into at that time. I know how to do it the right way, with the smallest administration effort. None of the alternative panels was fitting as well as VHFFS for the work we wanted. Let&amp;#8217;s take all the VHFFS goods (strictly unix permissions, not be afraid of user access to shell, trust user isolation and quota), and add some bullshit (PHP panel, made on top of a CMS), with a little bit of magic (Puppet automation). Let&amp;#8217;s put it together, and see what is coming from it.&lt;/p&gt;&lt;p&gt;Voilà. This is how this project started.&lt;/p&gt;&lt;h3&gt;Addendum&lt;/h3&gt;&lt;p&gt;The project started, and it is pratically ready for beta-test. I will try to write that series of posts and explain how we made it, in order to inspire other people, and to help me keep my ideas clear.&lt;/p&gt;&lt;p&gt;As you may think, it is and it will be &lt;strong&gt;highly experimental&lt;/strong&gt;. I don&amp;#8217;t know if the growing of Puppet objects will be sustainable in the long term. I don&amp;#8217;t know if Drupal will drive me crazy to the point I would rage delete my code. I don&amp;#8217;t know if the whole project will be clean enough to release it opensource. But we will &lt;strong&gt;try&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.tobehost.net/nous-contacter/&quot;&gt;Wanna join&lt;/a&gt;&amp;#160;?&lt;/p&gt;</description>
        
              </item>
          <item>
        <title>GetSimple: URL index/something returns 404</title>
        <link>https://uname.pingveno.net/blog/index.php/post/2014/02/03/GetSimple-CMS-%3A-URL-index/something-returns-404</link>
        <guid isPermaLink="false">urn:md5:3639ea02711bb850d0f9a7555f29761c</guid>
        <pubDate>Mon, 03 Feb 2014 11:25:00 +0100</pubDate>
        <dc:creator>Mathieu</dc:creator>
                  <category>Hacks</category>
                          <category>apache</category>
                  <category>bug</category>
                  <category>GetSimple</category>
                  <category>hack</category>
                  <category>htaccess</category>
                  <category>multiviews</category>
                  <category>rewrite</category>
                <description>          &lt;h3&gt;Problem&lt;/h3&gt;
&lt;p&gt;While using &lt;strong&gt;GetSimple&lt;/strong&gt; with &lt;strong&gt;FancyURLs&lt;/strong&gt; (Apache Rewrite), every menu item nested under the home page returned a 404.&lt;/p&gt;
&lt;p&gt;The (rewritted) URL of the home page is &lt;strong&gt;/index&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The sub-pages URLs are rendered as &lt;strong&gt;index/something&lt;/strong&gt;, and triggered a 404 error.&lt;/p&gt;
&lt;h3&gt;Solution&lt;/h3&gt;
&lt;p&gt;Disable &lt;strong&gt;MultiViews&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;MultiViews is an Apache mechanism for automatically switching wich document is sent to the user, based on the &lt;code&gt;Accept&lt;/code&gt; header. Because the front controller is named &lt;code&gt;index.php&lt;/code&gt;, MultiViews was trying to reach &lt;code&gt;index.php/something&lt;/code&gt; instead of (as specified in RewriteRules) &lt;code&gt;index.php?id=index/something&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;How to do it&lt;/h3&gt;
&lt;p&gt;Open the GetSimple &lt;strong&gt;.htaccess&lt;/strong&gt; file, and locate&amp;#160;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;code&gt;Options -Indexes&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Change to&amp;#160;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;code&gt;Options -Indexes -MultiViews&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://get-simple.info/forums/showthread.php?tid=5223&quot; hreflang=&quot;en&quot;&gt;http://get-simple.info/forums/showthread.php?tid=5223&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
        
              </item>
          <item>
        <title>Cinq étapes pour créer un cheval de troie sous GNU/Linux</title>
        <link>https://uname.pingveno.net/blog/index.php/post/2013/11/05/Cinq-%C3%A9tapes-pour-cr%C3%A9er-un-cheval-de-troie-sous-GNU/Linux</link>
        <guid isPermaLink="false">urn:md5:c96473c59ab8571ccfdcb5f9dc6e3ab4</guid>
        <pubDate>Tue, 05 Nov 2013 23:41:00 +0100</pubDate>
        <dc:creator>Mathieu</dc:creator>
                  <category>Hacks</category>
                          <category>hack</category>
                  <category>linux</category>
                  <category>trojan</category>
                <description>          &lt;p&gt;Contrairement à ce qu'on dit, créer des logiciels malveillants sous Linux est d'une simplicité enfantine. La sécurité d'un système ne repose pas sur le nombre de barrière qu'il peut vous placer mais sur la capacité des utilisateurs à avoir du recul sur leur machine.&lt;/p&gt;

&lt;p&gt;Voici donc les cinq étapes pour créer un petit cheval de troie sur Linux. Rien d'exceptionnel, beaucoup d'autres l'ont fait avant moi, cet article est entièrement à but pédagogique.&lt;/p&gt;

&lt;h3&gt;1. Installation&lt;/h3&gt;

&lt;div style=&quot;float: right; margin: 0 0 1em 1em;&quot;&gt;&lt;img alt=&quot;xkcd_authorization.png&quot; src=&quot;https://uname.pingveno.net/blog/public/posts_thumb/xkcd_authorization.png&quot; title=&quot;xkcd_authorization.png, déc. 2013&quot; /&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;&lt;a href=&quot;http://xkcd.com/1200/&quot;&gt;Source de l'image&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;C'est sans doute sur ce point que l'on pourrait imaginer les systèmes Linux plus fiables que les systèmes Windows : dans la plupart des cas les logiciels malveillant sous Linux sont installés par l'utilisateur, et non à son insu. Pas beaucoup de possibilités pour injecter dans des 0day présents sur des programmes Linux, ils sont rapidement patchés. Quoique.&lt;/p&gt;

&lt;p&gt;Non, l'installation viendra certainement de l'utilisateur. On l'aidera un peu ceci dit. Le type d'installation déterminera le champ d'action et la capacité de dissimulation du &lt;code&gt;trojan&lt;/code&gt;. Même si on ne peut pas vraiment parler de rootkit pour un programme lancé en zone utilisateur, on peut faire un excellent cheval de troie ou un &lt;code&gt;keylogger&lt;/code&gt; sympa avec de simples privilèges utilisateur.&lt;/p&gt;

&lt;p&gt;Que vous prêtiez votre session l'espace de dix minutes ou que vous cliquiez benoîtement sur un joli fichier-image-qui-en-est-pas-un, le résultat sera plus ou moins le même : le programme s'installera, première étape franchie.&lt;/p&gt;

&lt;p&gt;Où il s'installera ? Ça dépend. S'il est &lt;code&gt;root&lt;/code&gt;, le programme prendra ses aises dans les coin reculés de &lt;code&gt;/proc&lt;/code&gt; ou &lt;code&gt;/lib&lt;/code&gt;, là où vous n'irez pas le chercher. S'il est utilisateur, il se chargera quelque part dans un &lt;code&gt;.machinchose&lt;/code&gt;, les fichiers cachés présents dans votre dossier utilisateur.&lt;/p&gt;

&lt;h3&gt;2. Démarrage&lt;/h3&gt;

&lt;p&gt;Avoir un fichier malveillant sur son ordinateur (à des fins purement scientifiques), ça arrive à tout le monde. Mais que celui-ci devienne létal en se lançant avec votre session, ça c'est une autre affaire. Comme sous Windows, il n'y a aucune difficulté à lancer un programme avec la session ou dans les services.&lt;/p&gt;

&lt;p&gt;Pour les services, un petit patch dans &lt;code&gt;/etc/rc.d/&lt;/code&gt; ou &lt;code&gt;/etc/rc.local&lt;/code&gt; et vous êtes partis pour la rigolade.&lt;/p&gt;

&lt;p&gt;Pour les programmes utilisateur, une petite retouche dans &lt;code&gt;.xsessionrc&lt;/code&gt;, le &lt;code&gt;.login&lt;/code&gt;, ou le fichier de démarrage de votre environnement (gnome, kde, etc) fera amplement l'affaire.&lt;/p&gt;

&lt;h3&gt;3. Dissimulation&lt;/h3&gt;

&lt;p&gt;Un trojan, si on le trouve&amp;nbsp; c'est pas drôle, alors il faut le cacher un peu. Les fichiers cachés c'est bien pour un utilisateur lambda, mais pour un administrateur système il faudra trouver mieux. Quoique.&lt;/p&gt;

&lt;p&gt;Les programmes qui se dissimulent le mieux sont des programmes qui se sont installés en root. Forcément, pour ce genre de programme, patcher le noyau pour se rendre invisible, modifier la commande &quot;top&quot; ou recompiler et installer ses propres paquets patchés est l'enfance de l'art, mais un programme utilisateur peut lui aussi installer sa petite mécanique secrète.&lt;/p&gt;

&lt;p&gt;Par exemple, il peut modifier le &lt;code&gt;PATH&lt;/code&gt; de l'utilisateur pour remplacer les programmes systèmes par les siens (genre ps, top, ou les outils de diagnostique réseau), trafiquant alors les sorties des programmes légitimes pour se rendre invisible.&lt;/p&gt;

&lt;h3&gt;4. Collecte d'informations&lt;/h3&gt;

&lt;p&gt;Là on pourrait penser que le système le plus sécurisé du monde empêche les application illégitimes de collecter des informations. En fait non.&lt;/p&gt;

&lt;p&gt;Si vous êtes root, vous avez de toute façon accès à toutes les entrées et sorties que vous voulez.&lt;/p&gt;

&lt;p&gt;Si vous êtes un programme utilisateur, vous avez accès aux informations que l'utilisateur soumet, ce qui et déjà largement suffisant pour lui voler ses mots de passe. Outre aller farfouiller dans les &lt;code&gt;.config&lt;/code&gt; et les &lt;code&gt;.mozilla,&lt;/code&gt; le gentil programme peut aussi profiter du mécanisme vieillissant fourni par le serveur graphique X, et capturer n'importe quelle frappe de touche en silence (&lt;a href=&quot;http://neosting.net/un-keylogger-en-natif-sous-linux-via-x11&quot; hreflang=&quot;fr&quot;&gt;si&lt;/a&gt;, &lt;a href=&quot;http://code.google.com/p/logkeys/&quot;&gt;si&lt;/a&gt;...).&lt;/p&gt;

&lt;h3&gt;5. Communication avec l'extérieur&lt;/h3&gt;

&lt;p&gt;Créer un tunnel réseau sous Linux est enfantin en utilisant un langage de haut niveau comme Python. Pour les autres, quelques &lt;code&gt;read&lt;/code&gt; avec des &lt;code&gt;socket&lt;/code&gt; fera amplement l'affaire. Le point délicat ici est le chiffrement. C'est toujours délicat d'implémenter une couche SSL sur les programmes. Une alternative est l'alternance entre un &lt;a href=&quot;http://fr.wikipedia.org/wiki/Masque_jetable&quot;&gt;masque jetable&lt;/a&gt; et un décalage de bits, chacun d'une taille suffisante pour tromper le newbie qui snifferait des trames réseau à la recherche de ce qui fuite.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;La création de programmes malveillant sous GNU/Linux est accessible à un élève de seconde année de licence Informatique, c'est à dire pratiquement n'importe qui. N'oubliez pas que ce que vous pouvez faire sur votre ordinateur, n'importe quel programme qui s'exécute avec vos droits d’utilisateur peut lui aussi le faire (skype ?).&lt;/p&gt;</description>
        
              </item>
          <item>
        <title>Touche pas à mon shell !</title>
        <link>https://uname.pingveno.net/blog/index.php/post/2011/03/23/Touche-pas-%C3%A0-mon-shell-%21</link>
        <guid isPermaLink="false">urn:md5:59fad771b6ba5fc0019b8eceeadf4c94</guid>
        <pubDate>Wed, 23 Mar 2011 13:17:00 +0100</pubDate>
        <dc:creator>Mathieu</dc:creator>
                  <category>Hacks</category>
                          <category>bash</category>
                  <category>bashrc</category>
                  <category>compilation</category>
                  <category>hack</category>
                <description>          &lt;p&gt;Il y a quelque chose qui m&amp;#8217;a énervé dès le début de l&amp;#8217;année sur les machines qu&amp;#8217;on utilise en TP, et ça a continué en pire jusqu&amp;#8217;à aujourd&amp;#8217;hui. Ce court billet va donc expliquer pourquoi j&amp;#8217;ai été amené à compiler mon propre shell, et comment le faire.&lt;/p&gt;
&lt;p&gt;Petit rappel des faits&amp;#160;: au début de l&amp;#8217;année une ligne dans notre .bashrc personnel lançait le navigateur à chaque nouveau terminal, oui vous avez bien entendu, à chaque nouveau terminal le navigateur se lançait. Ceci pour rappeler les règles élémentaires de respect des salles, etc.&lt;/p&gt;
&lt;p&gt;Ceci dit, lancer un programme graphique en même temps qu&amp;#8217;un terminal, c&amp;#8217;est stupide, surtout quand comme moi on lance plusieurs terminaux et qu&amp;#8217;on se retrouve avec plusieurs firefox d&amp;#8217;ouverts par la même occasion, ça devient profondément pénible. Une petite modification du bashrc plus tard, cette fonctionnalité ubuesque avait disparue.&lt;/p&gt;
&lt;p&gt;Mais, il y a quelques jours l&amp;#8217;administrateur système a placé la ligne en question dans le bashrc global (&lt;code&gt;/etc/bash.bashrc&lt;/code&gt;), ce qui signifie qu&amp;#8217;il n&amp;#8217;était plus possible de le désactiver, à moins de recompiler le bash. C&amp;#8217;est donc ce que j&amp;#8217;ai fait.&lt;/p&gt;
&lt;p&gt;Pour recompiler le bash, il vous faut&amp;#160;:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;La libc standard&lt;/li&gt;
&lt;li&gt;yacc ou &lt;a hreflang=&quot;fr&quot; href=&quot;http://packages.debian.org/bison&quot;&gt;bison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Le code source de bash&amp;#160;: &lt;a hreflang=&quot;en&quot; href=&quot;http://ftp.gnu.org/gnu/bash/&quot;&gt;http://ftp.gnu.org/gnu/bash/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ensuite c&amp;#8217;est comme d&amp;#8217;habitude&amp;#160;: &lt;code&gt;./configure &amp;amp;&amp;amp; make&lt;/code&gt; et puis voilà.&lt;/p&gt;
&lt;p&gt;Les plus attentifs auront remarqué que je n&amp;#8217;indique pas de modification de code source à réaliser pour désactiver l&amp;#8217;appel au bashrc global, ce qui était le but de la manoeuvre. Ceci tout simplement parce que cet appel est désactivé par défaut dans le code fournit par GNU, le paquet Debian étant donc une version légèrement différente de l&amp;#8217;originale au niveau du code source, en fait ils ont juste décommenté la ligne contenant &lt;code&gt;#define SYS_BASHRC &quot;/etc/bash.bashrc&quot;&lt;/code&gt; du fichier &lt;code&gt;config-top.h&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Enfin, une petite formalité, il faut expliquer à gnome-terimnal de lancer notre shell plutôt que le shell par défaut, cela se fait simplement en appelant gnome-terminal avec l&amp;#8217;argument -e&amp;#160;: &lt;code&gt;gnome-terminal -e chemin_vers_le_bash&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Enjoy&amp;#160;! &lt;img src=&quot;/blog/themes/mathedit_material3/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot;&gt;&lt;/p&gt;</description>
        
              </item>
      </channel>
</rss>
