5 Cents tip for today [ Portscanner ]
Posted: Sat Feb 28, 2004 1:24 pm
;; Quick and dirty portscanner on tcp
;; because there is no timeout regulation for remote portsscan
;; it could take ages to return nil or true
;; the timeout depends on the remote tcp socket behaviour.
;;
(define (scan host startport endport )
(set 'cnt startport )
(until (> cnt endport)
(println "Scanning - " host " -")
(if (set 'scanned (net-connect host cnt ))
(begin
(println "port :" cnt " -> open")
(net-close scanned)))
(inc 'cnt))
)
(scan "remote.host" 4000 5500)
(exit)
;; eof ;;
;; because there is no timeout regulation for remote portsscan
;; it could take ages to return nil or true
;; the timeout depends on the remote tcp socket behaviour.
;;
(define (scan host startport endport )
(set 'cnt startport )
(until (> cnt endport)
(println "Scanning - " host " -")
(if (set 'scanned (net-connect host cnt ))
(begin
(println "port :" cnt " -> open")
(net-close scanned)))
(inc 'cnt))
)
(scan "remote.host" 4000 5500)
(exit)
;; eof ;;