LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-25-2012, 08:28 AM   #1
saeen
LQ Newbie
 
Registered: Aug 2010
Posts: 9

Rep: Reputation: 0
Perl - Check incoming ports from inside


Hi,

I want to be able to check whether a particular port is open from outside world to a particular machine. But i wish to do this test from the same machine. For example i want to check if port 80 is open to a host called host.mydomain.com and perform this check from host.mydomain.com.

The problem here is that the machine will only have certain incoming and outgoing ports open. And i want to run a perl script on that machine to determine if the firewall rules created are working fine. Outgoing can be checked easily but how do i check incoming ports ?

I was thinking to spoof the src port to the required incoming port and then send a packet out to one of the allowed outgoing addresses. Then create a socket that is already listening on the incoming port. When the host replies it will come to my spoofed port where i would have one sock instance waiting to accept.

If thats possible ! Because the reply will not be the initial sync packet ?

Any ideas how else to achieve this?

Thanks
 
Old 02-25-2012, 11:27 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
AFAIK, you'll need some form of proxy to do this correctly.

It's easy to verify 1) an allow rule in a firewall ruleset; 2) a listening TCP socket. But the problem is a scan from a host to itself is more or less meaningless. (I don't think spoofing IPs is going to be a good test.)

I recommend either setting up a simple (external) scan host, or making use of a service like GRC's Shields Up.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use linksys BB router to multiply ports available inside another network dr_skids Linux - Networking 2 08-12-2008 09:58 AM
perl inside a shell script baidym Linux - Newbie 2 05-05-2008 06:42 PM
Network traffic -- monitor my incoming and outgoing ports bskrakes Linux - Networking 5 04-02-2008 08:44 AM
check incoming or outgoing packets ilnli Programming 1 07-24-2007 03:08 PM
Vim Spell Check Inside Tags? Optimistic Linux - Software 1 04-15-2005 02:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration