Never Ending Security

It starts all here

Category Archives: Other Hardware

Install AMD ATI Proprietary FGLRX Driver + AMD APP SDK + Pyrit + CAL++ + Helpful ATIconfig FGLRX Commands



Install AMD ATI proprietary fglrx driver in Kali Linux 1.0.6


Kali dev team added new version of AMD ATI proprietary fglrx driver which is now available via Kali Linux repositories. That means, This guide is less complicated and everything should work out of the box instead of messing about with Debian Jessie repository.

Step by step guide to install proprietary fglrx driver in Kali Linux

Following instructions were tested on 64-bit Kali Linux 1.0.6 running Kernel version 3.12.6:

lsb_release -a

Output:

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux Kali Linux 1.0.6
Release:    Kali Linux 1.0.6
Codename:   n/a

Step 1 (add official Kali Linux Repositories)

Check your /etc/apt/sources.list. If it’s anything different to the following, you need to fix it. You can follow this guide to add official Kali Linux Repositories if you’re not too sure on how to do it. For the sake of clarity I will keep things simple here.

leafpad /etc/apt/sources.list

Remove or comment out existing lines and add the following:

## Kali Regular repositories
deb http://http.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
## Kali Source repositories
deb-src http://http.kali.org/kali kali main non-free contrib
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free

Step 2 (update with apt-get)

Now we need to update and make sure we get the latest list from Kali Linux official repositories. So perform an apt-get update.

apt-get update

Step 3 (install Linux headers and recommended softwares)

Now that we have the correct repositories we can add these following recommended apps. The most important part is to add the correct headers.

apt-get install firmware-linux-nonfree 
apt-get install amd-opencl-icd 
apt-get install linux-headers-$(uname -r)

NOTE: You should be able to get all these from Kali Linux repositories as added/updated from Step 1 above. When this guide was written, all these were available in the Kali Repositories.

Step 4 (install fglrx drivers and control)

Almost done, just install fglrx drivers and control. The best part is that it’s all you need to do. Debian Jessie fixed the issues with fglrx and latest driver, so once you install these drivers, everything just works.

apt-get install fglrx-atieventsd fglrx-driver fglrx-control fglrx-modules-dkms -y

NOTE: At this point, you will see bunch of popups (we see those hardly in Linux, but aptitude pops up with request to update some libraries(opencl and glx) and restart services such as network etc., I have chosen YES to all of them. My installation of Kali is still working and I am yet to find a problem. Your experience might be different.

Once the installation if finished, we need to test if it was all good.

Step 5 (testing your installation and generate xorg.conf file)

Now that our installation is all good and went without an error, we need to test fglrx drivers. You can test fglrx using the following two commands:

fglrxinfo 
fgl_glxgears

Install AMD ATI proprietary fglrx driver in Kali Linux 1.0.6 - Final - 11 - blackMORE Ops

If everything worked well, you can generate xorg.conf file using the following command

aticonfig --initial -f

xorg.conf file will be located at /etc/X11 folder.

Install AMD ATI proprietary fglrx driver in Kali Linux 1.0.6 - Final - 2 - blackMORE Ops

Step 6 (update grub.cfg file and reboot)

Almost there. AMD cards needs the following parameters passed into grub.cfg during boot. Let’s do that: Edit the grub.cfg file:

leafpad /boot/grub/grub.cfg

you see this:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 3.12-kali1-amd64' --class debian --class gnu-linux --class gnu --class os {
    load_video
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 129deb3c-0edc-473b-b8e8-507f0f2dc3f9
    echo    'Loading Linux 3.12-kali1-amd64 ...'
    linux    /boot/vmlinuz-3.12-kali1-amd64 root=UUID=129deb3c-0edc-473b-b8e8-507f0f2dc3f9 ro initrd=/install/gtk/initrd.gz quiet
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-3.12-kali1-amd64
}

add radeon.modeset=0 in the end of the following line

linux    /boot/vmlinuz-3.12-kali1-amd64 root=UUID=129deb3c-0edc-473b-b8e8-507f0f2dc3f9 ro initrd=/install/gtk/initrd.gz quiet

So the line above becomes this:

linux    /boot/vmlinuz-3.12-kali1-amd64 root=UUID=129deb3c-0edc-473b-b8e8-507f0f2dc3f9 ro initrd=/install/gtk/initrd.gz quiet radeon.modeset=0

Note: 129deb3c-0edc-473b-b8e8-507f0f2dc3f9 UUID would be different for every PC. Use your one here.

grub.cfg - Install AMD ATI proprietary driver (fglrx) in Kali Linux 1.0.6 running Kernel version 3.12.6 - blackMORE Ops

Save and exit. Then reboot.

reboot

Once you reboot, your should be able to login in GUI and enjoy your AMD ATI proprietary driver (fglrx) in Kali Linux 1.0.6 running Kernel version 3.12.6.

Step 7 (run ATI Catalyst Control Center)

Run ATI Catalyst Control Center from Applications Menu > System Tools > Preferences > ATI Catalyst Control Center.

You should be able to launch amdcccle and make changes as required.

Conclusion

There’s more that you can do using Aticonfig. You can change fan speed or setup multiple monitors or directly check GPU temperatures. I have show them in the end of this post with a compilation of useful aticonfig commands. However, I found that some commands were removed from this version aticonfig. (AMD does it everytime they release a new driver). But most of the commands work. So feel free to check and report them back.


How To Install AMD APP SDK In Kali Linux?


Check FGLRX Installation

First check if fglrx module is installed:

lsmod | grep fglrx

You should get a response similar to:

fglrx 2635205 82
button 12945 1 fglrx

Installing AMD APP SDK

What is AMD APP Technology?

AMD APP technology is a set of advanced hardware and software technologies that enable AMD graphics processing cores (GPU), working in concert with the system’s x86 cores (CPU), to execute heterogeneously to accelerate many applications beyond just graphics. This enables better balanced platforms capable of running demanding computing tasks faster than ever, and sets software developers on the path to optimize for AMD Accelerated Processing Units (APUs).

What is the AMD APP Software Development Kit?

The AMD APP Software Development Kit (SDK) is a complete development platform created by AMD to allow you to quickly and easily develop applications accelerated by AMD APP technology. The SDK provides samples, documentation, and other materials to quickly get you started leveraging accelerated compute using OpenCL™, Bolt, or C++ AMP in your C/C++ application, or Aparapi for your Java application.

What is OpenCL™?

OpenCL™ is the first truly open and royalty-free programming standard for general-purpose computations on heterogeneous systems. OpenCL™ allows programmers to preserve their expensive source code investment and easily target both multi-core CPUs and the latest APUs and discrete GPUs, such as those from AMD. Developed in an open standards committee with representatives from major industry vendors, OpenCL™ gives users what they have been demanding: a cross-vendor, non-proprietary solution for accelerating their applications on their CPU and GPU cores.

Download AMD APP SDK x2.7

Download AMD APP SDK v2.7 from:

AMD Download Archive

Install SDK

Install the SDK:

mkdir amdappsdk
cp AMD-APP-SDK-v2.7-lnx64.tar amdappsdk/
cd amdappsk
tar -xvf AMD-APP-SDK-v2.7-lnx64.tar
./Install-AMD-APP.sh

Edit /root/.bashrc, add the following lines to the end of the file:

# AMD APP SDK
export AMDAPPSDKROOT=/opt/AMDAPP
export AMDAPPSDKSAMPLESROOT=/opt/AMDAPP/
export LD_LIBRARY_PATH=${AMDAPPSDKROOT}lib/x86_64:${LD_LIBRARY_PATH}
export ATISTREAMSDKROOT=$AMDAPPSDKROOT

Save and quit, then issue the following command:

source ~/.bashrc

How To Install Pyrit In Kali Linux?


Check FGLRX Installation

First check if fglrx module is installed:

lsmod | grep fglrx

You should get a response similar to:

fglrx 2635205 82
button 12945 1 fglrx

Check AMD APP SDK Installation

Check if AMD APP SDK is installed. If not installed, follow this guide to install it.

Check CAL++ Installation

Check if CAL++ is installed. If not installed, follow this guide to install it.

Why Pyrit?

Pyrit allows to create massive databases, pre-computing part of the IEEE 802.11 WPA/WPA2-PSK authentication phase in a space-time-tradeoff. Exploiting the computational power of Many-Core- and other platforms through ATI-Stream, Nvidia CUDA, OpenCL and VIA Padlock, it is currently by far the most powerful attack against one of the world’s most used security-protocols.

Install Pyrit in Kali

Install prerequisites

apt-get install libpcap-dev

Remove existing installation of pyrit

apt-get remove --purge pyrit

If you are not using a clean install of Kali (not recommended), you may need to issue the following command:

rm -r /usr/local/lib/python2.7/dist-packages/cpyrit/

Download pyrit

svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit_svn

Install Pyrit

cd pyrit_svn/pyrit/
./setup.py build install

Install CAL++ plugin

cd ../cpyrit_calpp/

Edit setup.py

Edit setup.py file and modify/replace the followings:
find VERSION = '0.4.0-dev' and replace with VERSION = '0.4.1-dev'
find CALPP_INC_DIRS.append(os.path.join(CALPP_INC_DIR, 'include')) and replace with

CALPP_INC_DIRS.append(os.path.join(CALPP_INC_DIR, 'include/CAL'))

Save and quit, then issue the following command:

./setup.py build install

There will be several warnings, but hopefully no errors and everything will be installed.

Test cpyrit

List available core

pyrit list_cores
...

Output

The following cores seem available...

#1: 'CAL++ Device #1 'AMD GPU DEVICE''
#2: 'CPU-Core (SSE2)'
#3: 'CPU-Core (SSE2)'
#4: 'CPU-Core (SSE2)'

Benchmark Pyrit

pyrit benchmark
...

Output

Computed 7548.89 PMKs/s total.
#1: 'CAL++ Device #1 'AMD GPU DEVICE'': 5599.3 PMKs/s (RTT 1.4)
#2: 'CPU-Core (SSE2)': 685.6 PMKs/s (RTT 3.0)
#3: 'CPU-Core (SSE2)': 688.5 PMKs/s (RTT 3.0)
#4: 'CPU-Core (SSE2)': 691.9 PMKs/s (RTT 3.0)

How to install CAL++ in Kali Linux?


Check FGLRX Installation

First check if fglrx module is installed:

lsmod | grep fglrx

You should get a response similar to:

fglrx 2635205 82
button 12945 1 fglrx

If not installed follow this guide to install it.

Check AMD APP SDK Installation

Check if AMD APP SDK is installed. If not installed follow this guide to install it.

Installing CAL++

CAL++ is a simple library to allow writing ATI CAL kernels directly in C++. The syntax is very similar to OpenCL. Also C++ wrapper for CAL is included.

This project was registered on SourceForge.net on Feb 19, 2010.

Install prerequisites:

apt-get install cmake libboost-all-dev

Download CAL++

Download calpp 0.90 from: SourceForge CAL++ Website

Install CAL++

tar -xvf calpp-0.90.tar.gz
cd calpp-0.90/

Edit CMakeLists.txt:

Find the lines starting with FIND_LIBRARY and FIND_PATH and replace them with this:

FIND_LIBRARY( LIB_ATICALCL aticalcl PATHS "$ENV{ATISTREAMSDKROOT}" )
FIND_LIBRARY( LIB_ATICALRT aticalrt PATHS "$ENV{ATISTREAMSDKROOT}" )
FIND_PATH( LIB_ATICAL_INCLUDE NAMES cal.h calcl.h PATHS "$ENV{ATISTREAMSDKROOT}/include/CAL" )

Save and quit,

Make and Install CAL++

Issue the following commands:

cmake .
make
make install

Helpful ATIconfig FGLRX Commands


ATI Proprietary Linux Driver (ATIconfig fglrx) Features

The ATI Proprietary Linux driver (ATIconfig fglrx) provides TV Output support for ATI graphics cards that support TV out. The ATI Proprietary Linux (ATIconfig fglrx) driver also allows for the following monitor arrangements:

  1. Single Head Mode (single display)
  2. Clone Mode (same content on both screens)
  3. Mirror Mode (same content on both screens, with identical display resolution and refresh rates)
  4. Big Desktop (one desktop stretched across two screens)
  5. Dual Head (separate instances of X running on each screen)

ATI Config Linux Edition - blackMORE Ops

ATI Workstation Product Support

The ATI Proprietary Linux driver is designed to support the following ATI Workstation products:

  • FireGL™ V7350
  • FireGL™ V3300
  • FireGL™ X1-128
  • FireGL™ V7300
  • FireGL™ V3200
  • FireGL™ X1-256p
  • FireGL™ V7200
  • FireGL™ V3100
  • FireGL™ 8800
  • FireGL™ V7100
  • FireGL™ X3-256
  • FireGL™ 8700
  • FireGL™ V5200
  • FireGL™ X3
  • FireMV™ 2200 (Single card configuration)
  • FireGL™ V5100
  • FireGL™ X2-256
  • Mobility™ FireGL™ V5000
  • FireGL™ V5000
  • FireGL™ Z1-128
  • Mobility™ FireGL™ 9100
  • FireGL™ V3400
  • FireGL™ T2-128
  • Mobility™ FireGL™ T2

ATI Mobility™ Product Support

The ATI Proprietary Linux driver is designed to support the following ATI Mobility™ products:

  • Mobility™ Radeon® X1800
  • Mobility™ Radeon® 9800
  • Mobility™ Radeon® X1600
  • Mobility™ Radeon® 9600
  • Mobility™ Radeon® X1400
  • Mobility™ Radeon® 9550
  • Mobility™ Radeon® X1300
  • Mobility™ Radeon® 9500
  • Mobility™ Radeon® X800
  • Mobility™ Radeon® 9000
  • Mobility™ Radeon® X700
  • Mobility™ Radeon® 9200
  • Mobility™ Radeon® X600
  • Radeon® Xpress 200M series
  • Mobility™ Radeon® X300

ATI Integrated Product Support

The ATI Proprietary Linux driver is designed to support the following ATI Integrated products:

  • Radeon® Xpress 200 series
  • Radeon® 9100 IGP
  • Radeon® 9200 IGP
  • Mobility™ Radeon® 9000 IGP series
  • Mobility™ Radeon® 9100 IGP series

Caution: This software driver provides 2D support only for the ATI Radeon® 9100 IGP and ATI Radeon® 9100 PRO IGP.

ATI Desktop Product Family Support

The ATI Proprietary Linux driver is designed to support the following ATI desktop products:

  • Radeon® X1900 series
  • Radeon® 9800 series
  • Radeon® X1800 series
  • Radeon® 9600 series
  • Radeon® X1600 series
  • Radeon® 9200 series
  • Radeon® X1300 series
  • Radeon® 9000 series
  • Radeon® X850 series
  • Radeon® 9700 series
  • Radeon® X800 series
  • Radeon® 9550 series
  • Radeon® X700 series
  • Radeon® 9500 series
  • Radeon® X600 series
  • Radeon® 9100 series
  • Radeon® X300/X550 series
  • Radeon® 8500 series

Just make sure your product is listed here, otherwise following commands are not supported.

Helpful ATIconfig commands

Initial setup (creates device section using fglrx)

 aticonfig --initial

Enable Video acceleration (Xv Overlay)

     aticonfig -overlay-type=Xv

Force fglrx to use kernel’s AGP driver instead of own implementation

(only use when internal agpgart doesn’t work)

    aticonfig --internal-agp=off

Note: Newer fglrx driver versions do not include an internal AGPGART so the kernel agpgart is used no matter what.

Use extended desktop with two monitors (dual-head and big desktop)

    aticonfig --initial=dual-head --screen-layout=right

This command will generate a dual head configuration file with the second screen located to the right of the first screen.

Setup big Desktop to Horizontal and Set Overlay on the Secondary Display

    aticonfig --dtop=horizontal --overlay-on=1

This command will set up big desktop to horizontal and set overlay on the secondary display.

If black borders doesn’t remove try this :

 aticonfig --query-monitor # to see monitors
 aticonfig --query-dispattrib=tmds2 #to see supported values
 aticonfig --set-dispattrib=tmds2,sizeX:1920 # to set X resolution
 aticonfig --set-dispattrib=tmds2,sizey:1080 # to set Y resolution
 aticonfig --set-dispattrib=tmds2,positionX:0 # to set X position to 0
 aticonfig --set-dispattrib=tmds2,positionY:0 # to set Y position to 0

 Print information about power states.

    aticonfig --list-powerstates

Or, for us lazy folk, the shorter version is

   aticonfig --lsp

Set a power state to the lowest (battery friendly)

    aticonfig --set-powerstate=1

Note: check out available power states using aticonfig –list-powerstates
Note: this option does not work when an external monitor is connected

Print information about connected and enabled monitors

    aticonfig --query-monitor

How to enable two monitors on the fly

Assume you have two monitors already setup correctly
This example enables laptop internal monitor (lvds) and external monitor (crt1)

    aticonfig --enable-monitor=lvds,crt1 --effective=now

Note: aticonfig –enable-monitor=STRING,STRING where STRING can be one of the following set, separated by commas: none,crt1,crt2,lvds,tv,tmds1,tmds2,auto.

Only 2 displays can be enabled at the same time. Any displays that are not on the list will be disabled.

Note: check out connected and enabled monitors using aticonfig –query-monitor

Turn off the second monitor on the fly and start to use only laptop internal monitor (lvds)

    aticonfig --enable-monitor=lvds --effective=now

Swap monitors on the fly when using big desktop mode

    aticonfig --swap-monitor --effective=now

Note: This only works for big desktop setup. This will swap the contents on the two monitors.

Get temperature:

   aticonfig --odgt

Get Fan speed:

   aticonfig --pplib-cmd "get fanspeed 0"

Replace 0 with the FAN number. i.e. 0, 1. etc.

Set Fan Speed:

   aticonfig --pplib-cmd "set fanspeed 0 40"

Where 0 is the fan number and 40 is the percent of speed you want it to run.

ATIConfigHelp Page

Install Proprietary NVIDIA Driver + kernel Module CUDA and Pyrit on Kali Linux



Install Proprietary NVIDIA Driver On Kali Linux – NVIDIA Accelerated Linux Graphics Driver


This guide explains how to install proprietary “NVIDIA Accelerated Linux Graphics Driver” or NVIDIA driver on Kali Linux system. If you are using Kali Linux and have NVIDIA graphics card then most likely you are using open source NVIDIA driver nouveau. You can see it by lsmod | grep nouveau command. nouveaudriver works quite well, but if you want to use 3D acceleration feature or want to use GPU based applications (such as CUDA and GPU pass through) then you need to install proprietary NVIDIA driver. The proprietary “NVIDIA Accelerated Linux Graphics Driver” provides optimized hardware acceleration of OpenGL applications via a direct-rendering X server. It is a binary-only Xorg driver requiring a Linux kernel module for its use. The first step is to fully update your Kali Linux system and make sure you have the kernel headers installed.

Where you had to download NVIDIA Driver (CUDA) manually and edit grub.cfg file to make everything work. Because it will be a long guide, I had to divide it into two parts:

You use the first guide to install NVIDIA Driver. If you want GPU acceleration, (cudahashcat, GPU pass through etc.) keep reading and follow the second guide to complete your installation. I’ve included as much details I can, including troubleshooting steps and checks but I would like to hear your part of the story, so leave a comment with your findings and issues.

The new NVIDIA Driver

The new Linux binary NVIDIA drivers nvidia-kernel-dkms builds the NVIDIA Xorg binary kernel module needed by NVIDIA driver, using DKMS. Provided that you have the kernel header packages installed, the kernel module will be built for your running kernel and automatically rebuilt for any new kernel headers that are installed. The binary NVIDIA drivers provide optimized hardware acceleration of OpenGL applications via a direct-rendering X Server for graphics cards using NVIDIA chip sets. AGP, PCIe, SLI, TV-out and flat panel displays are also supported. NVIDIA Added support for the following GPU including fixing some issues: (existing GPU’s are already supported).

  • GeForce GT 710
  • GeForce 825M
  1. Fixed a regression that prevented NVIDIA-installer from cleaning up directories created as part of the driver installation.
  2. Added a new X configuration option “InbandStereoSignaling” to enable/disable DisplayPort in-band stereo signaling.
  3. Fixed a bug that caused PBO downloads of cube map faces to retrieve incorrect data.
  4. Fixed a bug in NVIDIA-installer that resulted in spurious error messages when opting out of installing the NVIDIA kernel module or source files for the kernel module.
  5. Added experimental support for ARGB GLX visuals when Xinerama and Composite are enabled at the same time on X.Org xserver 1.15.

See the details about this driver in NVIDIA official website:

Debian Linux usually ports that Official Driver to fit it’s requirements. The NVIDIA driver graphics processing unit (GPU) series/codename of an installed video card can usually be identified using the lspci command. For example:

lspci -nn | grep VGA

My settings

My PC got the following configuration:

I’ve installed everything in a brand new Kali Linux 1.0.6 installation, fully updated and upgraded. Before you do anything, you of course add the Official Kali Linux repository. Once I’ve added the correct Kali Official repositories, I’ve issued the following commands to update, upgrade and dist-upgrade my Kali Linux.

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y

If you’ve completed this part, move on to the next instruction.

Step 1: Install Linux headers

Install Linux headers as those will be required to build NVIDIA Driver modules.

aptitude -r install linux-headers-$(uname -r)

Where -r means install all recommended packages as well.   

Step 2: Install NVIDIA Kernel

Next I installed NVIDIA Kernel

apt-get install nvidia-kernel-$(uname -r)

Step 3: Install NVIDIA Driver Kernel DKMS

We’re almost ready. You can now install new NVIDIA driver nvidia-kernel-dkms by using the following command:

aptitude install nvidia-kernel-dkms

Including dependencies, this is about 24MB is size, depending on how fast Kali repo is working, you might have to wait few minutes. You will get 2 popups, the first one about rebooting after you’ve installed NVIDIA drivernvidia-kernel-dkms that it will disable open source NVIDIA driver nouveau and the second one about xorg.conf file in /etc/X11/ folder.

Press OK on both popups.

Step 4: Install xconfig NVIDIA driver application

If you go through the NVIDIA driver README document, you will see you need to create new XORG server configuration file xorg.conf or modify existing xorg.conf to tell it to load NVIDIA Driver module.nvidia-xconfig package make this task quite easier. All you need to do is to install and execute it.

aptitude install nvidia-xconfig

Step 5: Generate Xorg server configuration file

Now that we have installed nvidia-xconfig package, issue the following command to generate Xorg server configuration file.

nvidia-xconfig

It will rename any existing xorg.conf file and create a new one. As directed by NVIDIA drivernvidia-kernel-dkms, reboot your machine to complete installation.

Step 6: Confirming your installation

At this point you should be able to login to your system in Graphical User Mode (GUI). In case you can’t, follow the troubleshooting section at the bottom of this article. As always, we need to check if everything went as expected.

Step 6.a: Check GLX Module

First check if system is using glx module.

glxinfo | grep -i "direct rendering"

It should output “direct rendering: Yes”

Run glxinfo- 7 - Install proprietary NVIDIA driver on Kali Linux - blackMORE Ops

If you do not have glxinfo then first install mesa-utils package then again issue above command and check output

aptitude install mesa-utils

Step 6.b: Check NVIDIA Driver Module

Check if NVIDIA module loaded.

lsmod | grep nvidia

If it produces output like nvidia 9442880 28 or something similar (numbers could be different at your system) then NVIDIA module is loaded.

Step 6.c: Check for Open source NVIDIA Driver nouveau module

Just to be sure Open source NVIDIA Driver nouveau module NOT loaded, issue following command

lsmod | grep nouveau

Run lsmod grep nouveau- 9 - Install proprietary NVIDIA driver on Kali Linux - blackMORE Ops

It should NOT produce any output. If it produces output then something is wrong.

Step 6.d: Confirm if open source NVIDIA Driver nouveau was blacklisted

I like this new NVIDIA Driver. It blacklists Open source NVIDIA Driver nouveau by default. That means less work for us to do. You can confirm it by checking files in the following directory:

cat /etc/modprobe.d/nvidia.conf
cat /etc/modprobe.d/nvidia-blacklists-nouveau.conf
cat /etc/modprobe.d/nvidia-kernel-common.conf

Troubleshooting

You might get a black screen after installing NVIDIA Driver. Following are your options to fix it:

Troubleshooting Step A: Fixing black screen with a cursor problem

Simply press CTRL + ALT + F1 and login. Type the following

nvidia-xconfig
reboot

You should now be able to log in using the GDM3 GUI.

Troubleshooting Step B: Delete xorg.conf file

Press CTRL + ALT + F1 and login. Type the following

rm /etc/X11/xorg.conf
reboot

After reboot, you should be able to log in using the GDM3 GUI.

Troubleshooting Step C: remove NVIDIA Driver

Press CTRL + ALT + F1 and login. Type the following

apt-get remove nvidia-kernel-dkms
reboot

After reboot, you should be able to log in using the GDM3 GUI.

Conclusion

This concludes my general instructions on how to install proprietary NVIDIA driver on Kali Linux – NVIDIA Accelerated Linux Graphics Driver. NVIDIA Optimus users should be able to follow the same instructions, however, as I said before, feel free to share your side of story on how your installation went and correct my guide if required. I am open for discussion and will try to reply back to your comments the earliest possible. For those curious minds, try installing nvidia-settings and see how that goes. NVIDIA Settings will remove NVIDIA Driver but I did manage to make it work with some tinkering. I will try to write another guide on that (NVIDIA Settings presents you with a GUI X Config Window and you can see GPU Temperature and more info)… The proprietary “NVIDIA Accelerated Linux Graphics Driver” provides optimized hardware acceleration of OpenGL applications via a direct-rendering X server, in shoty your NVIDIA Driver give you better display and 3D rendering then you’re all done. You can now play 3D Games. Let me know if you want any specific Linux supported games on Kali and I can write up an article on that. But if you want to run applications that uses NVIDIA Kernel Module CUDA, Pyrit and Cpyrit for GPU processing then you will also need to install CUDA drivers, replace offical Pyrit and install Cpyrit. Find out if your Graphics Card supports CUDA in the following page from NVIDIA

Mine does,

  • GeForce 210.

Next guide will show you how to Install NVIDIA Kernel Module CUDA and Pyrit in Kali Linux – CUDA, pyrit and cpyrit.   Thanks for reading. If this guide helped you to install NVIDIA Driver, please share this article and follow us in Facebook/Twitter.


Install NVIDIA driver kernel Module CUDA and Pyrit on Kali Linux – CUDA, Pyrit and Cpyrit-cuda


In this guide, I will show how to install NVIDIA driver kernel Module CUDA, replace stock Pyrit, and install Cpyrit.At the end of this guide, you will be able to use GPU acceleration for enabled applications such as cudaHashcat, Pyrit, crunch etc.

You use the first guide to install NVIDIA Driver on Kali Linux. I would assume you followed the first guide and completed all steps there and would like to enable GPU acceleration, (cudahashcat, GPU pass through etc.) on your Kali Linux.

CUDA Toolkit

The NVIDIA® CUDA® Toolkit provides a comprehensive development environment for C and C++ developers building GPU-accelerated applications. The CUDA Toolkit includes a compiler for NVIDIA GPUs, math libraries, and tools for debugging and optimizing the performance of your applications. You’ll also find programming guides, user manuals, API reference, and other documentation to help you get started quickly accelerating your application with GPUs. You can read a lot more here in NVIDIA Developers official webpage:

CUDA Toolkit

Prerequisites

Following are the prerequisite before you start following this guide:

Prerequisite 1: add Official Kali Linux repository.

I’ve added the correct Kali Official repositories and issued the following commands to update, upgrade and dist-upgrade my Kali Linux.

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y

Prerequisite 2: Install proprietary NVIDIA driver on Kali Linux

I’ve installed the correct official proprietary NVIDIA driver on Kali Linux – NVIDIA Accelerated Linux Graphics Driver using the previous guide.

If you’ve completed both, move to next instruction.

Step 1: Install NVIDIA CUDA toolkit and openCL

At first we need to install NVIDIA CUDA toolkit and NVIDIA openCL

aptitude install nvidia-cuda-toolkit nvidia-opencl-icd

This will install CUDA packages in your Kali Linux. The total package is pretty large including dependencies, (282MB something), you be patient and let it finish.

Step 2: Download Pyrit and Cpyrit

Download Pyrit and Cpyrit from the official website:

http://pyrit.googlecode.com

Save them in your /root folder.

Step 3: Install Pyrit

Follow the instructions below to install Pyrit and it’s prerequisites.

Step 3.a: Install Pyrit prerequisites

apt-get install python2.7-dev python2.7-libpcap libpcap-dev

Step 3.b: Remove existing installation of Pyrit

Remove stock Pyrit using the following command:

apt-get remove pyrit

You get a message stating that it will also remove kali-linux-full package. It actually doesn’t. All it does updating Kali repo and remove Pyrit. Finish removing Pyrit.

If you are not using a clean install of Kali (not recommended), you may need to issue the following command:

rm -r /usr/local/lib/python2.7/dist-packages/cpyrit/

Step 3.c: Install new Pyrit

Copy paste the following commands to extract downloaded Pyrit in your Kali Linux /root directory

tar -xzf pyrit-0.4.0.tar.gz
cd pyrit-0.4.0

Now build the package

python setup.py build

Once build is complete, you can install Pyrit.

python setup.py install

Up to this point, you shouldn’t receive any errors.

Step 4: Install CPyrit-cuda

Copy paste the following commands to extract downloaded CPyrit-cuda in your Kali Linux /root directory

tar -xzf cpyrit-cuda-0.4.0.tar.gz 
cd cpyrit-cuda-0.4.0

Now build the package

python setup.py build

Once build is complete, you can install CPyrit-cuda.

python setup.py install

Again, you shouldn’t receive any errors, if there’s error, go back and review each steps.

Step 5: Testing and troubleshooting

Now that we’ve installed NVIDIA driver kernel Module CUDA and Pyrit on Kali Linux, we should be able to test it. The best way to test is by issuing the following command:

pyrit list_cores

This gave me an error “ bash: /usr/bin/pyrit: No such file or directory “.

It seems this Pyrit puts its binaries in wrong folder than you’d expect. The actual path for Pyrit is now/usr/local/bin/pyrit

Step 5.a Softlink them or add path to profile

There’s two different ways you can resolve it. You can either softlink or add this /usr/local/bin/ path to your profile. Choice is again yours.

Step 5.a.i: Softlinking
This is what I’ve followed
ln -s /usr/local/bin/pyrit /usr/bin/pyrit

Step 5.a.ii: Add path

If you want only to specific user edit ~/.bash_profile or ~/.bashrc and put there

export PATH=$PATH:/usr/local/bin

If you want for all users edit /etc/profile and scroll down until you see something like

 PATH="/bin:/usr/bin:/sbin:/usr/sbin" export PATH

Append to the end /usr/local/bin. it will be

PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin"

and Finally

Once you’ve either Softlinked or added the correct path to your profile, then following is what you get

