Information Security, Web, Networks and Systems

Tuesday, December 23, 2014

Installing CUDA Toolkit 6.5 in Ubuntu 14.10/14.04

10:44 PM Posted by Deepal , , , 14 comments

Checking system capability

First of all, you need to check whether your GPU is CUDA-capable. You can see whether your GPU is listed in CUDA GPUs at https://developer.nvidia.com/cuda-gpus.

Download

Download the CUDA Toolkit from,  https://developer.nvidia.com/cuda-downloads
You need to download the RUN installer for Ubuntu 14.04.

Installing background

Before installing CUDA toolkit, you need to first install nvidia proprietery driver in Ubuntu. You can install this using Additional Drivers in Ubuntu.

Then you need to exit the ubuntu graphics session and go to CLI. For this, press ctrl+alt+f1 and run the following command to stop lightdm display manager.

sudo service lightdm stop

Once the lightdm is stopped, you can proceed to next steps.

Installing Prerequisites

If your system does not include necessary dependencies, you might encounter following error when installing CUDA toolkit.

Missing recommended library: libGLU.so
Missing recommended library: libXi.so
Missing recommended library: libXmu.so
Missing recommended library: libGL.so

You need to install additional libraries which installs above dependencies as follows:

sudo apt-get install libglu1-mesa libxi-dev libxmu-dev

Installing CUDA toolkit and samples

Once dependencies are installed, go to where the CUDA toolkit is downloaded, and run the following command to start the installation.

sudo chmod a+x cuda_6.5.14_linux_64.run
sudo ./cuda_6.5.14_linux_64.run

If you get an error saying,

Unsupported compiler 4.*.*. Use --override to override this check

it says that your gcc compiler is incompatible with the installation. To prevent this error, you need to change the installation step as,

sudo ./cuda_6.5.14_linux_64.run --override compiler

You can then accept the EULA, and at the next step, do not install nvidia accellerated graphics driver(select no to when asking to install the driver), since we already have installed a proprietery driver.

If everything went well, your installation will complete successfully. After installation, you can enable Nvidia C Compiler (nvcc) by including following lines at the end of ~/.bashrc file.

For 32 bit include following two lines at the end of bashrc file

export PATH=$PATH:/usr/local/cuda-6.5/bin
export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib

For 64 bit include following two lines at the end of bashrc file

export PATH=$PATH:/usr/local/cuda-6.5/bin
export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:/lib

When it is done, you can check you ncc by running the command,

nvcc --version

You can then go back to your graphics session by running,

sudo service lightdm start

These steps worked for me. Feel free to put a comment below if you encounter an error during installation.

Thank you.

Tuesday, July 8, 2014

Thursday, April 17, 2014

Configuring Secure IIS Response Headers in ASP.NET MVC

In a previous post I talked about how to configure a secure response in Apache by adding secure response headers (such as X-Frame-Options, X-XSS-Protection etc) and omitting headers that disclose internal implementation and technical details of the apache web server (such as X-Powered-By). In this post, I will talk about how to do this in an ASP.NET MVC web application. Instead of configuring these settings in the IIS server, this time I'm going to do this in the ASP.NET code itself since it gives more flexibility and does not affect other applications hosted on the same IIS server.

Using Anti Forgery Tokens with AJAX in ASP.NET

As you know, we can use anti forgery tokens to prevent Cross Site Request Forgery. Usually we add an anti forgery token in a hidden form field of the form. Each time we post the form to the server, server validates the request using the token in the hidden form field and the other one which is sent as a Cookie. See this post in my blog for more detailed information.
              But when we use AJAX to post data to the server asynchronously, we do not use forms most of the times. In those cases we explicitely need to attach the anti forgery token to our data which is sent via ajax. We can do this by some simple javascript.

Sunday, March 2, 2014

Apache Security - Configuring Secure Response Headers

In this post I talk about how to configure some security options of Apache Web Server. A proper configuration of Apache Web server may extreamely important since it sometimes can prevent certain Web Application Attacks even though the vulnerability is there in the web application. In this post I'll describe how to set configure apache to send Security concerned HTTP headers in its response and hide sensitive information from server response headers.

Friday, February 21, 2014

Anti-CSRF Tokens to prevent Cross Site Request Forgery (CSRF)

Cross Site Request Forgery is a client side Web Application Attack where attacker tricks victim to execute a malicious web request on behalf of himself. Attacker may send a link to the victim, with a little bit of Social Engineering, he will make victim click on the link. Then victim unintentionally issues a request to the web server which he did not intended to do. Lets see an example.

Wednesday, February 19, 2014

Secure Web Application Development Tips for Beginners

In this post I like to share some important facts I recently learned related to Secure Web Application Development. An expert in Secure Web Application development/Web Application Secure assessment will see these tips trivial, but I really hope they are important for those who are new to Web Application Development.