Nov 16

This file has given many new Linux users problems since without it being configured correctly you won’t be able to browse the internet. The resolv.conf files tells the system where the DNS nameservers are which enable you to use domain names to locate a particular site. Below I’m going to show the most simple way to configure this file which should be enough to get you up and running. If you are using DHCP then this file should already be configured for you based on information the DHCP server sent.

nameserver 192.168.1.120
nameserver 192.168.5.51

Replace the IPs with your DNS server’s and you should be up and running. If you are adding a linux machine on a domain you can add these lines at the top of the file:

domain domain.goeshere.com
search domain.goeshere.com

Nov 15

Managing Users and Groups on a Linux system can be rather cumbersome for new users so today I’m going to go over how to create, delete, and edit Users and Groups. There are a couple of different ways to manage users and groups so we’re going to look at the easier ways for now.

Users

Create a new user with the login name of codedrunk:

# sudo adduser codedrunk

The new user accoung will be created and added to it’s own usergroup (same as the user name), you will be prompted to enter a password, and you will be prompted to enter optional information.

So now we have our new user created but we need to add it to a different group. For example I want this new account to have administrative privileges on an Ubuntu server so I will add it to the admin group:

# sudo usermod -a -G admin codedrunk

Our new account is now created and added to the admin group. If you no longer need this account and want to delete it use this command:

# sudo deluser codedrunk

The user account will be removed and if this was the last member of a created group as ours was, the group will also be removed. Empty system groups will not be removed.

Groups

Managing groups is just as easy as managing users. First off lets make a new group called goodgroup:

# sudo groupadd goodgroup

Now we’ll add a user to the new group:

# sudo usermod -a -G goodgroup Username

To remove the group:

# sudo groupdel goodgroup

And finally to see what groups a user belongs to you can use this command:

# sudo groups useraccount

Thats it for Users and Groups. Tomorrow we’ll take a quick look at the resolv.conf file which points your system to DNS servers.

Nov 14

Starting today I’m going to try something new and do a daily Linux 101 post which will explain a Linux command or show off something a new Linux user may not yet know about. These posts may not only help someone reading this but it will also help me as well. It seems like every week I learn a command I’ve been using for years can do something else, which I have been doing the hard way all this time! That being said let’s get started with the first post. This one will show off a handful of helpful basic commands common to any Linux distribution.

uname -a :: Shows the current running kernel version
hostname :: Shows the system’s hostname
hostname -i :: Shows the system’s IP address
uptime :: Displays the uptime and system load averages
cat /proc/cpuinfo :: Displays CPU information
cat /proc/meminfo :: Displays memory information
top :: Displays an updating view of CPU processes
whoami :: Displays the current logged in user
who :: Displays users currently logged on
last :: Shows last logins to the system
last reboot :: Displays the last reboots on the system

This is just a quick list of handy commands that will allow you to find out about your system. Tomorrow I’m going to cover managing Users and Groups which seems to be an area a lot of new users have problems with. One last command:

man :: Displays the manual for a given command

Try this out and learn about the Linux file system:

man hier

I recommend anyone new to Linux do this since the file system is very different from Windows.

Nov 13

This was just emailed to me but I believe it was on Lifehacker earlier today.

There is no need to install extra software to create an ISO image in Linux, just use the command line!

mkisofs -V LABEL -r DIRECTORY | gzip > imagename.iso.gz

This should work with almost all flavors of Linux. It looks like Debian, Redhat, and Slackware based distributions all contain the command.

Nov 4

This morning I had a thought; and that thought was that I wanted to see the uptime on my web server somewhere here on the blog. As it turns out that is a very easy task with PhP.

This simple code uses the PhP exec() function to call the uptime command and echo it’s output. The only limitation you may have is if your particular webhost or server admin has the exec() function disabled for security reasons. You will likely find this is the case on a shared hosting environment. On to the code!

function linuxUptime() {
$ut = strtok( exec( “cat /proc/uptime” ), “.” );
$days = sprintf( “%2d”, ($ut/(3600*24)) );
$hours = sprintf( “%2d”, ( ($ut % (3600*24)) / 3600) );
$min = sprintf( “%2d”, ($ut % (3600*24) % 3600)/60 );
$sec = sprintf( “%2d”, ($ut % (3600*24) % 3600)%60 );
return array( $days, $hours, $min, $sec );
}

$ut = linuxUptime();
echo “Server has been online for: $ut[0] days, $ut[1] hours, $ut[2] minutes, $ut[3] seconds”;
?>

Save this into a .php file on your server and include it whereever you want to display your server’s uptime. Take a look at my footer at the bottom of the page to see it in action.

Nov 4

I stumbled across this the other day while looking for a way to convert English text to another language spoken by the computer. I still haven’t found exactly what I need yet but I did find this small, simple VBScript to convert whatever you type into speach.

Dim msg, sapi
msg=InputBox("Enter your text","Tell me something good!")
Set sapi=CreateObject("sapi.spvoice")
sapi.Speak msg

Put this into a file called talk.vbs (or whatever you would like) and run it. It will show a box asking for the text and then speak what you type. Have fun!

Oct 29

Corrosion of Conformity…. one of my all-time favorite bands. Albatross…. one of my all-time favorite songs. Enough said, here it is:

Oct 29
SpeedDial

SpeedDial

I recently found a nifty little plugin for Firefox 3 called Speeddial. If you’ve ever used Opera you have at least seen this in action, but the Firefox plugin has much more bells and whistles.

You can find this addon at the offical Firefox site here. This plugin allows you to configure a speed dial page with live tabs, groups, and custom colors.

I highly recommend this plugin if you spend a lot of time jumping between multiple sites.

Oct 29

MTV has launched at new site at MTVMusic.com with over 16,000 music videos available for free. The site is pretty much gone right now due to the publicity from the major blogs but I did have a chance to try out two videos before the player stopped working and it seemed to work great. They also have a developer API kit to allow you to use the MTV content in your own projects. Looks like a new wave of embedded Rick Rolls coming soon!

Pretty shocking news for someone like me that hasn’t watched MTV since the 90’s……. when they still had music. ;)

Oct 27

I originally wrote this for another blog a couple of years ago but that blog has since ceased to exist. I figured I would rewrite it here since it’s still interesting to many and I still have to perform these tasks almost weekly to prove 802.11 vulnerablilities to my clients.

*** Disclaimer: If you use this information for malicious acts, you will go to jail. Plain and simple. ***

To begin I would like to recommend a particular Linux distribution for pentesting, BackTrack. I have been using BackTrack since the first alpha phase and I haven’t been able to replace it yet. You do not need BackTrack to perform the tasks below however it does make it easy since everything is already built in. We will be using the AirCrack-NG tools for this particular pentest.

Lets get started after the jump. Read the rest of this entry »

« Previous Entries