Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 71 guests and 2 members online
Free Business and Tech Magazines and eBooks
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Network Pen Testing
So you scanned a host, and found open ports!!
EH-Net
May 22, 2013, 11:43:46 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Network Pen Testing
(Moderator:
don
) >
So you scanned a host, and found open ports!!
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: So you scanned a host, and found open ports!! (Read 5070 times)
0 Members and 1 Guest are viewing this topic.
ZeroOne
Jr. Member
Offline
Posts: 59
So you scanned a host, and found open ports!!
«
on:
May 26, 2012, 07:02:28 AM »
Hi forum
I'm currently studying scanning techniques and information gathering in a pen testing course, and I have some few questions, you might be asking yourself why this noob "me
" isn't asking those questions to the leaders or the staff of that course he joined!!.. lets just say BECAUSE THIS FORUM ROCKS!!
moving on am actually trying to be more comfortable with scanning techniques before moving to the next level when it comes to pen testing,my questions are basic and could sound stupid, well what to say I'm just a beginner.
So I've connected two computers which I own to my LAN, started to scan host B, using host A, tool used:NMAP, few ports showed up after scanning host B, even tho my firewall is on, on host B.
The ports showed up are the most common ports, like FTP, SSH, HTTP...etc
Now I know what is the difference between open/close ports;
-close port means that the port is accessible, and it reacts with the packets sent threw the bus using host A, but the service on that port is not listening.
-open port simply means that the service on that port is currently listening, port is accessible
my question regarding the above topics:
1- when a port return open on the scanning tool, and knowing that the port is listening, does that means that the port is not protected by a firewall? Normally after scanning a port, with the result of "filtered" we could guess that there is a firewall behind it to protect it, so if the port is open does that mean that is it unsecured? and that it could be accessed easily? leading to high risks attacks!
2- what is the difference between a port listening to a service, and a port not listening to a service? I'll give you an example to simplify my question, I happen to own a website, I use FTP to transfer all my files from my PC to the website and vice-verse, I scanned my website IP just to study how the ports react, the FTP port 21 always appear to be "open port", i though that if i only connect to my website threw FTP then the port 21 will be open because at that time it is listening to the service "FTP", and once I disconnect the session between me and the website the port will appear as "close port", but the facts shows that the port 21 is always open on my web??!! Before you say "GOOGLE THAT YOU NOOB", I already did that, and would also like to hear some clarification from experts in this forum "which i respect a lot".
sorry if my questions were kinda messy.
Regards,
«
Last Edit: May 26, 2012, 07:04:19 AM by ZeroOne
»
Logged
BillV
Hero Member
Offline
Posts: 1892
Re: So you scanned a host, and found open ports!!
«
Reply #1 on:
May 26, 2012, 07:55:33 AM »
1. Just because the port says 'open' doesn't mean a firewall isn't present. A firewall is likely configured with a rule to allow traffic on that port. So, if by definition a firewall controls the flow of network traffic, it may very well be there and doing it's job but it's not "protecting" that port if it's allowing traffic to pass. Assuming you mean protecting as in blocking, in which case the port would be closed and traffic would not be allowed through.
Hopefully I understood what you were asking there.
2. Your FTP port will appear open until you stop the service. If you stop the service, and FTP is no longer running, then the service won't be listening and the port will be closed. You also won't be able to connect using your FTP client or upload files. You would need to start the service again, thus opening the port back up. Ports don't open and close dynamically with a session like you've described - unless maybe you're doing some weird port knocking stuff.
Logged
chrisj
Hero Member
Offline
Posts: 1163
Re: So you scanned a host, and found open ports!!
«
Reply #2 on:
May 26, 2012, 07:56:20 AM »
question to number 1. Maybe yes, maybe no. It just means that when you sent a syn to the port, it responded.
number 2, even after you disconnect from FTP, if you did another scan, the port will still be open, it is only your session that closed.
An open port means means that the service is listening. Which is really just a fancy way of saying the service is running / turned on. If it is closed then the service is turned of.
Not trying to sound condescending, but think of services like porch lights on Halloween. Where I live that means that the person that lives there is giving out candy. If you knock on the door, which the person is listening at, he opens you authenticate by saying trick or treat, and he gives you a bit of candy.
If the light is off, all the knocking in the world won't open the door if the person is not.
Logged
OSWP, Sec+
3xban
Hero Member
Offline
Posts: 608
Re: So you scanned a host, and found open ports!!
«
Reply #3 on:
May 28, 2012, 11:57:51 AM »
And Filtered means yes the ports are most likely open but not to you. They accepted the syn packet but denied any further communication. Filtered ports are used when you only want to allow specific IP ranges through your firewall for particular services. For instance, I have SMTP open but only to communicate with an email filtering company. So my mail servers only send out through that host and only receive from that host. All other incoming requests are tossed.
Logged
Certs: GCWN
(@)Dewser
ZeroOne
Jr. Member
Offline
Posts: 59
Re: So you scanned a host, and found open ports!!
«
Reply #4 on:
May 29, 2012, 03:04:18 AM »
BillV, chrisj, 3xban.. thanks all for your help
, there is one more question, if there are 4 devices in a LAN, say 3 workstations, and 1 router, the router will hold the public ip address (NATing), if I scan that public ip.. like: nmap [public ip], what is it scanning here? the router? like the results will be the ports opened/closed only on the router? i mean how is it possible that ip scanners find hosts with open ports when only the router holds the public ip?
Thanks again
«
Last Edit: May 29, 2012, 03:13:35 AM by ZeroOne
»
Logged
Cyber.spirit
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Re: So you scanned a host, and found open ports!!
«
Reply #5 on:
May 29, 2012, 03:07:02 AM »
my friend if a port is open it dosent mean there is no firewall. Firewall is designed to secure a network not to block all connections (Not to kill network lol) it maybe more secure if u close a ll services with firewall but if you do that no services can work and as you know a server with no services is useless lol
so let me tell you an example. a lot of servers has this port open 21 its an FTP port so if that port is open u cant gain access to it until u run a password cracking but if that password is complex u must exploit it in this case Maybe a good firewall can prevent you to do that
Logged
ICS Academy Network Security Certified
ZeroOne
Jr. Member
Offline
Posts: 59
Re: So you scanned a host, and found open ports!!
«
Reply #6 on:
May 29, 2012, 03:11:11 AM »
Quote from: cyber.spirit on May 29, 2012, 03:07:02 AM
my friend if a port is open it dosent mean there is no firewall. Firewall is designed to secure a network not to block all connections (Not to kill network lol) it maybe more secure if u close a ll services with firewall but if you do that no services can work and as you know a server with no services is useless lol
so let me tell you an example. a lot of servers has this port open 21 its an FTP port so if that port is open u cant gain access to it until u run a password cracking but if that password is complex u must exploit it in this case Maybe a good firewall can prevent you to do that
lol sorted it out already thx tho
, any help on my last question would be great bro
Logged
Cyber.spirit
Sr. Member
Offline
Posts: 351
The World is sick, Save your mind...
Re: So you scanned a host, and found open ports!!
«
Reply #7 on:
May 29, 2012, 04:18:22 AM »
lol your welcome brother
Logged
ICS Academy Network Security Certified
Data_Raid
Full Member
Offline
Posts: 165
Re: So you scanned a host, and found open ports!!
«
Reply #8 on:
May 29, 2012, 09:28:52 AM »
Quote from: ZeroOne on May 29, 2012, 03:04:18 AM
BillV, chrisj, 3xban.. thanks all for your help
, there is one more question, if there are 4 devices in a LAN, say 3 workstations, and 1 router, the router will hold the public ip address (NATing), if I scan that public ip.. like: nmap [public ip], what is it scanning here? the router? like the results will be the ports opened/closed only on the router? i mean how is it possible that ip scanners find hosts with open ports when only the router holds the public ip?
Thanks again
It might help to simplify things: what is a router and what is its function?
If you are scanning the public IP Address of the router and you get a response that there are open ports, is it possible that the router is running that particular service?
Hint: Check out NAT and PAT
Logged
All men by nature desire knowledge.
Aristotle
chrisj
Hero Member
Offline
Posts: 1163
Re: So you scanned a host, and found open ports!!
«
Reply #9 on:
May 29, 2012, 12:21:51 PM »
As Data_Raid pointed out, it really depends on how the router / firewall are configured.
The best answer I have for you, is to try it from "outside your router", on the "public internet side" and see what happens. then map it out to what you know is running where.
Logged
OSWP, Sec+
3xban
Hero Member
Offline
Posts: 608
Re: So you scanned a host, and found open ports!!
«
Reply #10 on:
May 29, 2012, 01:03:19 PM »
So you typical Linksys "firewall" and I use the term very losely based on this fact, they only do port forwarding. Meaning I have a device on my home/private LAN that I want to access from outside through some method (i.e. SSH or FTP). So on my firewall I would create a rule to allow these services to be accessed from the internet. It would be an incoming rule and would look something like this:
Code:
Direction
Source IP
Source Port
Destination IP
Destination port
Rule
Incoming
ANY
TCP/22
192.168.0.100
TCP/22
Allow
Incoming
8.8.8.8
UDP/53
192.168.0.101
UDP/53
Allow
Incoming
ANY
ANY
ANY
ANY
Deny
Rough translation. Now your Linksys Router/firewall is really more of a router than a firewall. It does not provide statefull packet inspection as well as a number of other services your business class firewall will provide. It simply routes traffic based on the rules you give it. The last rule int he list is the cleanup rule. Most home routers will probably not have the rule. But that is out-of-scope of this discussion.
So your firewall may not have any rules allowing access to it, but will have rules to allow access to internal resources.
Logged
Certs: GCWN
(@)Dewser
ZeroOne
Jr. Member
Offline
Posts: 59
Re: So you scanned a host, and found open ports!!
«
Reply #11 on:
May 29, 2012, 04:52:29 PM »
Quote from: Data_Raid on May 29, 2012, 09:28:52 AM
It might help to simplify things: what is a router and what is its function?
If you are scanning the public IP Address of the router and you get a response that there are open ports, is it possible that the router is running that particular service?
Hint: Check out NAT and PAT
I already know how NAT works, not very fimiliar with PAT, i'll check on it thanks for the hint.
Quote from: chrisj on May 29, 2012, 12:21:51 PM
As Data_Raid pointed out, it really depends on how the router / firewall are configured.
The best answer I have for you, is to try it from "outside your router", on the "public internet side" and see what happens. then map it out to what you know is running where.
I already scanned my public ip, on my workstation I've got 15 open ports, when I scanned the public ip it only showed two open ports, seems that there are firewall configuration.
Quote from: 3xban on May 29, 2012, 01:03:19 PM
So you typical Linksys "firewall" and I use the term very losely based on this fact, they only do port forwarding. Meaning I have a device on my home/private LAN that I want to access from outside through some method (i.e. SSH or FTP). So on my firewall I would create a rule to allow these services to be accessed from the internet. It would be an incoming rule and would look something like this:
Code:
Direction
Source IP
Source Port
Destination IP
Destination port
Rule
Incoming
ANY
TCP/22
192.168.0.100
TCP/22
Allow
Incoming
8.8.8.8
UDP/53
192.168.0.101
UDP/53
Allow
Incoming
ANY
ANY
ANY
ANY
Deny
Rough translation. Now your Linksys Router/firewall is really more of a router than a firewall. It does not provide statefull packet inspection as well as a number of other services your business class firewall will provide. It simply routes traffic based on the rules you give it. The last rule int he list is the cleanup rule. Most home routers will probably not have the rule. But that is out-of-scope of this discussion.
So your firewall may not have any rules allowing access to it, but will have rules to allow access to internal resources.
impressive explanation
,, thanks for sharing.
Logged
3xban
Hero Member
Offline
Posts: 608
Re: So you scanned a host, and found open ports!!
«
Reply #12 on:
May 29, 2012, 10:06:17 PM »
I should of explained the rules.
First rule, I allow ANY outside IP to connect to SSH(TCP/22) on an internal server at address 192.168.0.100. Scan would show the port as open.
2nd rule, I allow Google's DNS server to send DNS traffic to my internal server 192.168.0.101, this could be my company's own DNS server. You see that if you have a large web presence that is hosted internally, possibly on a DMZ. The rules would be similar if this was a DMZ. Any other outside IP would get rejected and any scan would show the port as filtered.
3 rule is cleanup, if the incoming traffic doesn't match any of the rules before it, it is dropped all together. In most cases, you may not need the rule if you only specified separate allow rules. The cleanup rule is mostly used for egress filtering. So you would have some allow rules for outgoing SMTP, FTP, SSH, HTTP/HTTPS and whatever other protocols you want to allow out. Then you put the cleanup DENY ALL rule at the end. This could protect you from compromised systems sending data out through odd ball ports like 1022 or 69000. Granted they could still try to send out through your allowed outgoing ports but if you lock those down to only sending data out to specific internet hosts, then that will help as well.
Logged
Certs: GCWN
(@)Dewser
Data_Raid
Full Member
Offline
Posts: 165
Re: So you scanned a host, and found open ports!!
«
Reply #13 on:
May 30, 2012, 10:30:35 AM »
Quote from: ZeroOne on May 29, 2012, 04:52:29 PM
I already scanned my public ip, on my workstation I've got 15 open ports, when I scanned the public ip it only showed two open ports, seems that there are firewall configuration.
You should be able to match the open ports with the internal machines (assuming NAT/PAT is configured), if you access the router have a look at which services are forwarded internally. It is also possible that the router is blocking everything inbound and the 2 open ports are management services for the router, for example: HTTP and Telnet.
How about a verbose scan of those 2 open ports, what information can you gather?
Logged
All men by nature desire knowledge.
Aristotle
BillV
Hero Member
Offline
Posts: 1892
Re: So you scanned a host, and found open ports!!
«
Reply #14 on:
June 03, 2012, 07:45:36 PM »
Quote from: chrisj on May 26, 2012, 07:56:20 AM
question to number 1. Maybe yes, maybe no. It just means that when you sent a syn to the port, it responded.
number 2, even after you disconnect from FTP, if you did another scan, the port will still be open, it is only your session that closed.
An open port means means that the service is listening. Which is really just a fancy way of saying the service is running / turned on. If it is closed then the service is turned of.
Not trying to sound condescending, but think of services like porch lights on Halloween. Where I live that means that the person that lives there is giving out candy. If you knock on the door, which the person is listening at, he opens you authenticate by saying trick or treat, and he gives you a bit of candy.
If the light is off, all the knocking in the world won't open the door if the person is not.
That is a beautiful analogy :-) Thanks!
Logged
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
General Certification
: nth topic on Career Advice
(7) by
hekvvddtest
Calendar Of Events
: CanSecWest 2013
(1) by
hekvvddtest
Greetings
: Obtain The Scoop On mulberry bags Before You Are Too Late
(8) by
hekvvddtest
Calendar Of Events
: HITBSecConf2013 – Amsterdam
(4) by
hekvvddtest
Calendar Of Events
: Cyber Readiness Challenge - Rome
(1) by
hekvvddtest
GCIH - GIAC Certified Incident Handler
: GCIH Free Practice test attempt
(0) by
prats84
GCIH - GIAC Certified Incident Handler
: Passed my GCIH
(0) by
prats84
News Items and General Discussion About EH-Net
: Change is Coming to EH-Net!!
(27) by
don
Greetings
: Hi from the UK
(2) by
n37sh@rk
Network Pen Testing
: AIX Vulnerability Assessments
(2) by
ras76
Tutorials
: Need guidance
(9) by
hanyhasan
Programming
: Finished Python Course in Codecademy now what?
(15) by
hanyhasan
Network Pen Testing
: Ruby on Rails Vulnerabilities / Attacks in BackTrack 5 r3
(0) by
SUdoctstudent
Network Pen Testing
: De-ICE 1.140 released!
(2) by
superkojiman
General Certification
: CPT Practical Submission
(1) by
UNIX
OSCP - Offensive Security Certified Professional
: Failed my first attempt at the OSCP exam
(94) by
azmatt
Tools
: Social-Engineer Toolkit (SET) Version 5.0 “The Wild West” Released
(2) by
m0wgli
Malware
: EICAR?
(3) by
UKSecurityGuy
Advisories
: HTB23154: Multiple Vulnerabilities in Exponent CMS
(0) by
AndyP
Advisories
: HTB23153: Multiple Vulnerabilities in Jojo CMS
(0) by
AndyP
Advisories
: HTB23151: Cross-Site Request Forgery (CSRF) in UMI.CMS
(0) by
AndyP
OSCP - Offensive Security Certified Professional
: Class Scheduled 6/8 - Linux n00b
(7) by
Taemyks
OSCP - Offensive Security Certified Professional
: OSCP exam scheduled
(6) by
gbhat
Incident Response
: LinkedIn Forensics
(0) by
AFENTIS_Forensics
General Certification
: Red Team/Blue Team
(1) by
ajohnson
Career Central
: Starter cert?
(3) by
Grendel
Network Pen Testing
: Beginner Ethical Hacker
(1) by
m0wgli
Web Applications
: Nessus and Nikto
(4) by
Seen
Network Pen Testing
: Cracking salted MD5 hash
(4) by
n37sh@rk
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.