Open ports from source to destination

Is there a way to find out all the ports open between source IP & destination IP in any way ?

If you have access to switches in LAN network or access to both hosts to examine configuration and traffic, yes.
Otherwise, you will not get advice here about 'hacking' tools or their usage, if question is related to remote stuff

Hope that helps
Regards
Peasant.

Oh no, I am happy with my job, not into hacking. I have access to both hosts, need some command like netstat which will let me know the ports open from source to destination. I need to forward some application logs from source to destination.

I use basic port scan tools; as all sys admins should do port scans from time-to-time to check open ports (basic IT security).

From a quick Goggle search:

8 Port Scanner Tools for Network Administrator
1 TCP Port Scanner.
2 Nmap.
3 Netcat.
4 Port Authority.
5 Advanced Port Scanner.
6 Network Scanner by MiTeC.
7 PortQryUI.
8 NetScanTools.
2 Likes

Hi
Maybe this will help?

ss -t -o state established

--- Post updated at 16:07 ---

ss -t -o state connected
ss -t -o state synchronized
3 Likes

I not sure that ss is the tool the OP is looking for.

ss is similar to netstat , giving information on the state of sockets.

However, when the OP asks:

It's not clear to me the OP is looking for netstat-like information, which can be read from a host which we have access to ss and netstat (or even lsof ) , but external to the hosts.

Let's see what the OP really wants :slight_smile:

1 Like

Check firewall-cmd or iptables -L (depending on linux release and type) rules for specific rules, containing IP addresses in questions.
This should help, if linux firewall is used.

If not, other advice given here ( ss netstat nmap ) should provide reasonable info.

Please, when asking such question in future, please specify your operating system and version.
This will help us help you.

Regards
Peasant.

1 Like

thanks guys & sorry for delayed response, as I was away. But this is not I am looking for, what I need is something like below :

<some_command>  <source-ip> <destination-ip>

This should give me the list of all open ports between two systems, we are using red hat linux 6.10 ( Santiago ), please help if at all this is possible to achieve.

Such command does not exist, or else someone would suggest it.

Regards
Peasant.

Maybe you will be happy on Linux with this:

netstat -an | grep 'your.remote.ip.address'

... for starters... and you can process the text further as you like?

ss state established src 192.168.122.1 dst 192.168.122.84
Netid           Recv-Q           Send-Q                       Local Address:Port                          Peer Address:Port           
tcp             0                0                            192.168.122.1:45376                       192.168.122.84:ssh

I set two goals and look at all the established connections. What is the problem?
I have one established SSH connection, there are no other connections! That's all.
It is incorrect to apply the concepts of source and destination and open ports to two machines without any connection

Isn't it possible to use concept of telnet from source server & some sort of querying where it scans all ports one by one & gives the output ?
Or may be some port scanning tool ?

I already provided a link to scanning tools which will do this kind of port scanning.

Please read the posts and review the links and/code we provide you.

You are asking the same question over and over again which we have already answered for you!