Dark:

ASX

VaporCrack: Cracking hash has never been so easy

Written on 2024-11-02

Resume

How does a hash cracker work? This is the question I asked myself after several uses of well-known tools such as JTR (John the Ripper) or Hashcat. Supporter of the C language, here is my second program in C, a hash cracker and let’s discover how this kind of tools works under the hood.

Description

  • Identify supported hashes
  • Support more than 10 hashes algorithms
  • Brute mode (cook combinations of characters)
  • Dictionary mode (handle wordlists)
  • Timer integrated
  • Challenge

  • Brute force recursive function
  • Implementing the hashing algorithms (MD5, SHA1, etc)
  • Combinatory mode (reading two wordlists at the same time)
  • You can install the tool from there: VaporCrack

    Demo

    Main

    It will be shown here the different types of attacks and each attack will have its explanation and demo.

    Identify

    The first mode is the most important, it is that of identification. The tool will therefore compare the hash sizes and give proposals of the corresponding algorithm.

    asx@cortex:~$ VaporCrack -i hash

      _                                                              
    - - _-                            ,- _~.                  ,,   
      )-  )   _                      (' /|           _        ||   
      )___)  < \, -_-_   /'\\ ,._-_ ((  ||   ,._-_  < \,  _-_ ||/\ 
     ~)___)  /-|| || \\ || ||  ||   ((  ||    ||    /-|| ||   ||_< 
      )  )  (( || || || || ||  ||    ( / |    ||   (( || ||   || | 
     /-_/    \/\\ ||-'  \\,/   \\,    -____-  \\,   \/\\ \\,/ \\,\
                  |/                                                 
                  '                                                 
                                                                                                        
                                        
    |> Starting VaporCrack...
    |> Mode: identify
    |> Analyzing...
    |=> sha512
    |=> blake2b
    |=> whirlpool
    |> Finished
                                    

    In the command output we can see that it has identified three possibilities: sha512, blake2b and whirlpool.

    Dictionary

    During a password cracking you can apply different attacks. The most common is the dictionary attack.

    A hash cracker tool, take a password, hash it with the alorithm asked. It do the same thing for words in the given dictionary. It then compares the two hashes and looks if they are the same. Finally if there are siblings, the cracked password is the word who was hashed.

    asx@cortex:~$ VaporCrack -d -a blake2b hash Downloads/rockyou.txt

      _                                                              
    - - _-                            ,- _~.                  ,,   
      )-  )   _                      (' /|           _        ||   
      )___)  < \, -_-_   /'\\ ,._-_ ((  ||   ,._-_  < \,  _-_ ||/\ 
     ~)___)  /-|| || \\ || ||  ||   ((  ||    ||    /-|| ||   ||_< 
      )  )  (( || || || || ||  ||    ( / |    ||   (( || ||   || | 
     /-_/    \/\\ ||-'  \\,/   \\,    -____-  \\,   \/\\ \\,/ \\,\
                  |/                                                 
                  '                                                 
                                                                    
    
    |> Starting VaporCrack...
    |> Mode: dictionary
    |> Algorithm: blake2b
    |> Cracking...
    |>================CRACKED================<|
    |                                         |
    |> madison
    |                                         |
    |>================CRACKED================<|
    |> Finished
                                    

    We must supply the mode, the algorithm, the hash and the wordlist.

    Bruteforce

    The brute force mode was the most complex to implement because it had to use recursion and all possible combinations. This mode will try all the existing combinations starting from a to z then aa to zz going through the numbers the special carracteres and all possible existing ones.

    asx@cortex:~$ VaporCrack -b -a blake2s hash full

      _                                                              
    - - _-                            ,- _~.                  ,,   
      )-  )   _                      (' /|           _        ||   
      )___)  < \, -_-_   /'\\ ,._-_ ((  ||   ,._-_  < \,  _-_ ||/\ 
     ~)___)  /-|| || \\ || ||  ||   ((  ||    ||    /-|| ||   ||_< 
      )  )  (( || || || || ||  ||    ( / |    ||   (( || ||   || | 
     /-_/    \/\\ ||-'  \\,/   \\,    -____-  \\,   \/\\ \\,/ \\,\
                  |/                                                 
                  '                                                 
                                                                    
    
    |> Starting VaporCrack...
    |> Mode: brute
    |> Algorithm: blake2s
    |> Cook: full
    |> Cracking...
    |>================CRACKED================<|
    |                                         |
    |> p@$!
    |                                         |
    |>================CRACKED================<|
    |> Finished
                                    

    Combinatory

    The last mode: combinatory mode, crack the hash by using two wordlists.

    asx@cortex:~$ VaporCrack -c -a ntlm hash Downloads/rockyou.txt Downloads/rockyou.txt

      _                                                              
    - - _-                            ,- _~.                  ,,   
      )-  )   _                      (' /|           _        ||   
      )___)  < \, -_-_   /'\\ ,._-_ ((  ||   ,._-_  < \,  _-_ ||/\ 
     ~)___)  /-|| || \\ || ||  ||   ((  ||    ||    /-|| ||   ||_< 
      )  )  (( || || || || ||  ||    ( / |    ||   (( || ||   || | 
     /-_/    \/\\ ||-'  \\,/   \\,    -____-  \\,   \/\\ \\,/ \\,\
                  |/                                                 
                  '                                                 
                                                                    
    
    |> Starting VaporCrack...
    |> Mode: combinator
    |> Algorithm: ntlm
    |> Cracking...
    |>================CRACKED================<|
    |                                         |
    |> iloveyousunshine!!
    |                                         |
    |>================CRACKED================<|
    |> Finished
                                    

    Testing

    Here are some hash for fun. Try it yourself!

    Dictionary

    21a245a80db0854f82a3c04482582cce2105e38922036aa2cdb8fd651773cb80
                                    

    Bruteforce

    Hint: PIN

    79008f02e219db72b0e819cc1abb56f12f45f19a
                                    

    Combinatory

    Hint: 1/2

    fd20e9a7b3fa451a
                                    

    Notes

    VaporCrack is obviously a simple hash cracker without GPU optimization or multi-threading or with tons of options because it’s not my main goal to make the new hash cracker 2.0. But here is a basic and especially functional tool to add in the toolbox who allow you to crack quickly the hash.

    Conclusion

    Having surfed the main aspects and functionalities of this tool, it is now easy to understand how a hash cracker works and how to develop a custom. Here is another project that could be ended to infinity by adding all the possible hash formats, all the existing attacks and optimizing endlessly. The basic being crafted it is not necessary to do more. Some optimized tools are available as discussed above and its now time to move to more complex tooling or program.

    Cryptography

    C

    Programming

    Tools

    Hash Cracking

    CounterByte: Cool electronic counting device

    Written on 2024-10-29

    Resume

    This is unfortunately not a tutorial to teach you to create prototypes of ideas in electronics but more an overview with some keys steps that allowed the build of this cool gadget. My idea came because I wanted an electronic device capable after a while to turn on, to start a light, a sound, a computer.

    Especially since to take a break on screen, when I do electronics it is always without programming the chips. So these are chips with integrated factory program. I don’t do Arduino, and programmable chips currently though having played with some STM32.

    Paper preparation schemes, prototyping on a breadboard, circuit adaptability to perfboard, welding, and debugging will be discussed.

    Steps

  • The idea
  • The scheme
  • The prototype
  • The device
  • Material

    General

  • Pen and paper
  • Breadboards
  • Perfboards
  • Battery
  • Multimetter
  • Soldering iron
  • Components

  • 7 segment display
  • Counter 4026B
  • 555 timer
  • Switch button
  • LEDs
  • Passive buzzer
  • Resistors
  • Capacitors
  • Transistors
  • Dip socket
  • And more!
  • The necessary matetial for this project

    The idea

    The idea is to create a gadget allowing us to count from 0 to 9, it will need a counter (e.g. 555 timer), a display 7 segments and make an oscillator. For the control of the 7 seg display one can use the counter CD4026B. Several LEDs and a passive buzzer will be necessary to display the status of the counter (ready - finished).

    The scheme

    So here is the first schema of the 7 segment display and timer 555 as well as that of the counter 4026B are really these three chips that allow the whole system.

    As previously mentioned, we won't go into specifics because we're not in a tutorial but rather a demo. Here is the general schema. The 4026B counter is responsible for controlling the 7 segment display. In the second part of the schematic, we have two 555 chips that will work in astable mode to produce an oscillation that will be transmitted to the 4026B, resulting in a clock frequency that allows for the display of figures on the 7-segment display. Additionally, one of the 555 will be governed in monostable mode, which will permit impulsion after a specific amount of time. By placing a transistor in NOT gate mode, we can reverse this impulse. The LED will be activated first and turn off at the end of the countdown. A second LED will be lit when the first one turns off, indicating when the counter is ready to be used. The first LED will indicate when the counter is ready to be used, and the second LED will indicate when the countdown has finished by staying on. Finally, a characteristic TIC-TAC sound (yes it's fun) will be produced by setting a passive buzzer to the clock frequency.

    The prototype

    Now it’s time to put all this on a breadboard. Not evident to make everything hold. We can spread on 2 breadboards and then compact the circuit on one.

    The prototype fit in one breadborad. But additional components are required to make the second LED blink in rythm with the timer.

    Let's extend the prototype.

    Zooming the circuit

    I came with a smaller one prototype who was ultra compacted.

    After many debugging everything seems ready. Time to test the system.

    The circuit works well but now we face another difficulty putting all in a single perfboard. Perfboard are really small 4*6 cm (1.57 * 2.36 inch).

    The device

    The challenge of fitting everything onto a single small size perforated board.

    I initially considered adding another one to the side. But unfortunately it would have led to a gadget too cumbersome and not practical.

    That's where I first thought of putting down the performance boards. On the first floor, you can find the timer part of the circuit with its two 555s. The circuit's second stage is all about the display, with a 7-second display, counter 4026B, LEDs, and buzzer. This will be useful when we will do a box for this gadget. The logic part below and the display part above. The display can be placed in the appropriate spot.

    The last step was to solder all of this. And this was not a part of pleasure. But this give this awesome gadget.

    From a practical point of view it is important to leave the spacers open before compacting everything. Otherwise if an error is found during the debugging phase it will be necessary to redo everything.

    After many hours of endless debugging with the multimetter, the gadget is ready and can be compact and closed.

    We can observe the many connections leading quickly to confusion. It is therefore better to move on to a PCB model.

    The final device is now ready for testing!

    Let's start the counter.

    And in the night for a better feeling!

    That’s how magical it is to understand the pre-programmed chips and use them in a circuit. No need to program anything. It is possible to take a break away from the screens while practicing a passion.

    Notes

    For a first program, it was quite difficult due to the reasons cited in the challenge.

    The offset depends on the power of the current source. With new (more powerful) batteries the counter will go faster and therefore overflows on the timer. I learned it on the fact. Whereas with used batteries the counter counts perfectly because less current and slower circuit. Finally set to 9V or 5V DCC the counter counts once and turns off!

    Conclusion

    This concludes this overview of counterByte a nice trigger counter. To improve it there is a way to add a trigger at the end of the counter and even redo the whole circuit on PCB in order to fit it into a box. For a first circuit I’m quite delighted with the result. Although very difficult to obtain, the road was not easy.

    Electronics

    Chips

    Prototype

    Soldering

    PacGame: A game directly in your terminal

    Written on 2024-10-18

    Resume

    Several years ago, I was bored during various tasks under Linux during some loads or installations, and this is what led me to the idea of having a game directly in the terminal. So I started my first program in C.

    Challenge

  • The map
  • No-blocking keystrokes from Linux
  • Pacman dynamic display
  • Automatic pacman moving
  • You can install the game from there: PacGame

    Demo

    Notes

    For a first program, it was quite difficult due to the reasons cited in the challenge.

    The first difficulty was to see where pacman is and determine the prohibited areas and how to prevent him from crossing them. To do this I used a system of 0 and 1 to compare its position quickly.

    Then came a difficulty of having non-blocking keyboard keys on Linux. Which made me use the ncurses library. The problem is that with ncurses there is fast garbage in the terminal. It was therefore necessary to use certain screen cleaning functions in the library while maintaining the current elements.

    Now we were facing a problem of making pacman dynamic and make the movement fluid. What could be realized using certain timing and some functions of cooling the terminal.

    The final problem was to be able to put pacman in automatic movement after a pressed key. But in doing ca it remained blocked against the wall without being able to enter other keys of keyboard. One has to use non-blocking functions.

    Conclusion

    Although challenging for a first program we are quite happy with the result that allows us to play a little in the terminal waiting for a load or an installation.

    I still prefer to keep a less attractive version but on full terminal rather than dev with GTK or SDL because I found it more fun to have it directly in the terminal.

    Finally, you can observe a function before managing the ghosts that is not used. This is because unfortunately at the time I was simply not able to use multi-threading effectively and the implementation of fantomes came into conflict with the refresh of the screen for pacman.

    There will be some improvements to the game later. There will be some improvements to the game later. This program allowed me to get acquainted with C libraries and have a different logic.

    Gaming

    C

    Programming

    Custom