The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Command to check if X port is open in IPTABLES and OTHER command to check if is open in CSF - Thanks

Discussion in 'Security' started by 000, Feb 26, 2014.

  1. 000

    000 Well-Known Member

    Joined:
    Jun 3, 2008
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    Hi.

    If X command is CLOSED in IPTABLES, but OPEN in rules of CSF = port no accesible
    If X command is OPEN in IPTABLES, but CLOSED in rules of CSF = port no accesible

    Then... Please:

    With what command I check if X port is open/closed in IPTABLES ???

    With what command I check if X port is open/closed in CSF ???

    Thanks
     
  2. cPMelaniel

    cPMelaniel Technical Analyst Supervisor
    Staff Member

    Joined:
    Jun 25, 2013
    Messages:
    9
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Houston,Tx
    cPanel Access Level:
    Root Administrator
    Re: Command to check if X port is open in IPTABLES and OTHER command to check if is open in CSF - Th


    CSF is simply a GUI for the IPTABLES firewall on the server. If the port is open or blocked in one, it should be the same status in the other.

    Try using nmap to scan the ports.


    EX:

    nmap -Pn $IP -p $PORT
     
  3. 000

    000 Well-Known Member

    Joined:
    Jun 3, 2008
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    Re: Command to check if X port is open in IPTABLES and OTHER command to check if is open in CSF - Th

    Thanks.

    I like detect if X port is blocked BY CSF or BY IPTABLES.

    By this I like a command similar to:

    csf -status_of_ -portX
    iptables -status_of_ -portX

    to I can detect if port is BLOCKED by IPTABLES, by CSF or by BOTH
     
  4. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    942
    Likes Received:
    57
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Re: Command to check if X port is open in IPTABLES and OTHER command to check if is open in CSF - Th

    CSF just manages IPtables. If something is blocked in CSF, CSF blocks it by making an iptables rule.

    You can make your own iptables rules outside of CSF using some of it's included files/configuration, but you should know if you have done this.

    If you restart CSF it creates all your iptables rules based on CSF config. There should not be differences.

    You can just run this to see all the actual iptables rules, but there will be a lot if you use LFD blocking:

    Code:
    iptables -L -n
     
  5. 000

    000 Well-Known Member

    Joined:
    Jun 3, 2008
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    Re: Command to check if X port is open in IPTABLES and OTHER command to check if is open in CSF - Th

    Thanks.

    This show just ALL RULES...

    I need samplely know if X port is open, and this show all rules...
     
  6. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Re: Command to check if X port is open in IPTABLES and OTHER command to check if is open in CSF - Th

    Hello,

    Check the port status in iptables with the following command

    Code:
    iptables -L -n | grep :PORT
     
Loading...

Share This Page