From 1b2f83f0fbb635de96b7807dc3bb639ffe158b5c Mon Sep 17 00:00:00 2001 From: William DURAND Date: Wed, 6 Nov 2013 00:16:33 +0100 Subject: [PATCH] Add more doc --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5230021..3795b39 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,50 @@ Usage $hosts = Nmap::create()->scan([ 'williamdurand.fr' ]); $ports = $hosts->getOpenPorts(); +``` + +You can specify the ports you want to scan: + +``` php +$nmap = new Nmap(); + +$nmap->scan([ 'williamdurand.fr' ], [ 21, 22, 80 ]); +``` + +**OS detection** and **Service Info** are disabled by default, if you want to +enable them, use the `enableOsDetection()` and/or `enableServiceInfo()` methods: + +``` php +$nmap + ->enableOsDetection() + ->scan([ 'williamdurand.fr' ]); + +$nmap + ->enableServiceInfo() + ->scan([ 'williamdurand.fr' ]); + +// Fluent interface! +$nmap + ->enableOsDetection() + ->enableServiceInfo() + ->scan([ 'williamdurand.fr' ]); +``` + +Turn the **verbose mode** by using the `enableVerbose()` method: + +``` php +$nmap + ->enableVerbose() + ->scan([ 'williamdurand.fr' ]); +``` + +For some reasons, you might want to disable port scan, that is why **Nmap** +provides a `disablePortScan()` method. -// ... +``` php +$nmap + ->disablePortScan() + ->scan([ 'williamdurand.fr' ]); ```