Professional Documents
Culture Documents
1. ifconfig
ifconfig (interface configurator) command is use to initialize an interface, assign IP
Address to interface andenable or disable interface on demand. With this command
you can view IP Address and Hardware / MAC address assign to interface and
also MTU (Maximum transmission unit) size.
# ifconfig
eth0Linkencap:EthernetHWaddr 00:0C:29:28:FD:4C
inet addr:192.168.50.2Bcast:192.168.50.255
Mask:255.255.255.0
inet6addr:fe80::20c:29ff:fe28:fd4c/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
loLinkencap:LocalLoopback
inetaddr:127.0.0.1Mask:255.0.0.0
inet6addr:::1/128Scope:Host
ifconfig with interface (eth0) command only shows specific interface details like IP
Address, MAC Address etc. with -a options will display all available interface details
if it is disable also.
# ifconfig eth0
eth0Linkencap:EthernetHWaddr00:0C:29:28:FD:4C
inetaddr:192.168.50.2Bcast:192.168.50.255
Mask:255.255.255.0
inet6addr:fe80::20c:29ff:fe28:fd4c/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
# ifdown eth0
Setting MTU Size
By default MTU size is 1500. We can set required MTU size with below command.
Replace XXXX with size.
# ifconfig eth0 mtu XXXX
Set Interface in Promiscuous mode
2. PING Command
PING (Packet INternet Groper) command is the best way to test connectivity
between two nodes. Whether it isLocal Area Network (LAN) or Wide Area
Network (WAN). Ping use ICMP (Internet Control Message Protocol) to communicate
to other devices. You can ping host name of ip address using below command.
# ping 4.2.2.2
PING4.2.2.2(4.2.2.2)56(84)bytesofdata.
64bytesfrom4.2.2.2:icmp_seq=1ttl=44time=203ms
64bytesfrom4.2.2.2:icmp_seq=2ttl=44time=201ms
64bytesfrom4.2.2.2:icmp_seq=3ttl=44time=201ms
21b.resolvers.Level3.net(4.2.2.2)199.725ms199.190ms202.488
ms
4. NETSTAT Command
Netstat (Network Statistic) command display connection info, routing table
information etc. To displays routing table information use option as -r.
# netstat -r
KernelIProutingtable
DestinationGatewayGenmaskFlagsMSSWindow
irttIface
192.168.50.0*255.255.255.0U00
5. DIG Command
Dig (domain information groper) query DNS related information like A
Record, CNAME, MX Record etc. This command mainly use to
troubleshoot DNS related query.
# dig www.tecmint.com;<<>>DiG9.8.2rc1RedHat9.8.20.10.rc1.el6
<<>>www.tecmint.com
;;globaloptions:+cmd
;;Gotanswer:
;;>>HEADER<
HOSTNAME Command
hostname is to identify in a network. Execute hostname command to see the
hostname of your box. You can set hostname permanently in /etc/sysconfig/network.
Need to reboot box once set a proper hostname.
# hostname
tecmint.com
13. GUI tool system-config-network
Type system-config-network in command prompt to configure network setting and
you will get nice Graphical User Interface (GUI) which may also use to configure IP
Address, Gateway, DNS etc. as shown below image.
# system-config-network
kill
signal to a process or to kill a process. We typically use kill -SIGNAL PID, where you know the PID of the
process.
The options to the kill command are:
Signal Name
Description
SIGNULL
SIGHUP
SIGNINT
SIGQUIT
SIGKILL
24
SIGSTOP
26
SIGCONT
$ ps -e
1986 ?
Sl
7:22 /usr/lib/firefox-3.5.3/firefox
$ kill -9 1986
4529
657
Jul 20 ?
0:06 /usr/local/sbin/sshd -R
....
....
The second field in the output is the process Id. Here the /usr/local/sbin/sshd -R is running with the process id
4529.
Killing a process.
To kill processes simply pass the process id to the kill command. This is shown below:
kill 4529
Forcefully killing a process.
Use the -9 option with the kill command to kill a process force fully. The following kill command terminates the
process forcefully:
kill -9 1567
kill -SIGKILL 1567
kill -KILL 1567
kill -s SIGKILL 1567
kill -s KILL 1567
DHCP
One way is to manually configure network interface and assign an IP address by
hand. This is called static configuration which means that host's IP address will
never change until changed manually again by user or system administrator. If
company's network includes more than 1000 hosts this job of setting up each
individual host with static IP address will become tiresome and more importantly
inefficient.
Dynamic Host Configuration Protocol (DHCP) automatically assigns IP
OpenVAS
OpenVAS (Open Vulnerability Assessment System, the name of the fork originally known as GNessUs)
is a framework of several services and tools offering a vulnerability scanning and vulnerability
management solution. All OpenVAS products are Free Software.
The OpenVAS Manager is the central service that consolidates plain vulnerability scanning into a full vulnerability
management solution. The Manager controls the Scanner via OTP (OpenVAS Transfer Protocol) and itself offers
the XML-based, stateless OpenVAS Management Protocol (OMP). All intelligence is implemented in the Manager
so that it is possible to implement various lean clients that will behave consistently e.g. with regard to filtering or
sorting scan results. The Manager also controls a SQL database (sqlite-based) where all configuration and scan
result data is centrally stored. Finally, Manager also handles user management includiung access control with
groups and roles.
Different OMP clients are available: The Greenbone Security Assistant (GSA) is a lean web service offering a
user interface for web browsers. GSA uses XSL transformation stylesheet that converts OMP responses into
HTML.
Feature overview
OpenVAS Scanner
o
OpenVAS Manager
o
Scheduled scans
Reports Format Plugin Framework with various plugins for: XML, HTML, LateX,
etc.
User Management
Feed synchronisation
Web server on its own (microhttpd), thus no extra web server required
Multi-language support
...
OpenVAS CLI
o
Shell Scripts:
i. The basic concept of a shell script is a list of commands, which are listed in
the order of execution. A good shell script will have comments, preceded by a
pound sign, #, describing the steps.
ii. There are conditional tests, such as value A is greater than value B, loops
allowing us to go through massive amounts of data, files to read and store
data, and variables to read and store data, and the script may include
functions.
iii. The shell is, after all, a real programming language, complete with variables,
control structures, and so forth. No matter how complicated a script gets,
however, it is still just a list of commands executed sequentially