Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kali Linux 2 ??? Assuring Security by Penetration Testing

You're reading from   Kali Linux 2 ??? Assuring Security by Penetration Testing Achieve the gold standard in penetration testing with Kali using this masterpiece, now in its third edition!

Arrow left icon
Product type Paperback
Published in Sep 2016
Publisher Packt
ISBN-13 9781785888427
Length 572 pages
Edition 3rd Edition
Arrow right icon
Authors (4):
Arrow left icon
Tedi Heriyanto Tedi Heriyanto
Author Profile Icon Tedi Heriyanto
Tedi Heriyanto
Gerard Johansen Gerard Johansen
Author Profile Icon Gerard Johansen
Gerard Johansen
Lee Allen Lee Allen
Author Profile Icon Lee Allen
Lee Allen
Shakeel Ali Shakeel Ali
Author Profile Icon Shakeel Ali
Shakeel Ali
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Beginning with Kali Linux FREE CHAPTER 2. Penetration Testing Methodology 3. Target Scoping 4. Information Gathering 5. Target Discovery 6. Enumerating Target 7. Vulnerability Mapping 8. Social Engineering 9. Target Exploitation 10. Privilege Escalation 11. Maintaining Access 12. Wireless Penetration Testing 13. Kali Nethunter 14. Documentation and Reporting A. Supplementary Tools B. Key Resources Index

Network services in Kali Linux

There are several network services available in Kali Linux; in this section, we will describe only some of them: the HTTP, MySQL, and SSH services. You can find the other services by navigating to Kali Linux | System Services.

HTTP

In your penetration testing work, you may want to have a web server for various reasons, such as to serve malicious web application scripts. In Kali Linux, there is already an Apache web server installed; you just need to start the service.

The following are the steps that are required to activate your HTTP server in Kali Linux:

  1. To start the Apache HTTP service, open a command line terminal and type the following command to start the Apache server:
    service apache2 start
    
  2. After this, you can browse to the web page at 127.0.0.1; it will display the It works! page by default:
    HTTP

To stop the Apache HTTP service, perform the following steps:

  1. Open a command line terminal and type the following command to stop the Apache server:
    service apache2 stop
    

    Note

    Remember that the previous command will not survive the boot up. After the boot up, you need to give the command again. Fortunately, there is a way to start the Apache HTTP service automatically after the Kali Linux boots up by giving the following command:

    update-rc.d apache2 defaults

    The command will add the apache2 service to be started on boot up.

MySQL

The second service that we will discuss is MySQL. It is one of the relational database systems. MySQL is often used with the PHP programming language and Apache web server to create a dynamic, web-based application. For the penetration testing process, you can use MySQL to store your penetration testing results; for example, the vulnerability information and network mapping result. Of course, you need to use the application to store those results.

To start the MySQL service in Kali Linux, you can perform the following steps:

  1. In a terminal window, type the following:
    service mysql start
    
  2. To test whether your MySQL has already started, you can use the MySQL client to connect to the server. We define the username (root) and the password to log in to the MySQL server:
    mysql -u root
    

    The system will respond with the following:

    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 39
    Server version: 5.5.44-1 (Debian)
    Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type ''help;'' or ''\h'' for help. Type ''\c'' to clear the current input statement.
    mysql>
    
  3. After this MySQL prompt, you can give any SQL commands. To exit from MySQL, just type quit.

Note

By default, for security reasons, the MySQL service in Kali Linux can be accessed only from a local machine. You can change this configuration by editing the bind-address stanza in the MySQL configuration file located in /etc/mysql/my.cnf. We don't recommend that you change this behavior unless you want your MySQL to

To stop the MySQL service, you can perform the following steps:

  1. In a terminal window type the following:
    service mysql stop
    
  2. To start the MySQL service automatically after Kali Linux's boots up, you can give the following command:
    update-rc.d mysql defaults
    

    This command will make the MySQL service start after the boot up.

SSH

For the next service, we will look into the Secure Shell (SSH). SSH can be used to log in to a remote machine securely; apart from that, there are several other usages of SSH, such as securely transferring a file between machines, executing a command in a remote machine, and X11 session forwarding.

To manage your SSH service in Kali Linux, you can perform the following steps:

  1. To start the SSHD service, from the command line, type the following:
    service ssh start
    
  2. To test your SSH, you can log in to the Kali Linux server from another server using a SSH client such as putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) if you are using the Microsoft Windows operating system.
  3. To stop the SSHD service, from the command line, type the following:
    service ssh stop
    
  4. To start the SSH service automatically after Kali Linux boots up, you can give the following command:
    update-rc.d ssh defaults
    

This command will add the SSH service to be started on boot up.

You have been reading a chapter from
Kali Linux 2 ??? Assuring Security by Penetration Testing - Third Edition
Published in: Sep 2016
Publisher: Packt
ISBN-13: 9781785888427
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime