-
-
Save firephil/7947631 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package portScan | |
object Run extends App { | |
(21 to 22).par.map { case port => | |
try { | |
val socket = new java.net.Socket("192.168.1.1", port) | |
socket.close() | |
println(port) | |
port | |
} | |
catch { | |
case _: Throwable => -1 | |
} | |
}.toSet | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment