Results 1 to 10 of 14

Thread: aircrack-ng-cuda + WPA(2)-PSK hacking with backtrack 4beta

Hybrid View

  1. #1
    Senior Member fnord0's Avatar
    Join Date
    Jul 2008
    Posts
    144

    Post aircrack-ng-cuda + WPA(2)-PSK hacking with backtrack 4beta

    my first HOWTO for this site (which this site I so love, thanks for everything backtrack team!! im loving the bt4beta, but sad about switch to ubuntu - make no mistake about it, I think this is a amazing distro! i am running it as my main distro on my linux partition, for all sorts of learning and lab testing! bravo... one question: is there ever going to be a backtrack based off slackware/slax again? x fingers crossed x)

    don't be cruel, spelling is not my forte'. *use these directions at yr own risk, only for information, test on yr OWN hardware*

    the speed-up afforded by an nvidia GTX 285 compared to a Q6600 overclocked intel proc is quite satisfying to say the least

    lets get on with things. download the latest version of aircrack-ng-cuda via SVN/subversion (btw, I love the name of this tool!).
    the default BT4beta off the DVD will NOT compile aircrack-ng-cuda properly - you need to make some changes to the system, which I will be detailing here. ::

    cd /usr/local/src [[ or whatever temp directory you want to use ]]
    svn co svn - Revision 1578: /branch/aircrack-ng-cuda aircrack-ng-cuda
    [[ the version I checked out was = resvision 1558 ]]
    you now have a new directory called "aircrack-ng-cuda" in your "temp" directory, which we will be working with shortly...

    onto CUDA, and all pre-req's. reviewing the README.CUDA file, we find out the following ::

    Quick Notes for the CUDA version of aircrack-ng:
    -> Only works with wpa cracking
    -> Tested on a 1.0 Compute Card using CUDA_SDK 2.2 (LINUX)
    -> No SLI Support as yet (I have no way of testing currently)

    Preq:
    -> CUDA SDK 2.2 Installed with ENV vars (see cuda install guide for more details)
    * PATH to contain /usr/local/cuda/bin
    * LD_LIBRARY_PATH to contain /usr/local/cuda/cudaprof/bin:/usr/local/cuda/lib
    * CUDA_INSTALL_PATH to contain /usr/local/cuda
    (or where ever you installed it)

    Building CUDA aircrack-ng:
    make clean
    CUDA=true make
    easy enough, just follow the above to the T and building aircrack-ng-cuda will be a breeze (almost... for my computer at least).

    here we go - line by line...
    -> CUDA SDK 2.2 Installed with ENV vars
    get CUDA SDK 2.2 from... who else? nvidia @ Download CUDA Code - complete and free toolkit for creating derivative works

    from there CUDA download page, we see the following ::
    NVIDIA’s CUDA development tools provide three key components to help you get started: the latest CUDA driver, a complete CUDA Toolkit, and CUDA SDK code samples.

    Please download files and install them in this order:

    1. CUDA Driver 2. CUDA Toolkit 3. CUDA SDK code samples
    so, do as they say (I think #3 can be held off on... I wasn't able to get much in package #3 to compile, but I still downloaded it) :

    since this is a BACKTRACK 4beta HOWTO, we are going set the following in the nvidia download page options.
    Operating System: -> linux 32bit
    Linux Version: -> Ubuntu 8.04


    CUDA Driver: NVIDIA Driver for Linux (Ubuntu 8.04) 185.18.08 Beta --> Thank You
    • downloads a file called "cudadriver_2.2_linux_32_185.18.08-beta.run" @ 22.6MB
    • best to be @ a shell prompt, make sure to kill all xorg sessions (afaik)
    • this installs the CUDA-compatible "NVIDIA Accelerated Graphics Driver for Linux-x86 185.18.08". this is the linux nvidia driver/module, this app also can modify the /etc/X11/xorg.conf file (you are NOT required to - if you DO choose to let it modify the xorg.conf file, it will back up the current file, which is helpful)


    CUDA Toolkit: CUDA Toolkit 2.2 for Linux (Ubuntu 8.04) --> Thank You
    • downloads a file called "cudatoolkit_2.2_linux_32_ubuntu8.04.run" @ 28.2MB
    • installs all files by default to /usr/local/cuda, this is what I choose
    • make sure your PATH includes /usr/local/cuda/bin
    • make sure your LD_LIBRARY_PATH includes /usr/local/cuda/lib
      or add /usr/local/cuda/lib to /etc/ld.so.conf and run ldconfig as root(I did this too, just to be sure things did work... you apparently aren't required to do it if you to the implement the LD_LIBRARY_PATH as I explain below)
      Identification: NVIDIA CUDA
      Target directory: pkg
      Uncompressed size: 84004 KB
      Compression: gzip
      Date of packaging: Sun Apr 12 12:51:31 PDT 2009
      OPTIONAL are the Release Notes, Programming Guide, Profiler README, License.


    CUDA SDK: CUDA SDK 2.2 code samples for Linux (Ubuntu 8.04) --> Thank You
    • downloads a file called "cuda/2_2/sdk/cudasdk_2.2_linux.run" @ 55.9MB
    • installs the NVIDIA CUDA SKD v2.2 for linux/ubuntu 8.04
    • installs all files by default into ~/NVIDIA_CUDA_SDK
    • asks for the install path of CUDA, which if follow my directions above, it gets installed to /usr/local/cuda
    • make sure your PATH includes /usr/local/cuda/bin
    • make sure your LD_LIBRARY_PATH includes /usr/local/cuda/lib
      Identification: NVIDIA CUDA SDK
      Target directory: pkg
      Uncompressed size: 151108 KB
      Compression: gzip
      Date of packaging: Wed Apr 22 13:56:52 PDT 2009
      OPTIONAL are the Release Notes, Getting Started, License


    CUDA Debugger: CUDA Debugger 2.2 for Linux --> Thank You
    • downloads a file called "cudagdb_2.2_linux_32_rhel5.3.run" @ 1.18MB
    • installs all files by default to /usr/local/cuda, this is what I choose
    • make sure your PATH includes /usr/local/cuda/bin
    • make sure your LD_LIBRARY_PATH includes /usr/local/cuda/lib
      or add /usr/local/cuda/lib to /etc/ld.so.conf and run ldconfig as root(I did this too, just to be sure things did work... you apparently aren't required to do it if you to the implement the LD_LIBRARY_PATH as I explain below)
      Identification: NVIDIA CUDA
      arget directory: pkg
      Uncompressed size: 2580 KB
      Compression: gzip
      Date of packaging: Sun Apr 12 10:27:23 PDT 2009


    there were a few things above that said we needed to create links/environment variables pointing to the CUDA libraries, here is an exact replica of the top of my /root/.bashrc file (substitue /root with your user account's home dir - ex. "/home/myuser" if you are building/using everything with a normal user)

    PATH=/usr/local/bin:/usr/local/sbin:/usr/kde3/bin:/usr/local/cuda/bin:/usr/bin:$PATH
    LD_LIBRARY_PATH=/usr/local/cuda/cudaprof/bin:/usr/local/cuda/lib
    CUDA_INSTALL_PATH=/usr/local/cuda
    SDK_INSTALL_PATH=/root/NVIDIA_CUDA_SDK
    export PATH
    export LD_LIBRARY_PATH
    export CUDA_INSTALL_PATH
    export SDK_INSTALL_PATH
    logout, and log back in -- or just run "source ~/.bashrc" for all changes to propagate to yr bash session (PS: why no tcsh shell in backtrack by default? i love me some tcsh shell! I know, I know... it's not hard to type "apt-get install tcsh")

    also, I did update the file /etc/ld.so.conf and put the following at the bottom of the file, then ran ldconfig ::
    include /usr/local/cuda/lib
    lastly... with the NVIDIA_CUDA_SDK there is some useful utils/projects, to get them working, you first need this ::
    Code:
    apt-get install freeglut3-dev
    then, goto ~/NVIDIA_CUDA_SDK and "make" everything... (I still seemed to get an error with the smokeParticles project... no biggie tho as these tools are not required) ::
    Code:
    # cd ~/NVIDIA_CUDA_SDK
    # make
    # cp -p 
    # cp -p ~/NVIDIA_CUDA_SDK/bin/linux/release/* /usr/bin
    that should be it for CUDA setup/install. if you want, you can compile the CUDA SDK projects
    now, back to aircrack-cuda-ng.
    cd /$TEMP_DIR/aircrack-ng-cuda
    [[ $TEMP_DIR being where you downloaded aircrack-ng-cuda to ]]
    make clean
    make CUDA=true sqlite=true unstable=true install
    yr GOOD TO GO! any errors you get here, check your environment variables!
    example way to check env variables: "set | grep -i LD_LIBRARY_PATH" or "set | grep -i CUDA_INSTALL_PATH" etc.

    test to ensure everything is working, run aircrack on the test wpa-psk capture file, with the included wordlist ::
    cd src
    ./aircrack-ng -p 1 ../test/wpa.cap -w ../test/password.lst
    NOTE: Multiple threads will just queue tasks for the gfx card. (-p 1)

  2. #2
    Senior Member fnord0's Avatar
    Join Date
    Jul 2008
    Posts
    144

    Post

    ------------------------------------------------------------------------------------------------------------------------------
    -- from the README.CUDA file, we have a Performance Review (aircrack-ng GPU vs. CPU)
    ------------------------------------------------------------------------------------------------------------------------------
    GPU:
    src # /root/NVIDIA_CUDA_SDK/bin/linux/release/deviceQuery
    CUDA Device Query (Runtime API) version (CUDART static linking)
    There is 1 device supporting CUDA

    Device 0: "GeForce 8800 GTS 512"
    CUDA Capability Major revision number: 1
    CUDA Capability Minor revision number: 1
    Total amount of global memory: 536150016 bytes
    Number of multiprocessors: 16
    Number of cores: 128
    Total amount of constant memory: 65536 bytes
    Total amount of shared memory per block: 16384 bytes
    Total number of registers available per block: 8192
    Warp size: 32
    Maximum number of threads per block: 512
    Maximum sizes of each dimension of a block: 512 x 512 x 64
    Maximum sizes of each dimension of a grid: 65535 x 65535 x 1
    Maximum memory pitch: 262144 bytes
    Texture alignment: 256 bytes
    Clock rate: 1.62 GHz
    Concurrent copy and execution: Yes
    Run time limit on kernels: No
    Integrated: No
    Support host page-locked memory mapping: No
    Compute mode: Default (multiple host threads can use this device simultaneously)

    Test PASSED

    ----
    GPU Test:

    src # time ./aircrack-ng -p 1 ../test/wpa.cap -w ~/words

    real 1m12.439s
    user 0m29.990s
    sys 0m42.370s

    keys: 176984 keys

    k/p = 2458.11
    ----


    CPU: (DUAL CORE)
    src # cat /proc/cpuinfo
    processor : 0 & 1
    vendor_id : GenuineIntel
    cpu family : 15
    model : 6
    model name : Intel(R) Pentium(R) D CPU 3.00GHz
    stepping : 2
    cpu MHz : 3014.642
    cache size : 2048 KB
    physical id : 0
    siblings : 2
    core id : 0
    cpu cores : 2
    apicid : 0
    initial apicid : 0
    fdiv_bug : no
    hlt_bug : no
    f00f_bug : no
    coma_bug : no
    fpu : yes
    fpu_exception : yes
    cpuid level : 6
    wp : yes
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pebs bts pni dtes64 monitor ds_cpl vmx cid cx16 xtpr pdcm lahf_lm tpr_shadow
    bogomips : 6029.28
    clflush size : 64
    power management:

    ----
    CPU (SSE2) Test:

    time ./aircrack-ng -p 2 ../test/wpa.cap -w ~/words


    real 4m59.881s
    user 9m57.630s
    sys 0m0.430s

    keys: 176984

    k/s = 772.85
    ----
    I don't know if the wordilst from these tests is the same that comes with the aircrack-ng-cuda distribution (I suspect NOT, the filenames are different), but here is what it looks like on my EVGA GTX 285 ;;

    first, WPA(1) with CUDA
    root@bt:~/aircrack-ng-cuda# time src/aircrack-ng -p 1 test/wpa.cap -w test/password.lst

    real 0m3.109s
    user 0m1.152s
    sys 0m1.692s


    19200 keys tested (6841.29 k/s)
    second, WPA2 with CUDA
    root@bt:~/aircrack-ng-cuda# time src/aircrack-ng -p 1 test/wpa2.eapol.cap -w test/password.lst
    real 0m3.108s
    user 0m1.140s
    sys 0m1.700s


    19200 keys tested (6837.44 k/s)
    using aircrack-ng-cuda with airolib-ng databases to crack WPA(1 and 2) keys (this test is just to see if it works, which it will if everything went smoothly - for some reason it doesn't go that fast, but the key is obtained within 1second!) ::
    root@bt:~/aircrack-ng-cuda# aircrack-ng -r test/passphrases.db test/wpa.cap
    this is just the tip of the iceberg... there are lots of good tools available, and sure to be released. there is an excellent tutorial by pureh@te that explains HOWTO use pyrit CUDA nvidia tool, which is very nice!

    - greetz to everyone working hard on the backtrack distro, ya`all are my heroes! peace -
    fnord0

  3. #3
    Senior Member kidFromBigD's Avatar
    Join Date
    Jan 2010
    Location
    Texas
    Posts
    159

    Default

    Supporting the nVidia cards with a new version on aircrack-ng is great news. Tell me, how did you find out about this? The main page ( Main [Aircrack-ng] ) contains nothing on CUDA support.

    Even so, I'd like to see it go head-to-head with the latest SVN of pyrit proper, just to see who has the upper hand at this point.

    pureh@te ? You there? Seemingly no SLI support, but can you give us a comparo?

    Thanks for the How-To, definitely bookmarked!
    You. Are. Doing. It. Wrong.
    -Gitsnik

  4. #4
    Developer
    Join Date
    Mar 2007
    Posts
    6,126

    Default

    Nice. I wasnt aware of the aircrack-cuda release although I had heard of its development. Just to be clear SLI has nothing to do with CUDA, I'm assuming what you mean is multi card support. I wont know untill I test it if it has multi card support or not. Ill check it out tommorow and post some results. In the mean time we have been working hard on pyrit with multi card support in bt4, cowpatty 4.5 including all the cool s**t, ATI support for pyrit and a md5 /md4 / ntlm CUDA-multiforcer tool. Check out our lastest blog post.

    Offensive Security Blog

  5. #5
    Senior Member fnord0's Avatar
    Join Date
    Jul 2008
    Posts
    144

    Default

    Quote Originally Posted by kidFromBigD View Post
    Tell me, how did you find out about this? The main page .... contains nothing on CUDA support.
    subversion my man, SVN. have a glance @ the README.CUDA file for the aircrack-ng-cuda subversion repository = h**p://trac.aircrack-ng.org/svn/branch/aircrack-ng-cuda/README.CUDA
    one other worthy mention, is the latest airoscript which is hella pimp too = h**p://trac.aircrack-ng.org/svn/branch/airoscript

    Quote Originally Posted by kidFromBigD View Post
    Even so, I'd like to see it go head-to-head with the latest SVN of pyrit proper, just to see who has the upper hand at this point.
    I'd like to see other people's results, as I just have an EVGA GTX 285, and I am happy with it's performance boost.

    Quote Originally Posted by kidFromBigD View Post
    Thanks for the How-To, definitely bookmarked!
    glad someone got something out of it, I am happy to be of assistance.

    Quote Originally Posted by pureh@te View Post
    Just to be clear SLI has nothing to do with CUDA, I'm assuming what you mean is multi card support.
    ahhhh, the hate machine himself... I am a fan! I think you are referring to the link I posted from the README.CUDA file @ h**p://trac.aircrack-ng.org/svn/branch/aircrack-ng-cuda/README.CUDA ::
    -> No SLI Support as yet (I have no way of testing currently)
    I took the quote directly from the file - I too suspect the aircrack-ng-cuda team is referring to multiple card decoding support.
    of note in the aircrack-ng-cuda documentation ::
    ./aircrack-ng -p 1 ../test/wpa.cap -w ../test/password.lst

    NOTE: Multiple threads will just queue tasks for the gfx card. (-p 1)
    and this from the "aircrack-ng --help" output ::
    -p <nbcpu> : # of CPU to use (default: all CPUs)
    everything points to the "-p 1" switch telling aircrack-ng-cuda to queue tasks directly to the (1?) GPU, I am not so sure how you'd tell it to queue to multiple GPUs (maybe "-p 2" will work for this, but you see later in the README.CUDA documenation that "-p 2" is used for CPU testing, even with aircrack-ng-cuda ::
    CPU (SSE2) Test:

    time ./aircrack-ng -p 2 ../test/wpa.cap -w ~/words


    real 4m59.881s
    user 9m57.630s
    sys 0m0.430s

    keys: 176984

    k/s = 772.85

    Quote Originally Posted by pureh@te View Post
    I wont know untill I test it if it has multi card support or not. Ill check it out tommorow and post some results.
    woot, glad to hear you have access to multi-GPU, I have a 1x EVGA GTX 285, and 1x EVGA 9800 GTX ... I am looking to try leveraging BOTH for CUDA support, yet I know in windows (shudder) that you get the choice of CUDA support on EITHER/OR, but not both --- is it the same in linux?

    Quote Originally Posted by pureh@te View Post
    In the mean time we have been working hard on pyrit with multi card support in bt4, cowpatty 4.5 including all the cool s**t, ATI support for pyrit and a md5 /md4 / ntlm CUDA-multiforcer tool. Check out our lastest blog post.
    P-I-M-P ... u guys are the greatest!
    btw - I read yr blog post (it has been subscribed to via RSS... holding my breath for bt4 final) = u my good man have access to some kick-ass hardware (re: dual 295 GTX's)! and yeah, that brute forcing NTLM results are mind warping! thanks for everything u guys do.

    -peace-
    fnord0

  6. #6
    Senior Member kidFromBigD's Avatar
    Join Date
    Jan 2010
    Location
    Texas
    Posts
    159

    Default

    Quote Originally Posted by fnord0 View Post
    subversion my man, SVN.
    Yes, that's where my digging eventually uncovered the CUDA support nuggets.

    Quote Originally Posted by fnord0 View Post
    ... = u my good man have access to some kick-ass hardware (re: dual 295 GTX's)! and yeah, that brute forcing NTLM results are mind warping! thanks for everything u guys do.
    +1
    pureh@te has the pwn sauce. In fact, he's told us about the h@te machine: Triple-SLI GTX-295, 1200W power supply, web interface with queuing, etc. etc. ... In a word: Incredible.

    EDIT:
    Ill check it out tommorow and post some results.
    Hey, if taking a look at this removes you from delivering BT4final, then leave the busywork to us. BT4final is important enough to get right. Don't loose sleep about this... and Thanks!
    You. Are. Doing. It. Wrong.
    -Gitsnik

  7. #7
    Just burned his ISO imported_gr8gorilla's Avatar
    Join Date
    Jun 2009
    Posts
    10

    Default What about ATI

    Ok, I asked a question and then found my answer, apparently both CUDA and Firestream are supported by pyrit. Now has anyone actually used a machine with either a Tesla or an ATI firestream GPU for this, I am building my new machine with the ability to upgrade in the future to a dual gpu setup, that is not counting the graphics cards I am putting in it. I have found a pair of tesla's on ebay for 999$ dollars each, thats a nice discount. Also the new Firestreams from AMD/ATI are about 1200 I think, they have those on New Egg.

    That is my question, what kind of speeds would we reach with a basically quad gpu system with a quad core processor? Two video cards and then either two stream processors from AMD or two Tesla's from nVidia?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •