Monday, 15 August 2011

PAM Basics for Linux

PAM [Pluggable Authentication Module] for Linux is used by Admins to choose how applications authenticate users.

To accomplish this PAM provides a library of functions, that Admins can use for user authentication with an application.

It can be said that PAM is the glue between authentication methods [eg one-time pwds, kerberos, smart cards] and applications requiring authentication services [eg ftpd, sshd, imapd] etc. It is another layer on 1st-Level defence in Linux.

PAM Basics for Fedora 14


PAM Manual :- /usr/share/doc/pam-1.1.1/html/Linux-PAM_SAG.html

Files in 4 dirs concern us :-

    /lib/libpam*       ->    PAM System Libs
    /lib/security/.so  ->    PAM Loadable Modules [PLM]
    /etc/pam.d/      
    /etc/security/     ->    6 .conf files and some other files/dirs

PAM Config File :- /etc/pam.d/login

module-type      control-flag      module-path                           [args]
=========  ===========   ==========                       ======         
auth               required           defaults to /lib/security/*.so     debug
account         requisite                                                            no_warn
password      sufficient                                                           use_first_pass
session          optional                                                             try_first_pass
                                                                                                expose_account

                Module Types
              ============

  1. auth :    Serves 2 fns - first authenticating users to be who they claim to be, and second allowing other privileges to be granted to the users

  2. account : Provides account-mgmt options not related to authentication. Typically used to restrict based on factors such as origin [eg only non-root users allow remote login, or time of day]

  3. password: Called only when updating the auth token associated with the user

  4. session : Tasks to be performed before/after the user is allowed access.

Monday, 8 November 2010

VMWARE


Why VMware ?

There are many reasons for using VMware.
Primarily as hackers we want to be able to protect ourselves from other hackers at all times.
The other reason being that as hackers we would be doing a lot of experimenting and using a lot of software that might not be tested properly. So, basically to protect our PCs from these threats we can use VMware.

Advantages:-
  1. Network Isolation :- Hide from other hackers. We can configure VMware to communicate only to a specific machine, while performing some isolated tasks.
  2. Hardware Consolidation :- VMware is a good choice instead of spending time and money on different physical computers. Different virtual machines can run on the same host OS, that means we can have more than one Guest OS running on our PC.
  3. Performance :– Virtual Machines run simple and common tasks pretty well. Shared resource enhances performance of the physical computer also.
  4. Testing :-  Usually production work is not done on virtual machines. It is used mostly for different tools and experimenting with them, thus if something goes wrong, we can isolate any damage that can happen.
  5. Snapshots :-Snapshot is a feature of VMware. Snapshot is like a backup of the machine. Just like rollback, snapshot takes the machine to a previous saved state. So, if accidently the machine crashes or loses some system files, then we can restore the machine from the snapshot saved previously.
  6. Pause/Resume :- VMWare also comes with the feature where you can pause the Guest OS and then resume it later from the same state.
 
  1.  Download :- www.vmware.com VMware Player is free, while VMware Workstation requires license and is also available as an evaluation version. VMware Player comes with less features than VMware Workstation. Registration is required for downloading the software.
  2. Install :- Installation is a simple next-next process. Installation options for network are:
    a)      Bridged networking – It gives the same direct access as physical network to the guest OS.  Each guest OS will have an IP address of its own.
    b)      NAT  - Host OS will have the physical IP on network. And guest OS will have private IP, they can connect to the network through the host IP.
    c)       Host only - Guest OSs will be able to connect to each other but not even the host or the network.
    d)      No connection
  3.  Host OS is the main OS running on the physical machine. 
  4.  Guest OS is the OS running on a virtual machine. 
  5.  VMWare Tools :-  VMware Tools can be installed after the guest OS is installed. It adds some extra features, such as moving the mouse easily from guest to host.
  6. Changing Views :- There are a variety of options that VMware guest OS can be viewed in. 

Introduction to Wireless LAN Principles

PART I

1) Wireless Spectrum
2) Frequency
3) Amplitude
4) Free Path Loss Model
5) Absorption
6) Reflection
7) MultiPath

1) WIRELESS SPECTRUM
RF Bandwidth:-
* Bandwidth is what we get is accomplished by emitting data as electronic signals, and we place data on these RF signals by using Modulation Techniques. Modulation is the process of adding data to the carries signal.

* Spread Spectrum is method for modulation. It is used by ISM BANDS.
ISM BANDS :- Unlicensed Industrial, Scientific and Medical Bands (900MHz-2.4GHz) 
(5GHz - Unlicensed National Information Infratructure [UNII BAND])

* B/W means of acutal DATA RATE or [Width of RF Channel] --> For us

* B/W is measured in Hertz = Cycles per sec

* Radio Waves :-  Are used to send infiormation in a wide variety of fashion (eg. AM, FM).
It is elctromagnetic field that radiates from the sender, and propogates to the reciever
that revieves the energy.

* Hz expreses how often a wave happenes. Cycles per second
Wave Category :-  Lowest -> Sonic
Higest -> Gamma Ray
900MHz - 5Ghz -> Wireless


2) FREQUENCY - How often a signal is seen ?
   
* Wavelength - The distance the signal travels in a single cycle
Shorter wavelength signal has more freqency, since it travels more times in a second than signal with longer wavelength.

Eg:- 6 cycles/sec = 6Hz
Lower freq signals travels farther than higher freq.

RF signals are generated by Transmitter, sent through a cable to an antenna,
where it is radiated in the form of electromagnetic wireless signals.

Impact of obstacle on a signal depends wavelength and also the obstacle.


3) AMPLITUDE

This is the strength of the signal. Level of energy injected into 1 cycle. More energy -> Higher Amplitude
Height or vertical distance between the crest of signal. Y -> Gamma
       
           Active -> Increasing the amplitude
              /
i) Amplification 
   -------------
              \
           Passive -> done by focusing the energy into a single direction by a special antenna

ii) Attenuation --> Decreasing the amplitude
    -----------

Amplitide Modulation (AM) - Amplitude that is modified dynamically by transmitter
Frequncy Modulation (FM) - Modifying  the frequency of signal to encode the information  


4) FREE PATH LOSS
 
Amount of energy is going to decrease as the distance increases for the signal.
Quantity of energy available at each point is going to be less the farther out you get.
This wave propogation attenuation.

The loss of energy is simply due to the distance (since energy is dispersed), and not because of any obstacle blocking the signal.


5) ABSORPTION
   
Absorption is going to take energy from this wave.
Energy is dissipited as heat from the object. Frequency stays same


6) REFLECTION
Wave bounces uniformly out of a regular flat surface, paritally reflect and absorb the signal
Reflection depends on the frequncy and the angle of signal.


7) Multi-Path
   
Multi-path happens when a signal is going to reflect off of surfaces.
So, delayed multiple copies of the same signal is hitting the reciever.
This makes the signal weak.


PART II


1) Scattering
2) Refraction
3) Line of Sight (LOS)
4) Fresnel zone
5) RSSI
6) SNR

1) Scattering
  
Scattering will have an effect on the signal quality, coz the recieved result of the signal is going to be weaker,
coz some of it was send in other directions along the path, and also because of the attenuation.
Caused by :- dust, humidity (water), surface, humans, leaves etc

Its effect depends on frequency.
Two major effects are :-
i) Degradtion of wave strength and quality of the signal
ii) Uneven signal quality


2) Refraction  

Mostly occurs outdoors (not much indoor).
Refraction happens when wave changes direction (from one medium to another).


3) Line of Sight (LOS)
  
A building or wall might cause absorption hence attenuation, that may prevent the comm.
At 6 feet the horizon appears at 10KMs.


4) Fresnel zone  
Augustine Fresnel was a physicist.

60% of the 1st zone of the Fresnel Zone should be interference free (80% recommended).
Mainly for outdoors.


5) RSSI  
Recieved Signal Strength Indicator (Unit -> dBm)

We express RSSI as a relative value determined by the recieving LAN Card.
It is a grade value between 0-255

It is used to compare the signal to itself in different locations.
Typically expressed as a -ve value. The closer to zero, the better.


6) SNR
  
Signal to Noise Ratio.

It tells us how much stronger the signal is than the noise.
The more the better.


* LINK BUDGET  
The accumulation of all of the losses from the sender to the recievers transmitter.
It tells us how much power we need to send for the reciever to interpret it.
Applied only for outdoor networks.