root@kali:~# pyrit list_cores
Pyrit 0.4.0 (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

The following cores seem available...
#1:  'CUDA-Device #1 'GeForce 210''
#2:  'CPU-Core (SSE2)'
#3:  'CPU-Core (SSE2)'
#4:  'CPU-Core (SSE2)'

and of course I did a benchmark with my GeForce 210 card:

root@kali:~# pyrit benchmark
Pyrit 0.4.0 (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

Running benchmark (2744.1 PMKs/s)... -

Computed 2744.11 PMKs/s total.
#1: 'CUDA-Device #1 'GeForce 210'': 853.1 PMKs/s (RTT 3.0)
#2: 'CPU-Core (SSE2)': 648.1 PMKs/s (RTT 2.8)
#3: 'CPU-Core (SSE2)': 647.6 PMKs/s (RTT 2.9)
#4: 'CPU-Core (SSE2)': 658.5 PMKs/s (RTT 3.0)
root@kali:~#

Conclusion

Pyrit allows to create massive databases, pre-computing part of the IEEE 802.11 WPA/WPA2-PSKauthentication phase in a space-time-tradeoff. Exploiting the computational power of Many-Core- and other platforms through ATI-Stream, Nvidia CUDA and OpenCL, it is currently by far the most powerful attack against one of the world’s most used security-protocols.

Here’s a great benchmark done with Pyrit and CUDA for different GPU’s

Thanks for reading. If this guide helped you to install NVIDIA driver kernel Module CUDA and Pyrit on Kali Linux – CUDA, Pyrit and Cpyrit-cuda, please share this article and follow me in Facebook/Twitter.

ah and don’t forget to show off your Pyrit Benchmark. ;)

Hard disk (HDD) Hacking – The story

New Ways for Detecting modified (disk) firmware with USB Armory


The USB Armory is a crowd-funded hardware project led by a company
called Inverse Path [1].
After having watched a presentation they made at 31c3 [2], I sense that
it is very promising device. It is essentially a full-flavored computer
the size of an USB key, with allegedly a “Trusted Boot” feature. Some
characteristics :

– Freescale i.MX53 ARM Cortex-A8 with ARM Trust Zone for security
enforcement.
– Runs Linux kernel.
– MicroSD slot for storage.
– Emulation of USB devices (Storage, Network Controller, …)

The device is programmable, and allows code to be signed with user’s own
keys, although the presentation was not very technical on this subject.

Example use cases are encrypted storage and Key Management for anything,
passwords or Bitcoin wallet with keys not leaking to host.

So to sum up, it would offer a wide range of secure computing
applications that will rely a lot on the security scheme offered by ARM
Trust Zone. The code integrity mechanism is assured by 4 secure
registers that can hold the user’s keys to sign to code.

Hopefully, it is an open-source and “open-hardware” initiative [3], so
it will be open for reviews and developers’ ideas. The presenter assured
that ARM’s technology was not encumbered too much with NDAs.

Anyway the interesting feature is that it is a whole Linux computer that
implements a mass storage device for example. So in a way, you control
the (virtual) firmware and can force a screening procedure of every file
before it reaches storage.

Although it does nothing to the actual storage firmware, that is the
MicroSD firmware. This is still wide open to attacks. But this device
offer a chance to, e.g., monitor its behavior, and I/O transfers.

[1] http://inversepath.com
[2] https://media.ccc.de/browse/congress/2014/31c3_-_6541_-_en_-_saal_2_-_201412281730_-_forging_the_usb_armory_-_andrea_barisani.html#video
[3] https://github.com/inversepath/usbarmory

6 Security failures discovered in BMW’s “ConnectedDrive”. Used in BMW’s made from 2010 and later.


-Failure One: BMW use in all the cars the same symmetric key.
-Failure Two: Some services send data to BMW-Backend without usage of any transport encryption.
-Failure Three: The integrity of the Connected Drive configuration is not protected.
-Failure Four: The Combox reveals with NGTP (Next Generation Telematics Protocol) error messages the VIN (Vehicle Identification Number) of the vehicle
-Failure Five: Send data via SMS in NGTP format that is encrypted with the dated & unsafe DES cipher for encryption.
-Failure Six: The Combox has no protection against replay attacks.

All these failures could been easily avoided, if they put some attention on it. The big question now is: Do people from BMW don’t care about security? Or do they just don’t understand security?

Worldwide there are about 2,2 million cars from BMW that have these same problems.

Detailed report about these issues can be found at:
http://www.heise.de/ct/ausgabe/2015-5-Sicherheitsluecken-bei-BMWs-ConnectedDrive-2536384.html