Wednesday, September 30, 2015

ETHICAL

How to Become            an Ethical Hacker?
From 1st Dec onwards

ETHICAL HACKER INTRO

ETHICAL HACKING INTRODUCTION
DEFEND YOUR NETWORK AGAINST HACKERS…..
MASTER THE HACKING TECHNOLOGIES…….
BECOME AN ETHICAL HACKER…….



An ethical hacker is a computer and networking expert who systematically attempts to gain access to a computer system or network on behalf of its owners for the purpose of finding security vulnerabilities that a spiteful hacker could potentially utilize
  
We must know the way of hacking before being an ethical hacker
O/S Hacking
Remote Connectivity and VoIP Hacking .
Network Devices Hacking. . . . . . . . . . . . . . . . . .
Wireless Hacking .
Hacking Hardware
Hacking Code . .
Web Hacking
Ports  Hacking and many more….
Hacking applications
Hacking the Users
Hacking the Databases and Storage Systems
Password Cracking

MEMORY MANAGEMENT - 3

MEMORY MANAGEMENT INTERVIEW QUESTIONS AND ANSWERS
                                                
                                              PAGE - 3


21..How to  check  the current shared memory pages on the system?

# ipcs –m

22..Where the kernel   load in to  the system to run  linux?

memory

23..How to see the memory usage in percentage?

#  free | sed -n ‘2p’ | gawk ‘x = ($3 /$2) {print x}’

24..How to  find out all the process of the system along with their process states?

ps -al

25..How to find the current virtual memory status on your system?

#  cat /proc/meminfo

26..Explain about Environment Variables?

The bash shell uses a feature called environment variables to store information
about the shell session and the working environment . This feature also allows you to store data in memory  that can be easily accessed by any program or script running from the shell.

27..How to check the extract CPU and memory information about your system?
#  uptime

28..How to extracting  system memory information?

#  vmstat

MEMORY MANAGEMENT - 2

     MEMORY MANAGEMENT INTERVIEW QUESTIONS AND ANSWERS
                                                
                                                PAGE - 2



11..How to manage the  data segment?
Linux  systems historically have provided interfaces for directly managing the data segment. However, most programs have no direct use for these interfaces because malloc( ) and other allocation schemes are easier to use and more powerful

12..How to create the anonymous memory mappings?
Use of a memory mapping over the heap for a specific allocation, or perhaps because you are writing your own memory allocation system, you may want to manually create your own anonymous memory mapping—either, way, Linux makes it easy.

13..How to debugging memory allocations?
Programs can set the environment variable MALLOC_CHECK_ to enable enhanced debugging in the memory subsystem. The additional debugging checks come at the expense of less efficient memory allocations, but the overhead is often worth it during the debugging stage of application development. You can check with the following command
$ MALLOC_CHECK_=1 ./rudder

14..How to lock the virtual memory?
A call to mlock( ) locks the virtual memory starting at addr, and extending for
Len bytes into physical memory.

15..How to lock the all address space?
A call to mlockall( ) locks all of the pages in the current process’ address space into physical memory.

16..How to unlock the memory?
The system call munlock( ) unlocks the pages starting at addr and extending for len bytes. It undoes the effects of mlock( ).

17..How to find out  the page is physical memory or not?
Linux provides the mincore( ) function, which can be used to determine whether a given range of memory is in physical memory, or swapped out to disk:

#include <unistd.h>
#include <sys/mman.h>
int mincore (void *start,
size_t length,
unsigned char *vec);

A call to mincore( ) provides a vector delineating which pages of a mapping are in physical memory at the time of the system call. The call returns the vector via vec, and describes the pages starting at start  and extending for length bytes.

Each byte in vec corresponds to one page in the range provided, starting with the first byte describing the first page, and moving linearly forward. Consequently, vec must be at least large enough to contain (length - 1 + page size) / page size bytes. The lowest-order bit in each byte is 1 if the page is resident in physical memory, and 0 if it is not. The other bits are currently undefined and reserved for future use.

18..What is Min / Max Spare Servers?
These options are used to create a pool of spare servers that Apache can use
when it is busy. Larger sites may wish to increase these numbers from their defaults. However, for each spare server, more memory is required on  the server.

19..What is memory optimizations?
User-space code and data, kernel code and data reside permanently in main
memory, so it is important to reduce memory waste in every way possible. Initialization code is a good candidate for memory optimization. Given their nature, most initialization routines are executed either just once or not at all, depending on the kernel configuration

20..What is System Memory Management?
One of the primary functions of the operating system kernel is memory management. Not only does the kernel manage the physical memory available on the server, but it can also create and manage virtual memory, or memory that does not actually exist.

It does this by using space on the hard disk, called the swap space. The kernel swaps the contents of virtual memory locations back and forth from the swap space to the actual physical memory. This allows the system to think there is more memory available than what physically exists


MEMORY MANAGEMENT - 1

  MEMORY MANAGEMENT INTERVIEW QUESTIONS AND ANSWERS

PAGE - 1


1..Which partition is used for virtual memory by a Linux system?
swap
2..How to find out the usage of memory in linux?
# free –m
# vmstat –s
# top

3..What is Swap Space?
Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.

4..How to check the information about RAM of your system?
# free

5..What is virtual address space?
Linux, a operating system, virtualizes its physical resource of memory.
Processes do not directly address physical memory. Instead, the kernel associates each process with a unique virtual address space. This address space is linear, with addresses starting at zero, and increasing to some maximum value.

6..Write the difference between  the Pages and Paging?

The virtual address space is composed of pages. The system architecture and
machine type determine the size of a page, which is fixed; typical sizes include 4 KB (for 32-bit systems), and 8 KB (for 64-bit systems).* Pages are either valid or invalid.

 A valid page is associated with a page in physical memory, or some secondary backing storage, such as a swap partition or a file on disk. An invalid page is not associated with anything and represents an unused, unallocated piece of the address space.
Accessing such a page causes a segmentation violation. The address space is not necessarily  contiguous. While linearly addressed, it contains plenty of unaddressable  gaps.

7..What is memory region?
The kernel arranges pages into blocks that share certain properties, such as access permissions. These blocks are called memory regions, segments, or mappings.

8..How to allocate dynamic memory?
Memory also comes in the form of automatic and static variables, but the foundation of any memory management system is the allocation, use, and eventual return of dynamic memory. Dynamic memory is allocated at runtime, not compile time, in sizes that may be unknown until the moment of allocation

9..How to free the dynamic memory?
Automatic allocations, which are automatically reaped when the stack
unwinds, dynamic allocations are permanent parts of the process’ address space until they are manually freed

10..How to allocate the aligned memory?
Most part, the compiler and the C library transparently handle alignment
concerns. POSIX decrees that the memory returned via malloc( ), calloc( ), and
realloc( ) be properly aligned for use with any of the standard C types. On Linux,

these functions always return memory that is aligned along an 8 byte boundary on 32-bit systems and a 16 byte boundary on 64-bit systems.

REMOTE ACCESS - 2

       REMOTE ACCESS INTERVIEW QUESTIONS AND ANSWERS 

                                            PAGE - 2



11..How to connect the binary  mode in ftp?
  
ftp> binary The FTP

12..How to send the particular file in ftp?

ftp> put  source_name

13..How to find out the local directory?

ftp>  lpwd.

14..How to copy the particular  file in ftp?

ftp> get  source_file_name    target_file_name
15..How to use FTP mget without prompt?
ftp -i hostname
( Use the -i when starting the ftp and it will turn that off )

16..How can I transfer a group of files without typing  all their names?
ftp>  mput file_name*

The asterisk (*) is a wildcard that tells FTP to match all files starting with fi
17..How to upload the file in ftp?
ftp> put file_name
18..How to logout from ftp connection?
ftp>  bye
or

ftp> quit

REMOTE ACCESS - 1

      REMOTE ACCESS INTERVIEW QUESTIONS AND ANSWERS 

                                            PAGE - 1



1..What is ssh?
Connecting to another machine on the Internet is a risky proposition. Some tools, like ftp and telnet, that provide access to another machine transmit the username and password in clear text

SSH is one such program. It's name is an acronym for “Secure SHell”. SSH has to run both on the machine you're using  and the machine you're connecting to  SSH runs on the remote machine just like any other Linux service, and is initiated by you on the client in order to connect to the remote machine

2..How to connect the remote system using ssh?
SSH (the server) must be running on the remote machine, and you need to know the IP address or URL of the remote machine. The remote machine needs to be able to accept requests on port 22, the port used by SSH.

3..How to use the public/private keys to connect  the remote  server?
Public key authentication involves a pair of related keys that in this situation take the form of text files. The public key sits on the remote machine while the private key resides on the local  machine. When the local machine connects to the remote box, the two keys are matched up by the remote machine. If they match correctly, the authentication passes and you are granted access.

4...How to create  public and private keys?

 ssh-keygen -t rsa

5..What is the use of  ftp?

The File Transfer Protocol (FTP) is a standard network protocol used to transfer computer files from one host to another host over a TCP-based network, such as the Internet

6..Explain  ssh client?
There are n number of ssh client programs: slogin, scp, and ssh. They each read the same configuration file, usually called /etc/openssh/ssh_config
  
7..How many types of the   file  available in  ftp?

There are two types of files. An ASCII file contains text; a binary file contains other kinds of information (such as graphics, audio recordings, or compressed text).

8..How to connect the ascii mode?
  
ftp> ascii
     
9..How to copy the particular file in ftp?
  
ftp> get source_name

10..How to see the list of files in ftp?

 ftp> ls

MAIL Q & A PAGE - 2

                 MAIL INTERVIEW QUESTIONS AND ANSWERS 

                                            PAGE - 2



11..How to make copy of the all mails from mydomain.com  received by   user1 ?
 vi /etc/mail/virtusertable          @mydomain.com           user1
:wq!
 # service sendmail restart

 12..How to make copy of the all mails from mydomain.com  received by   user1 ?
 vi /etc/mail/virtusertable          @mydomain.com           user1
 :wq!
 # service sendmail restart


13.. How to manage the mail spool?
Mail is queued in the /var/spool/mqueue directory before beingtransmitted. This
directory is called the mail spool. The sendmail program provides the mailq command as a means of displayinga formatted list of all spooled mail messages and their status. The /usr/bin/mailq command is a symbolic link to the sendmail executable and behaves identically to:

# sendmail –bp

14.. What is  mail Statistics?
sendmail collects data on the volume of mail traffic and some information on the
hosts to which it has delivered mail. There are two commands available to display this information, mailstats and hoststat.

15..What is the use of mailstats command?

The mailstats command displays statistics on the volume of mail processed by sendmail.


MAIL Q & A PAGE - 1

                  MAIL INTERVIEW QUESTIONS AND ANSWERS 

                                            PAGE - 1



1..What is E-Mail?
Electronic mail transport has been one of the most prominent uses of networking
since networks were devised. Email started as a simple service that copied a file from one machine to another and appended it to the recipient’s mailbox file. The concept remains the same, although an ever-growing net, with its complex routing requirements  and its ever increasing load of messages, has made a more elaborate scheme necessary

2..Explain the meaning of mail message?
A mail message generally consists of a message body, which is the text of the message, and special administrative data specifying recipients, transport medium, etc, similar to what you see when you look at a physical letter’s envelope.

3..Explain the mail delivery process?
We will compose mail usinga program such as mail or mailx, or more
sophisticated ones such as mutt, tkrat, or pine. These programs are called mail user agents (MUAs). If you send a mail message, the interface program will in most cases hand it to another program for delivery. This is called the mail transport agent (MTA) Mail delivered over a network using TCP/IP commonly uses Simple Mail Transfer Protocol (SMTP)

 4..Explain the Mail routing process?

The process of directing a message to the recipient’s host is called routing. Apart
from finding a path from the sending site to the destination, it involves error checking and may involve speed and cost optimization.
On the Internet, the main job of directing data to the recipient host (once it is known by its IP address) is done by the IP networking layer.

5..What is the use of mailertable?

The mailertable feature adds support to the sendmail configuration for the
mailertable. The syntax of the mailertable feature is:FEATURE(`mailertable', `specification')

6..Explain the use of virtusertable?
The send mail virtue table feature adds support for the virtual user table, where virtual email hosting is configured. Virtual email hosting allows the mail server to accept and deliver mail on behalf of a number of different domains as though it were a number of separate mail hosts

 7..E-Mail function explain?

 Sending mail via SMTP (Simple Mail Transfer Protocol) and receiving mail from an ISP's POP (Post Office Protocol) server, you can use a desktop client like Netscape Communicator or KDE kmail. You will need to enter the names of the SMTP and POP servers in the preferences of the respective application, as well as your E−mail address (e.g., username@example.com), and your dial−up password. The same applies to Usenet News. Enter the name of the NNTP (Network News Transfer Protocol) server in your News client's preferences section. You may also have to provide the IP addresses of the ISP's primary and secondary name servers.

If you have a traditional MTA (Mail Transport Agent) like Sendmail, Smail, qmail,  You'll need to follow the instructions in each package. Basically, configuration entails determining which host machine, either on your local LAN or via dial−up Internet, is the ``Smart Host,'' if you're using SMTP. If you're using           the older UUCP protocol, then you'll need to consult the directions for configuring UUCP, and also make sure that your ISP's system is configured to relay mail to you.

8..What does mean an open mail relay server?
An Open mail relay server, means that this is a server that everyone can send emails through it without the need to identify first or be a part of the domain group

9..What is the purpose of an exim service on a server?

The exim service is an SMTP service that can replace the regular sendmail service that comes with the Linux installation

10..How can you check the mail queue of an exim mail server?
#  mailq

SAMBA Q & A PAGE - 1

               SAMBA INTERVIEW QUESTIONS AND ANSWERS 

                                            PAGE - 1



1..What is Samba?
Samba is a suite of Unix applications that speak the SMB (Server Message Block) protocol. Many operating systems, including Windows and OS/2, use SMB to perform client-server networking. By supporting this protocol, Samba allows Unix servers to get in on the action, communicating with the same networking protocol as Microsoft Windows products.

2..What is SWAT?
Samba Web Administration Tool (SWAT) is used to simplify administration and configuration of Samba

3..How to prevent the  browsing?
You can restrict a share from being in a browse list by using the browseable option. This boolean option prevents a share from being seen in the Network Neighborhood at all. For example, to prevent the[data] share from the previous chapter from being visible, we could write:

[data]
            path = /home/samba/data
            browseable = no
            guest ok = yes
            comment = Data Drive
            volume = Sample-Data-Drive
            writeable = yes

4..What is the use of  samba?
You don't want to pay for - or can't afford - a full-fledged Windows NT server, yet you still need the functionality that one provides.
You want to provide a common area for data or user directories in order to transition from a Windows server to a linux one, or vice versa.
You want to be able to share printers across both Windows and linux workstations.
You want to be able to access NT files from a linux server.

5..How Can I Get Samba?
Samba is available in both binary and source format from a set of mirror sites across the Internet. The primary home site for Samba is located at http://www.samba.org/.

6..How  to install samba?
#    yum -y install samba


7..What are the SAMBA server Types ?
 Primary Domain Controller (PDC)
 Backup Domain Controller (BDC)
 ADS Domain Controller

8..How  to find out the users  currently locked to the files?
 # smbstatus

9..What is the use of "smbclient" command?
"smbclient" is used to display the list of shares on your server.
 smbclient -L localhost –N

10..How to take the print   from  window to shared printer  in linux server?

vi /etc/samba/smb.conf [global]
netbios name=station? workgroup = mygroup
server string=Share from Linux Server security=user
smb passwd file=/etc/samba/smbpasswd encrypt passwords=yes
[data]
path=/data
writable=yes
public=no
browsable=yes
valid users=user1 user2

smbpasswd –a user1

smbpasswd –a user2
service smb start | restart
chkconfig smb on

Samba servers helps to share the data between linux and windows. Configuration file is /etc/samba/smb.conf. There are some pre-defined section, i. global -> use to define the global options, ii. Printers -> use to share the printers, iii. homes - > use the share the user’s home directory.
/etc/printcap/  file containts all installed printer name