Ethical Experts
Ethical Experts

A Community Dedicated to Helping and Learning . Here You Will Get Hacking Tutorials and Monetizing Methods . We Hope You Have a Pleasant Stay
HomeHome  SearchSearch  FAQFAQ  RegisterRegister  Log in  
Still Currently working on the forum design, until I find a perfect design that can sit there for the whole life :p .. Please Bare with us if you see the design change while / after you refresh a page or return ! Sorry for the Inconvenience ~!

Display results as :
Rechercher Advanced Search
Latest topics
» Corrigs Regulation Pid Exercice
Sat Oct 10, 2015 10:01 am by kennharehusr

» Motorola USB Smart Cyclone P2K Easy Tool V3.9 Cracked.rar
Tue Oct 06, 2015 10:42 am by kennharehusr

» Drawn Dark Flight Download Free Full Version
Sat Oct 03, 2015 1:54 am by kennharehusr

» Walmart Barcode Lookup
Thu Sep 24, 2015 6:02 pm by kennharehusr

» F-castle ?? (????).zip
Tue Sep 15, 2015 3:32 pm by kennharehusr

» Homestuck - The Felt OST (2012)
Mon Aug 24, 2015 10:50 pm by kennharehusr

» Cute, Petite Teen Takes It In Her Ass
Mon Aug 10, 2015 12:31 pm by kennharehusr

» Cute, Petite Teen Takes It In Her Ass
Mon Aug 10, 2015 12:27 pm by kennharehusr

» Arcview 3.2 64 Bit Free Download
Tue Jul 07, 2015 2:49 pm by kennharehusr

Most Viewed Topics
Hack Pack : Largest Hacking Tools Collection
Hack Your BroadBand !! RISK FREE !!
How to Hack the Windows Admin Password Using OphCrack in Backtrack tutorial
Hacking With Keyloggers Prorat
How to Get Unlimited time in an Internet Cafe ... :D
How to Hack Websites & Servers - Tutorial
Cracking a WPA/WPA-2 Password.. ;)
Backtrack and Facebook
Credit Card Generating Sequence
prorat download facebook email card ddos wifi phishing backtrack tools crack hacking Windows account page credit free netcat password passwords hacker pack internet file hack gmail
Facebook Like
Similar topics
Share | 

 Making a SImple Port Scanner In Different languages

View previous topic View next topic Go down 
The Joker

Posts: 182
Join date: 2012-06-11
Age: 25

PostSubject: Making a SImple Port Scanner In Different languages    Wed Aug 15, 2012 7:39 am

Lets make a simple port scanner with opens a full TCP connection to detect if a port is open or not.
This is not the best way to scan because it makes a lot of noise, some other ways are Half TCP (TCP SYN) and TCP FIN.
Code in python::

import socket
i = “″
for p in range(19, 26):
spy = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
spy.connect((i, p)
print p,” Open”
except :
print p,”closed”
It searches from port 19 to 25. The data is hard coded but sys.argv[] can be used to take arguments from command line.. Python is indent sensitive and here I can’t find any [code] tag so if you copy paste the above code it will give errors the indentation should be corrected to work properly.
Code in Perl::

use IO::Socket;
$port = 19;
while ($port < 26){
$spy = new IO::Socket::INET (PeerAddr => '',
PeerPort => $port,
Proto => 'tcp');
if ($spy){
close $spy;
print "$port -open\n";
$port = $port + 1;
print "$port -closed\n";
$port = $port + 1;

Code in Ruby::

require 'socket'
require 'timeout'
ports = 19..26
ports.each do |spy|
Timeout::timeout(10){"", spy)}
puts "closed : #{spy}"
puts "open : #{spy}"
Code in Java::

public class javaps {
public static void main(String[] args)
String remote = "";
for (int port = 19; port <= 26; port++) {
try {
Socket s = new Socket(remote, port);
System.out.println("The port " + port + " of " + remote + " is open");
catch (IOException ex) {
System.out.println("The port " + port + " of " + remote + " is closed");

These are just one way of coding port scanners
Back to top Go down
View user profile
Making a SImple Port Scanner In Different languages
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
» Linux based VoIP Switch with Integrated Billing only $2/port
» Simple Private Message Pop Up
» Can Topamax be making me crazy?
» Unable to connect to host on port 7055
» new dedicated book scanner

Permissions in this forum:You cannot reply to topics in this forum
Ethical Experts ::  :: -
Jump to: