PHP written port query program portscanner
IF ($ SUBMIT == 1) {$ StartTime1 = Date ("H: i: S"); $ startTime2 = Time (); if ($ IP == "127.0.0.1" | $ ip == "Localhost ") {$ Ip = $ remote_addr;} $ port = expedition (" - ", $ port); if (count ($ port) == 1) {$ port = evtern (", ", $ port [0]) } Elseif ($ port)> 1) {$ a = min ($ port); $ b = 0; While (Max ($ port)> $ A-1) {$ TMPPORT [$ b] = $ A IF ($ B> 100) {Print "Do Not Scan More Than 100 Ports (Bandwidth Purposes"; exit;} $ A ; $ B ;} $ port = $ tmport;} $ a = 0; $ b = 0 $ Count = count ($ port); print "
Scanning: $ ip td> tr>; while ($ b <$ count) {$ fp = Fsockopen ($ IP, $ Port [$ B], & $ Errno, & $ Errstr, 30); if (! $ fp) {print " | |
Closed: td> | $ port [$ b] td> tr> ";} else {print" |
Opened: td> | $ port [$ b] td> < / TR> ";} $ b ;} print" table> "; $ endtime1 = d ATE ("H: I: S"); $ endtime2 = time (); $ TOTALSEC = $ endtime2- $ starttime2; if ($ TOTALSEC == 0) {$ TOTALSEC = 1;} $ portcount = count ($ port) ; $ pps = $ portcount / $ totalsec; print " Script started at: $ starttime1 and finished at: $ endtime1 Script took: $ totalsec seconds to complete Ports per second: ";} else {print" |