shell programming (nmap)

Similar nmap shell script

Part blog I briefly introduce some automation functions under regular use cron script implementation of the system.
The mainly around the use of simple shell script function called nmap hacker "Eye of the Gods" and "(but actually written in python using nmap, here in shell on a small portion features a simple demo).
Brief under logic, nmap scan LAN memory alive host ip address is nothing more than use the ping command repeatedly to perform, you can use the cycle to achieve.
simple example:
Here Insert Picture Descriptionhere, I made use of shell programming class c programming style
first define ip fixed part, use for 15 cycles, execute the following command to do that ping ip address, plus $ variable name is equivalent to the value of the variable .echo to print, use >> redirect to the directory we want to save. of course, you can use shell inside relational operators && and || to achieve.
the results are as follows:
Here Insert Picture DescriptionHere Insert Picture Descriptionthe text in 192.168.1.1 as the gateway ip, can be ignored, and the rest is the scan results and scan nmapip very similar to it, the reason for using python useless shell of reasons it, shell python running speed is not so fast, and python modules more easily add and modify subsequent functions. next blog will introduce a python Common module and its simple example. If you need nmap usage welcome private letter!

Welcome attention, the main hacker attack and defense research and shell programming!

Released four original articles · won praise 1 · views 279

Guess you like

Origin blog.csdn.net/fsociety_h4cker/article/details/105176740