NIC adress of incoming socket.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RosalieM

    NIC adress of incoming socket.

    How can i know the nic adress from an incoming socket ?
    I can easily know the ip adress and port number but how do i have some
    information about arp level ?

    Thanks


  • Andreas Kostyrka

    #2
    Re: NIC adress of incoming socket.

    Am Fr, den 14.05.2004 schrieb RosalieM um 18:40:[color=blue]
    > How can i know the nic adress from an incoming socket ?
    > I can easily know the ip adress and port number but how do i have some
    > information about arp level ?[/color]
    There is no portable way?

    Andreas

    Comment

    • Peter Hansen

      #3
      Re: NIC adress of incoming socket.

      RosalieM wrote:
      [color=blue]
      > How can i know the nic adress from an incoming socket ?
      > I can easily know the ip adress and port number but how do i have some
      > information about arp level ?[/color]

      In addition to Andreas' answer: I'm not even sure the problem
      has a well-defined solution in general. Isn't it possible
      that individual packets in the data stream (assuming this
      is TCP, for example) can be routed through different
      networks (and, therefore, different NICs) on some machines?

      If you want to limit this to the simple case of one NIC
      per machine, then you still need to resort to platform-specific
      things like parsing the output of some external command
      to match up IP address and "NIC address" (which is also
      not necessarily well-defined, but I assume you mean Ethernet
      address there).

      -Peter

      Comment

      • RosalieM

        #4
        Re: NIC adress of incoming socket.


        "Peter Hansen" <peter@engcorp. com> a écrit dans le message de
        news:naWdnRu54v moBTjdRVn-hw@powergate.ca ...[color=blue]
        > RosalieM wrote:
        >[color=green]
        > > How can i know the nic adress from an incoming socket ?
        > > I can easily know the ip adress and port number but how do i have some
        > > information about arp level ?[/color]
        >
        > In addition to Andreas' answer: I'm not even sure the problem
        > has a well-defined solution in general. Isn't it possible
        > that individual packets in the data stream (assuming this
        > is TCP, for example) can be routed through different
        > networks (and, therefore, different NICs) on some machines?
        >
        > If you want to limit this to the simple case of one NIC
        > per machine, then you still need to resort to platform-specific
        > things like parsing the output of some external command
        > to match up IP address and "NIC address" (which is also
        > not necessarily well-defined, but I assume you mean Ethernet
        > address there).
        >
        > -Peter[/color]

        I saw in dhcpd config for bootp that you give the adress of the nic. How
        can i be sure that in my lan it is the right computer (my dhcp server) that
        answers to my client and not another compromised machine ? Can i ask python
        some information from ethernet level in an ip connection?


        Comment

        • Peter Hansen

          #5
          Re: NIC adress of incoming socket.

          RosalieM wrote:
          [color=blue]
          > I saw in dhcpd config for bootp that you give the adress of the nic. How
          > can i be sure that in my lan it is the right computer (my dhcp server) that
          > answers to my client and not another compromised machine ? Can i ask python
          > some information from ethernet level in an ip connection?[/color]

          Basically, no. Use external utilities to solve whatever the
          problem is. I'd suggest that if you might have compromised
          machines on your own LAN which are answering in place of your
          real DHCP server, you have rather big problems to solve, and
          you'd be best involving a network administrator with a good
          understanding of security issues.

          -Peter

          Comment

          • RosalieM

            #6
            Re: NIC adress of incoming socket.


            "Peter Hansen" <peter@engcorp. com> a écrit dans le message de
            news:CpSdnTXrVp 3AljvdRVn-sw@powergate.ca ...[color=blue]
            > RosalieM wrote:
            >[color=green]
            > > I saw in dhcpd config for bootp that you give the adress of the nic.[/color][/color]
            How[color=blue][color=green]
            > > can i be sure that in my lan it is the right computer (my dhcp server)[/color][/color]
            that[color=blue][color=green]
            > > answers to my client and not another compromised machine ? Can i ask[/color][/color]
            python[color=blue][color=green]
            > > some information from ethernet level in an ip connection?[/color]
            >
            > Basically, no. Use external utilities to solve whatever the
            > problem is. I'd suggest that if you might have compromised
            > machines on your own LAN which are answering in place of your
            > real DHCP server, you have rather big problems to solve, and
            > you'd be best involving a network administrator with a good
            > understanding of security issues.
            >
            > -Peter[/color]

            I saw that this could be a security issue. So i would like to prevent it.
            And i would like to be able to do what dhcpd and tftp are able to do, to say
            check the nic before sending files. But I wanted to write this program in
            python as i found in google a dhcpd program writen in python.

            You mean that python cant do it ? I read that python can do everything
            possible.


            Comment

            • Peter Hansen

              #7
              Re: NIC adress of incoming socket.

              RosalieM wrote:
              [color=blue]
              > I saw that this could be a security issue. So i would like to prevent it.
              > And i would like to be able to do what dhcpd and tftp are able to do, to say
              > check the nic before sending files. But I wanted to write this program in
              > python as i found in google a dhcpd program writen in python.
              >
              > You mean that python cant do it ? I read that python can do everything
              > possible.[/color]

              Where did you read that? It needs to be corrected...

              Comment

              Working...