Re: Python Script for Colorizing Traceroute Output (apologies for top-post)

Discussion in 'Python' started by Roy Smith, Nov 17, 2012.

  1. Roy Smith

    Roy Smith Guest

    In article <>,
    wrote:

    > On Nov 17, 2012, at 10:04 AM, Jordan Bylsma <> wrote:
    >
    > > I'm looking into writing a python script that colorizes particular hops
    > > when using traceroute. Anyone run across something like this? I don't think
    > > it would be extremely difficult to write but some example code would help.
    > >
    > > Basically particular hops in traceroute output would match a table as
    > > either a router, firewall or layer 3 switch and be colorized accordingly.
    > > --
    > > http://mail.python.org/mailman/listinfo/python-list

    >
    > Don't forget that most firewalls don't decrement) the time-to-live number,
    > and unless you REALLY know what to look for, are invisible.


    Interesting. If the firewall doesn't decrement TTL (a particular nasty
    thing to do, and thus completely expected of a firewall) what REALLY
    knowledge would enable you to detect its presence in a traceroute
    printout at all?
     
    Roy Smith, Nov 17, 2012
    #1
    1. Advertising

  2. Re: Python Script for Colorizing Traceroute Output (apologies fortop-post)

    On Sun, Nov 18, 2012 at 5:38 AM, Roy Smith <> wrote:
    > In article <>,
    > wrote:
    >> Don't forget that most firewalls don't decrement) the time-to-live number,
    >> and unless you REALLY know what to look for, are invisible.

    >
    > Interesting. If the firewall doesn't decrement TTL (a particular nasty
    > thing to do, and thus completely expected of a firewall) what REALLY
    > knowledge would enable you to detect its presence in a traceroute
    > printout at all?


    If it's a router, then it definitely should be decrementing TTLs,
    though if the firewall is simply a part of another hop, you won't
    notice it specifically. What's more common, though, is devices that
    decrement TTL and drop packets but don't send back Time Exceeded
    messages, giving the classic "* * *" line. I'm not sure if that's what
    was being referred to, though. (And they aren't necessarily
    firewalls.)

    ChrisA
     
    Chris Angelico, Nov 17, 2012
    #2
    1. Advertising

  3. Re: Python Script for Colorizing Traceroute Output (apologies fortop-post)

    On Sun, Nov 18, 2012 at 6:59 AM, Jordan Bylsma <> wrote:
    > For this case the firewalls DO respond to TTL(in most cases) and will show in a traceroute. The objective here is to colorize particular devices to easily see what type of devices traffic would traverse across the network. I would be using a database of device hostnames that when they match in traceroute they would be printed a particular color. Something like router=green, layer 3 switch yellow, and firewall red. I'm just looking for a basicscript to accomplish this. Nothing too fancy.


    Sounds like the previously-mentioned Generic Colo(u)?ri(s|z)er (and
    yes, its README says exactly that) could do that for you. You'd need
    to craft a regexp to identify each hostname set, rather than using a
    database, but it shouldn't be difficult to write a script to create
    grc's config file.

    I've never used the program, though, so I have no idea how good it is.
    All I've done is download the tar.gz and glance over a few bits (the
    licence, mainly - which is mostly-GPL).

    By the way, you may wish to consider identifying your devices by IP
    address rather than hostname. If your IPs are stable and readable, you
    could save yourself the delays of reverse DNS lookups by simply
    colorizing the IPs.

    ChrisA
     
    Chris Angelico, Nov 17, 2012
    #3
  4. Re: Python Script for Colorizing Traceroute Output (apologies fortop-post)

    On Sun, 18 Nov 2012 09:00:10 +1100, Chris Angelico wrote:

    [...]
    > I've never used the program, though, so I have no idea how good it is.
    > All I've done is download the tar.gz and glance over a few bits (the
    > licence, mainly - which is mostly-GPL).


    "Mostly" GPL? You mean "not GPL".

    I really wish people wouldn't invent their own licences. It adds
    complexity and confusion to the licencing space. Unless you're a lawyer,
    and sometimes even if you are a lawyer, any modification you make to an
    established licence could be invalid, or possibly even invalidate the
    entire licence.

    Licence proliferation hurts us all. Just say No.

    http://en.wikipedia.org/wiki/License_proliferation



    --
    Steven
     
    Steven D'Aprano, Nov 18, 2012
    #4
  5. Re: Python Script for Colorizing Traceroute Output (apologies fortop-post)

    On Sun, Nov 18, 2012 at 12:18 PM, Steven D'Aprano
    <> wrote:
    > On Sun, 18 Nov 2012 09:00:10 +1100, Chris Angelico wrote:
    >
    > [...]
    >> I've never used the program, though, so I have no idea how good it is.
    >> All I've done is download the tar.gz and glance over a few bits (the
    >> licence, mainly - which is mostly-GPL).

    >
    > "Mostly" GPL? You mean "not GPL".
    >
    > I really wish people wouldn't invent their own licences. It adds
    > complexity and confusion to the licencing space. Unless you're a lawyer,
    > and sometimes even if you are a lawyer, any modification you make to an
    > established licence could be invalid, or possibly even invalidate the
    > entire licence.
    >
    > Licence proliferation hurts us all. Just say No.
    >
    > http://en.wikipedia.org/wiki/License_proliferation


    The wording in the file does permit you to use it under the exact
    terms of the GPL (though no version is specified). But I agree, we
    should stick to a handful of well-known licenses and be done with it.
    I like the BSD two-clause, myself, less wordy than the GPL.

    ChrisA
     
    Chris Angelico, Nov 18, 2012
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Heiko Besemann
    Replies:
    1
    Views:
    2,923
    Harsh Thakur
    Feb 19, 2004
  2. Slash
    Replies:
    2
    Views:
    5,058
    Roger Leigh
    Nov 11, 2003
  3. John Benson

    apologies for a previous post mistitling

    John Benson, Dec 7, 2003, in forum: Python
    Replies:
    0
    Views:
    286
    John Benson
    Dec 7, 2003
  4. Monica
    Replies:
    0
    Views:
    370
    Monica
    Nov 30, 2005
  5. Replies:
    0
    Views:
    257
Loading...

Share This Page