Friday, 2 January 2015
On 18:34 by Himanshu Joshi in port scanner No comments
Code in Perl::
use IO::Socket;
$port = 19;
while ($port < 26){
$spy = new IO::Socket::INET (PeerAddr => '127.0.0.1',
PeerPort => $port,
Proto => 'tcp');
if ($spy){
close $spy;
print "$port -open\n";
$port = $port + 1;
}
else{
print "$port -closed\n";
$port = $port + 1;
}
}
Code in Ruby::
require 'socket'
require 'timeout'
ports = 19..26
ports.each do |spy|
begin
Timeout::timeout(10){TCPSocket.new("127.0.0.1", spy)}
rescue
puts "closed : #{spy}"
else
puts "open : #{spy}"
end
end
ports.each do |spy|
begin
Timeout::timeout(10){TCPSocket.new("127.0.0.1", spy)}
rescue
puts "closed : #{spy}"
else
puts "open : #{spy}"
end
end
Code in Java::
import java.net.*;
import java.io.IOException;
public class javaps {
public static void main(String[] args)
{
String remote = "172.16.0.1";
for (int port = 19; port <= 26; port++) {
try {
Socket s = new Socket(remote, port);
System.out.println("The port " + port + " of " + remote + " is open");
s.close();
}
catch (IOException ex) {
System.out.println("The port " + port + " of " + remote + " is closed");
}}}}
public static void main(String[] args)
{
String remote = "172.16.0.1";
for (int port = 19; port <= 26; port++) {
try {
Socket s = new Socket(remote, port);
System.out.println("The port " + port + " of " + remote + " is open");
s.close();
}
catch (IOException ex) {
System.out.println("The port " + port + " of " + remote + " is closed");
}}}}
Simplest way to make a port scanner..
Subscribe to:
Post Comments (Atom)
Search
Followers
Popular Posts
-
Bypassing UAC with PowerShell Recently during a Red Team engagement, I got shell access to some user machines using Client Side Att...
-
Note: This Article Is Not For Noobs! Learners Are Welcomed! This Article Is For Educational Purposes Only, Any Misuse Of Information Give...
-
Just follow the steps as given below :- First copy any Image to your C: directory Open cmd by going Start-Run program- type cmd (A...
-
SyntaxNet: Neural Models of Syntax. Installation Running and training SyntaxNet models requires building this package from source. Yo...
-
You Have To Follow These STEPS: 1. Open notepad and paste the following code in it. 2. Change the password in place of (qwe...
-
Go to Start > Run > type " regedit ". Once in regedit go to [HKEY_CURRENT_USER\Software\Microsoft\Window...
-
So Here Is A Trick Now U Can Chat With Your Friend Through Command Prompt.. You need only your friend IP address.. Open Notepad and ...
-
Today our tutorial will talk about Kali Linux Man in the Middle Attack. How to perform man in the middle attack using Kali Linux?we will ...
-
This article is a quick, comprehensive guide on setting up your newly installed KaliLinux2.0 (very attractive new GUI by the way) for secu...
Blog Archive
-
▼
2015
(72)
-
▼
January
(38)
- Posting your Facebook Status Upside Down...
- Is Free Antivirus Really Good?
- QUESTIONS THAT CAN COME IN YOUR C PROGRAMMING TEST.
- Basic C PROGRAMMING LPU
- Create Facebook Page without Name-How to Guide
- Refresh Your Full Computer By Just One Click
- Making own Simple Port Scanner
- Hacking With PRORAT...
- Use Google as A proxy..?
- Hacking A Iphone Passcode....
- How to Create folder named CON?
- Skip the Annoying "Use the Web service to find the...
- HOW HACKERS GET CAUGHT.
- HACK A WEBSITE WITH HTML CODING...
- Magic In Windows..
- Compress 1 GB into 10 mb
- Online chat tricks..
- Make Your own speaking programme with Batch file a...
- Programme to annoy anyone one..
- DDOS ATTACK MANUALL
- HOW TO BLOCK YOUR ENEMY'S SIM CARD
- HOW TO CHANGE THE ICON OF YOUR PEN DRIVE
- Disable the “Send To” Folder on the Windows Explor...
- WMIC commands for Auditor and Hacker
- How to "Delete administrator Password" without any...
- How To Use Mobile Camara As A Webcam
- Setting A Video As Desktop Wallpaper..
- Send Coloured Message on Facebook...
- How To Stop Someone's Internet Access..
- Facebook Hacking
- How To Hide Drives in Windows?
- Advance Matrix Efect Using Notepad...
- How To Grab Your Friend IP
- HAVE YOU DOWNLOADED TORRENT FILE WITH IDM
- Want to crack BIOS PASSWORD...
- Some Windows Amazing Tricks
- Chat With Friends Through Command Prompt(CMD)..
- Shutdown Your PC by Timer...
-
▼
January
(38)
Text Widget
Powered by Blogger.
0 comments:
Post a Comment