[TOOL] RWKG Random WEP/WPA Keys Generator

From: SecuriTeam (support_at_securiteam.com)
Date: 09/01/05

  • Next message: SecuriTeam: "[EXPL] phpLDAPadmin Command Execution (Exploit)"
    To: list@securiteam.com
    Date: 1 Sep 2005 18:32:21 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      RWKG Random WEP/WPA Keys Generator
    ------------------------------------------------------------------------

    SUMMARY

    DETAILS

    The RWKG tool can be used to generate random WEP and WPA keys.

    These randomly generated a strings of allowed ASCII characters are then
    converted to their hex format (where 5/13/16/29 characters are used to
    create 64/128/152/256 bits WEP keys, or between 8 and 63 characters
    strings to create WPA/PSK keys).

    Code:
    #!/usr/bin/perl

    ##
    # RWKG
    # Random WEP/WPA Keys Generator
    #
    # This tool generate a random string of
    # allowed ascii characters and convert it
    # to hex format (5/13/16/29 characters are
    # necessary to create 64/128/152/256 bits
    # WEP keys, 8-63 characters strings instead
    # to create WPA/PSK keys).
    #
    # Code for SecurityWireless.info proof use only.
    #
    # Legal notes :
    # BlackAngels staff refuse all responsabilities
    # for an incorrect or illegal use of this software
    # or for eventual damages to others systems.
    ##

    # Variables
    $keytype = $ARGV[ 0 ];
    $keydimension = $ARGV[ 1 ];
    $string = " !#\$\%\\&()*+,-./0123456789:;<=>?\".
    "@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[^]". "_abcdefghijklmnopqrstuvwxyz{~|}";
    @chars = split(//,$string);
    $n = @chars - 1;

    # Random WEP/WPA Keys Generator
    if ($keytype eq "WEP") {
                             if ($keydimension eq 64) { $key = generate(5); }
                             elsif ($keydimension eq 128) { $key =
    generate(13); }
                             elsif ($keydimension eq 152) { $key =
    generate(16); }
                             elsif ($keydimension eq 256) { $key =
    generate(29); }
                             else { usage(); }

                             print "\n\n[*] Generating WEP key ...\n";
                             $type = "WEP";
                           }
    elsif ($keytype eq "WPA") {
                                if ($keydimension >= 8 && $keydimension <= 63)
    {
                                                                               
      if ($keydimension <= 20) { print "\nWarning: WPA/PSK keys with a length
    of less then 20 characters, could be simply found via bruteforce attack
    .."; }
                                                                               
      $key = generate($keydimension)
                                                                               
    }
                                else { usage(); }

                                print "\n\n[*] Generating WPA/PSK key ...\n";
                                $type = "WPA/PSK";
                              }
    else { usage(); }

    $hex = unpack('H*', $key);
    print "\n[+] Random $type key";
    print "\n [-] ASCII Value -> $key";
    print "\n [-] Hex Value -> $hex\n\n";

    # Subroutines
    sub generate
    {
      my ($len) = @_;
      for ($i=0;$i<$len;$i++) {
                                $index = int(rand $n);
                                $key = $key . $chars[$index];
                              }
      return $key;
      exit(1);
    }

    sub usage
    {
      print "\nUsage :\n";
      print "perl rwkg.pl <key type> <key dimension>\n";
      print "Key types allowed: WEP, WPA\n";
      print "Key dimension WEP allowed values: 64, 128, 152, 256\n";
      print "Key dimension WPA/PSK allowed values: 8/63\n";
      print "Code for SecurityWireless.info proof use only\n\n";
      exit(1);
    }

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:admin@securitywireless.info>
    D'Amato Luigi.
    To keep updated with the tool visit the project's homepage at:
    <http://www.securitywireless.info/genwpawep.php>
    http://www.securitywireless.info/genwpawep.php

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[EXPL] phpLDAPadmin Command Execution (Exploit)"

    Relevant Pages

    • [NEWS] Bypassing Script Filters with Variable-Width Encodings
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Bypassing Script Filters with Variable-Width Encodings ... excess of 256 characters. ... Cheng doesn't think there is a typical exploitation of bypassing script ...
      (Securiteam)
    • Re: Where to put interface?
      ... > 1) You need your device dependent API which returns characters. ... Both have peculiarities (ie, arrow keys, ... > 2) You should have a second level which translates your generic ... The most common output is as you described -- displaying the map, ...
      (rec.games.roguelike.development)
    • Re: Great SWT Program
      ... failing of the GUI user-interface paradigm. ... And that probably works fine if the remote files aren't too big, ... the keys used for movement and cut, copy, paste can't even be depended ... characters and then type in the resulting number before hitting my ...
      (comp.lang.java.programmer)
    • [TOOL] GPCul8r - Group Policy Bypassing Tool
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... GPCul8r - Group Policy Bypassing Tool ... with normal editing of these registry keys. ...
      (Securiteam)
    • Getting the correct size of a glyph in a font
      ... the text for the differing keys. ... however I found that those characters which have a descent ... GLYPHMETRICS and use the origin and its blackboxy, ...
      (microsoft.public.win32.programmer.gdi)