Saturday, May 12, 2012

Set Default OS in Fedora 16

This is for dual boot OS users, there are many who prefers dual boot to keep another OS optional. For any reason if you wish to change boot sequence unlike grub, grub2 requires couple of commands to run.

Here will take example to keep Windows as default boot.
First of all find menuentry for Windows

#cat /boot/grub2/grub.cfg |grep Windows
the output will be:

menuentry "Windows 7 (loader) (on /dev/sda1)" --clas-clss window -ass os {

To set Windows menuentry as default (only entry mentioned in either " or ' from above command)
I had problem using doubble quotes in the command line. The problem was resolved when in changed the keyboard type from "US" to "US(Engish)" using


#system-config-keyboard

To set Windows menuentry as default (only entry mentioned in either " or ' from above command)

#grub2-set-default "Windows 7 (loader) (on /dev/sda1)"

Verify default entry

#grub2-editenv list

Generate updated grub.cfg

#grub2-mkconfig -o /boot/grub2/grub.cfg

If you get grub error "Environment block too small" then:
#rm -rf /boot/grub2/grubenv
and then rebuild it using
#grub2-editenv /boot/grub2/grubenv create


Now follow all the above steps.

Friday, May 11, 2012

Linux Run Levels

Linux systems today generally use seven runlevels.

Runlevels define what services or processes should be running on the system.

The init process can run the system in one of seven runlevels. The system runs only one of the eight runlevels at a time.

The main runlevels are from 0 – 6. Here's what each runlevel is for:

Runlevel 0: Halt System - To shutdown the system
Runlevel 1: Single user mode
Runlevel 2: Basic multi user mode without NFS
Runlevel 3: Full multi user mode (text based)
Runlevel 4: unused
Runlevel 5: Multi user mode with Graphical User Interface
Runlevel 6: Reboot System

Runlevels 1 and 2 are generally used for debugging purposed only, and are not used during normal operations. Most desktop linux distributions boot into runlevel 5, which starts up the Graphical Login Prompt. This allows the user to use the system with X-Windows server enabled. Most servers boot into runlevel 3, which starts the text based login prompt.

Linux runlevels can be changed on the fly using the init tool. If you want to switch from text based operations to the Graphical Interface, you just have to type in 'telinit 5' in the root prompt. This will bring up the Graphical Interface in your system.

Each runlevel can be configured by the system administrator. The "/etc/inittab" file has information on which runlevel to start the system at and lists the processes to be run at each runlevel.

Each runlevel has its own directory structure where you can define the order in which the services start. These directories are located in the /etc/rc.d/ directory, under which you have rc1.d, rc2.d, rc3.d…. rc6.d directories where the number from 0 through 6 that corresponds to the runlevel.

Refer to Wiki for runlevels on different Operating Systems.

Friday, May 4, 2012

Windows Tricks: Try out..!!

In order to achieve a faster response while in all programs in the start menu, you can easily change a registry key.

XP Instructions

1. Click the "Start" button.
2. Click "run".
3. Type "regedit" without quotes and click ok.

Note you should now be in the Registry Editor.

4. Open (double click or click the + symbol) HKEY_CURRENT_USER
5. Open (double click or click the + symbol) Control Panel
6. Open (double click or click the + symbol) Desktop
7. In the right panel, find "MenuShowDelay"
8. Right click the row and click "Modify"
9. Change the value of "400" to "0" (without quotes), or whatever you want.
10. Restart your computer.

Vista / Win 7

Same as above.

#################################################

In order to achieve a faster response while in all programs in the start menu, you can easily change a registry key.

XP Instructions

1. Click the "Start" button.
2. Click "run".
3. Type "regedit" without quotes and click ok.

Note you should now be in the Registry Editor.

4. Open (double click or click the + symbol) HKEY_CURRENT_USER
5. Open (double click or click the + symbol) Control Panel
6. Open (double click or click the + symbol) Desktop
7. In the right panel, find "MenuShowDelay"
8. Right click the row and click "Modify"
9. Change the value of "400" to "0" (without quotes), or whatever you want.
10. Restart your computer.

Vista / Win 7

Same as above.

Tuesday, May 1, 2012

Botnet

"A Botnet is a collection of software agents, or robots, that run autonomously and automatically. The term is most commonly associated with malicious software, but it can also refer to a network of computers using distributed computing software."

It all starts out with the creator of the botnet, the herder. A herder is the (master)mind behind the script that is spread around, infecting hundreds, if not thousands of computers. And each infected computer is deemed a slave to said botnet, also known as a zombie.

Botnets have recently been used mainly for DDoS attacks. These attacks can be used for a number of reasons - to put a ransom on the up-time of a site (threatening to kick it offline), to collect user credentials (as many bot scripts have keylogging functions), or simply to demonstrate the power one has over the internet.

A very rapid growth in IRC bots has been present and apparent recently. Bot scripts that connect to an IRC channel on the zombie computer can take direct commands once they are in the channel.

Spreading is necessary for a botnet. Spreading techniques that are most commonly used today range from drive-by downloads to torrents, 'cracked' software to Youtube videos, and everything in-between. And often times the herder will bind his bot to the true file that he is promoting for spreading, in which case the end-user is satisfied from the download, while he also is not suspicious of it.

Once the script is downloaded, however, the road to botnet domination still is not paved in gold. This is the point in which crypters and stubs come in...

Crypters are programs that use a number of techniques in order to prevent (or 'distract'Wink anti-virus software from detecting the virus that is being spread around. When a script avoids being detected by anti-virus, it is referred to as fully undetectable (FUD).

Some methods commonly used by crypters are:

- Adding junk code for modifying execution flow and various other reasons.
- Changing strings, encrypting strings.
- Changing variable names.
- Changing the order of all code aspects.
- Changing Assembly information.
- Adding or changing the icon.

This brings us to stubs. Stubs are usually .exe files, and sometimes .dll files. Basically, how undetectable the final script executable will be depends on the stub used. Some crypters have 'Unique Stub Generators' that come pre-packaged. Unique stubs allow scripts to be FUD for longer time periods.

Once anti-virus software 'learns' the stub, your script is no longer FUD, and you must use a new (unique) stub to make your script FUD once more.

Sunday, April 29, 2012

Networking Linux and Windows with SAMBA


Purpose of this Tutorial


The purpose of this tutorial is not to scare you away from using Linux but to encourage you! I will go over the very basics of what you need to get your Linux box and your Windows machine talking seamlessly and cover what needs to be done to accomplish some very basic file sharing capabilities.

Note: This tutorial assumes that tcp/ip is installed and functioning on both the Linux and Windows machine and that all the hardware required for proper communication is configured correctly.

Part 1: What is Samba and Why do I Need It?


To answer this question we need to discuss briefly how Windows machines exchange information and share files. In a small Windows network the initial connection and session setup is handled by NetBios, (Network Basic Input Output System.) It is the job of NetBios to handle any names that need to be resolved and to make sure that all sessions are properly configured from the start and properly terminated when the connection is closed. Once a client has a NetBios session setup with the server he can than access the shared resources provided using a protocol called SMB (Server Message Block.) When a client requests a resource on the network a SMB packet is created with some of the following information.

1. Credentials. Basically your username and password. This lets the server know who you are and what your allowed to do with the resource. (Your permissions.)

and...

2. The requested resource. How the heck do you expect to get anything in return if you dont let the server know what you want?

Although theres a lot more associated with the format of an SMB packet, these are two of the big ones you need to know. Now you may be wondering, well what the heck does this have to do with sharing files with linux!? This is where Samba comes in. You can think of Samba as a unix version of Microsofts smb protocol. It emulates the protocol in such a way that it allows Linux to share files with Windows and (horrors...!) vice versa. In fact it is so effective Windows computers have no idea they're even talking to a linux machine! So to wrap this part up, Samba is the Linux implementation of the smb protocol and allows Linux and windows to share files seamlessly.

Part 2: Installing Samba


To install Samba we need to open a terminal. You can open a terminal either by going to applications--->accessories---->terminal or by switching to one of virtual terminals (ctrl - alt - f5) I prefer a virtual terminal because I am easily distracted by the gui and all of what we will be working with will be done in the shell anyways. Alright, to begin we must install samba through the aptitude package manager. At the prompt type...

    sudo apt-get install samba


You will be prompted for the root password. Enter it and the shell will tell you the size of the package and ask you if you really want to install it. hit [Y] and allow the package to install.

Part 3: Configuring Samba


Once installed a number of directories that pertain to the Samba service and configuration will be created. I will explain the ones we will be using in this section. The first and probably most important is the actual service script itself located in /etc/init.d/samba you will use this script to start, stop and restart the service.

Note: anytime you change the samba configuration you must restart the service for the changes to take effect. the commands to start, stop and restart the service are as follows...

    /etc/init.d/samba stop (stops the service)
    /etc/init.d/samba start (starts the service)
    /etc/init.d/samba restart (restarts the service)

Like alot of applications in Linux all configuration changes that will be made to Samba will be done through its configuration file smb.conf located at /etc/samba/smb.conf So lets get right into it and configure this bad boy. you can use any text editor you feel comfortable with for this step. I prefer vi because its simple and you can expect it to be installed by default on all versions of Linux.

    sudo vi /etc/samba/smb.conf

You will see a lot of information but there are only a few lines that we need to concern ourselves with for basic file sharing. These entries are as follows.

Note: Lines that begin with "#" are considered comments and are ignored by Samba. Also, I like to delete everything from this configuration file and start from scratch so that the only entries in the file are entries I actually use. Doing this makes administration a little bit simpler.

[global]
workgroup = Enter your MS workgroup here

netbios name = The netbios name the samba machine will use

server string = The name you want your server to appear as under network neighborhood

#===== Share Definitions =====
# Configure your Shares under here. You Configure shares like this....

[tmp]
comment = My shares
path = /tmp
read only = No
guest ok = Yes

    # The above share will share the /tmp directory with everybody. No user #name or password required
    # To add some basic security you can restrict access to certain users like so...

[VeronicasDir]
comment = Veronicas Stuff
path = /home/Veronica/Documents
valid users = Veronica
public = no
writable = yes

    #The above share specifies user Veronica as the only valid user able to access #the specified share. On a windows machine you will see a share called #VeronicasDir and the share will require a valid username and password #(veronicas) to access.

Note: In order for user authentication to work properly the user needs to have a valid account on the Linux system and the user needs to have an SMB password configured to work with his or her account. configuring a user account and SMB password is done by using the adduser and smbpasswd commands:

    adduser Veronica

You will be prompted to enter a UNIX password for the user and enter some basic information. Once completed assign the user an smb password:

    smbpasswd -a Veronica

Enter a password. If the user will be accessing the share from a Windows machine it would be wise to use the same username and password so no confusion on the client side will take place. After this step is completed User Veronica can now access her home directory!


Once you have the above smb.conf configuration, save the file and restart the samba service. If you entered everything correctly in the configuration and the samba service is started, you should be able to see and navigate the Linux shares from a windows computer! Congratulations you have succesfully networked Linux and Windows using samba!

Part 4: Accessing a Windows share from Linux


Ok, so we configured Linux so Windows computers can access the shares we specified but what if a Linux machine wants to obtain a resource from a Windows computer? Dont worry, we dont have to configure another text file but we do need to become familiar with the smbclient command. This command uses the smb protocol to view and navigate shares on a windows computer. It is fairly straightforward and some basic commands are as follows.

    smbclient -L host


this will list the remote shares on a windows host and looks something like this:

Domain=[HOST] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Sharename Type Comment
--------- ---- -------
My Stuff Disk Put stuff here

Once you know whats on the machine you can now connect to the share:

    smbclient \\HOST\My Stuff


Enter the proper username and password if required and happy sharing! Once your in the directory, most of the basic Linux commands work. you can type help to get a list of commands you can use to manipulate the files.

Final Notes and Some Helpful Links


This is a very basic tutorial for configuring Samba on a windows network. There is a lot you can do with Samba that is not covered here and i encourage you to pursue the options! Whatever the case I hope you found this tutorial informative and most of all i hope the tutorial worked for you! Below you will find some suggested reading that really helped me out when i first started out. Thanks for reading.

http://www.samba.org/
http://www.faqs.org/docs/securing/chap29sec284.html
http://samba.anu.edu.au/cifs/docs/what-is-smb.html

Wednesday, April 18, 2012

Wireless Networking Basics


Wireless networks are very famous for their fast and the reliable working among the people of the modern World. But the people who do not like this technology and feel jealous with it and trying to do the activities that can hack the particular network and decode all the personal information of the users on the network. Basically wireless network hacking is defined as the set of different types of techniques or the tools to hijack the network through unauthorized mean with out the permission of any body and breaks the security of the network. Hackers use different types of hacking techniques to break the security of the wireless network and decode all the information such as passwords, MAC addresses, and many more secret things.

How Hacker hack the Wireless Network? 

In the past that hacking technology was used to check the security measure either the system or the network is secured or not but nowadays people use this technology for unfair means and for hijacking purposes. There are different techniques or the methods that are used by the hackers to break the security and hack the network. But some common techniques are as follows
  • Network Enumeration
  • Wireless Network Spoofing
  • Wireless Network Probing
  • Wireless Network Sniffing

Network Enumeration:

First of all the hacking process starts with the initial step, in the first step the data and the information about the wireless network is collected wit the help of any possible way , that phenomenon is referred to as the network enumeration. Hackers use different types of applications or the software to collect the important information about the network. Some of the important applications used by the hackers to hack the wireless networks are WarXing that operates with the help of computer or the laptops. Some other applications such as Kismet or network stumbler also used for the same purpose.

Wireless Network Spoofing:

It is the type of technique that is used by the hackers to crack the security and hack whole wireless networking system. It is the very strong technique that is used by the attackers to attack on the both wired and the wireless networks security and hijack them. In this technique hackers use different types of applications and the software to locate and identify the different types of addresses pf the network such as IP or MAC by filling the particular fields with the addresses. There are different types of spoofing in which the hackers deals with the specific addresses such as MAC spoofing, IP spoofing and frame spoofing

Wireless Network Sniffing:

An important technique used by the hackers to hack the wireless networks is the wireless network sniffing. In this process sniffer is used, sniffer is the program that is used by the hackers to breaks and decodes the secret information of the wireless network traffic broadcasting. Through this program hackers are also able to hijack the wired networks also. But sniffing of the wireless networks is quite easy and convenient for the hackers as compared to the wired networks.

Wireless Network Probing:

If some amount of information is missing after spoofing and sniffing of the networks then the hackers try to use the wireless network probing technique. In this technique hackers construct the artificial data packets and spread them over the network and attacks on the specific target. It is called as wireless network probing.

Prevention of Wireless Network Hacking:

Where there are different techniques to hack the wireless networks, some protection techniques are also used which are as follows
  • By encryption of the wireless traffic of wireless networks
  • Password protections
  • Change the default name and password of SSID