• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Execute script when a specific TCP connection has been established

Scheduled Pinned Locked Moved General pfSense Questions
5 Posts 3 Posters 506 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    s0nic
    last edited by Mar 1, 2018, 1:56 PM

    I want a script to run when a specific TCP connection (Client –-> pfSense ---> Suspicious Internet Host) has been established. Does anyone have an idea how this can be solved?

    ;) Blocking is not the solution I'm asking for.

    tcptrack, tcpdump, iptables, suggestions?

    TNX
    S0NIC

    1 Reply Last reply Reply Quote 0
    • G
      GruensFroeschli
      last edited by Mar 1, 2018, 2:59 PM

      How hacky can it be?

      We do what we must, because we can.

      Asking questions the smart way: http://www.catb.org/esr/faqs/smart-questions.html

      1 Reply Last reply Reply Quote 0
      • S
        s0nic
        last edited by Mar 1, 2018, 3:32 PM Mar 1, 2018, 3:25 PM

        Medium to high should be ok.

        1 Reply Last reply Reply Quote 0
        • N
          NogBadTheBad
          last edited by Mar 1, 2018, 4:19 PM Mar 1, 2018, 4:14 PM

          Snort, no blocking and a custom alert ?

          The following alerts me when there is an inbound or outbound SSH connection to or from my DMZ :-

          alert tcp $EXTERNAL_NET any -> $HOME_NET $SSH_PORTS (msg:"SFTP/SSH INBOUND";
          flow:established,to_server;content:"SSH-";sid:1000501;rev:1;classtype:not-suspicious)

          alert tcp $HOME_NET any -> $EXTERNAL_NET $SSH_PORTS (msg:"SFTP/SSH OUTBOUND";
          flow:established,to_server;content:"SSH-";sid:1000502;rev:1;classtype:not-suspicious)

          It won't run a script, but what do you want the script to do ?

          Andy

          1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

          1 Reply Last reply Reply Quote 0
          • G
            GruensFroeschli
            last edited by Mar 1, 2018, 5:19 PM

            really hacky:
            https://forum.pfsense.org/index.php?topic=65092.msg354840#msg354840

            You should be able to change the tcpdump arguments for it to look for the frames you're interested in.

            We do what we must, because we can.

            Asking questions the smart way: http://www.catb.org/esr/faqs/smart-questions.html

            1 Reply Last reply Reply Quote 0
            5 out of 5
            • First post
              5/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received