官术网_书友最值得收藏!

  • Learn Penetration Testing
  • Rishalin Pillay
  • 201字
  • 2021-06-24 14:09:13

Scripting in Kali Linux

Kali Linux is relatively verbose—you can leverage bash scripting to create complex scripts, which you can then leverage for penetration testing.

A sample script that performs a Nmap scan is as follows:

read -p "Target IP/Range: " $targetIP
echo "$targetIP"
Nmap -sS -O -v "$targetIP"

In this script, we are telling the system to print out the read -p "Target IP/Range: text, which we tie to the variable of $targetIP. In the next line, we are displaying the IP range using the echo command, which is passed as an argument. In the last line, we perform a simple Nmap scan, using the switches of -sS, which performs a TCP SYN port scan; the -O, which performs remote operating system detection; and -vwhich increases the verbosity level, as shown in Figure 23:

Figure 23: A sample Nmap script

During the course of this book, we will explore additional scripts (for example, in Chapter 3, Performing Information Gathering, using a script to search Shodan, and more). As you progress on your penetration testing journey, you will likely develop your own useful list of scripts.

主站蜘蛛池模板: 石柱| 福海县| 大同县| 隆尧县| 八宿县| 宾川县| 洪江市| 陇川县| 天镇县| 清河县| 丰都县| 南江县| 忻城县| 嘉善县| 文水县| 合阳县| 濉溪县| 滦南县| 汉中市| 宜春市| 宿迁市| 惠东县| 吉林市| 天全县| 民和| 桑植县| 裕民县| 依兰县| 安图县| 龙井市| 班戈县| 宜兰县| 滨州市| 九江市| 苗栗市| 平泉县| 辛集市| 南投市| 岳普湖县| 涿州市| 政和县|