11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 16 • NETWORKINGwww.it-ebooks.info$target = "www.example.com";echo "";system("/usr/bin/nmap $target");echo "";// Kill the tasksystem("killall -q nmap");A snippet of the sample output follows:Starting Nmap 5.00 ( http://nmap.org ) at 2010-05-17 17:24 EDTInteresting ports on www.example.com (192.0.32.10):Not shown: 995 filtered portsPORT STATE SERVICE21/tcp closed ftp43/tcp closed whois53/tcp closed domain80/tcp open http443/tcp closed httpsNmap done: 1 IP address (1 host up) scanned in 6.06 secondsCreating a Sub<strong>net</strong> ConverterYou’ve probably at one time scratched your head trying to figure out some obscure <strong>net</strong>workconfiguration issue. Most commonly, the culprit for such woes seems to center on a faulty or anunplugged <strong>net</strong>work cable. Perhaps the second most common problem is a mistake made whencalculating the necessary basic <strong>net</strong>work ingredients: IP addressing, sub<strong>net</strong> mask, broadcast address,<strong>net</strong>work address, and the like. To remedy this, a few <strong>PHP</strong> functions and bitwise operations can becoaxed into doing the calculations for you. When provided an IP address and a bitmask, Listing 16-3calculates several of these components.Listing 16-3. A Sub<strong>net</strong> ConverterIP Address:...Sub<strong>net</strong> Mask:346

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!