Does any1 use pcapy module on win32 platforms?

Discussion in 'Python' started by billiejoex, Aug 26, 2005.

  1. billiejoex

    billiejoex Guest

    Hi. I'm trying to use pcapy module on Windows XP prof sp2 but it doesn't
    work.
    The example source reported on the site
    (http://oss.coresecurity.com/impacket/sniff.py) works only on *unix
    machines.
    On Windows machines the findalldevs() function (an output on the bottom)
    gives an unicode object that can't be processed by open_live function
    that tipically accept strings.
    This not happens on linux machines where findalldev() function gives a
    string object that can be quietly accepted by open_live.
    Does exist a patch to fix this bug? I really would like to write a portable
    program usable in both platforms.
    Maybe do can I process the unicode outputs and converting them into valid
    strings?
    Happy summer and happy coding! :)

    Regards

    billiejoex


    >>> pcapy.findalldevs()

    [u'\u445c\u7665\u6369\u5c65\u504e\u5f46\u6547\u656e\u6972\u4e63\u6964\u5773\u6e6
    1\u6441\u7061\u6574r\u445c\u7665\u6369\u5c65\u504e\u5f46\u317b\u4534\u3544\u3642
    \u2d31\u3030\u3942\u342d\u4441\u2d39\u3341\u4345\u382d\u3033\u3246\u3938\u3241\u
    4531\u7d44\u5c00\u6544\u6976\u6563\u4e5c\u4650\u7b5f\u3541\u3630\u3934\u3434\u45
    2d\u4230\u2d37\u3634\u3239\u382d\u4237\u2d35\u4630\u3133\u4244\u3933\u3532\u3943
    }\u445c\u7665\u6369\u5c65\u504e\u5f46\u377b\u4337\u3644\u3034\u2d31\u3841\u3143\
    u342d\u3743\u2d43\u3241\u4633\u432d\u3731\u3037\u3538\u3234\u4538\u7d34',
    u'\u65
    47\u656e\u6972\u2063\u644e\u7369\u6157\u206e\u6461\u7061\u6574r\u4d56\u6177\u657
    2\u5620\u7269\u7574\u6c61\u4520\u6874\u7265\u656e\u2074\u6441\u7061\u6574r\u4d56
    \u6177\u6572\u5620\u7269\u7574\u6c61\u4520\u6874\u7265\u656e\u2074\u6441\u7061\u
    6574r\u564e\u4449\u4149\u6e20\u6f46\u6372\u2065\u434d\u2050\u654e\u7774\u726f\u6
    96b\u676e\u4120\u6164\u7470\u7265\u4420\u6972\u6576\u2072\u4d28\u6369\u6f72\u6f7
    3\u7466\u7327\u5020\u6361\u656b\u2074\u6353\u6568\u7564\u656c\u2972 ']
     
    billiejoex, Aug 26, 2005
    #1
    1. Advertising

  2. [billiejoex]
    > Hi. I'm trying to use pcapy module on Windows XP prof sp2 [...]
    > On Windows machines the findalldevs() function (an output on the bottom)
    > gives an unicode object that can't be processed by open_live function
    > that tipically accept strings.
    >
    > >>> pcapy.findalldevs()

    > [u'\u445c\u7665\u6369\u5c65\u504e\u5f46\u6547\u656e\u6972\u4e63\u6964\u5773\u6e6
    > [...]


    For what it's worth, I can run that on my XP Professional SP2 machine and
    it works perfectly:

    >>> pcapy.findalldevs()

    [u'\\Device\\NPF_{15310604-FCFC-4016-9D36-14DAA948A600}',
    u'\\Device\\NPF_{62280C1D-DC5C-42AF-BA0F-6BDB48418CA5}']

    I'm using WinPcap 3.0. My packet.dll is stamped as version 3.0.0.18.
    Maybe you're running a different version?

    --
    Richie Hindle
     
    Richie Hindle, Aug 26, 2005
    #2
    1. Advertising

  3. billiejoex

    billiejoex Guest

    The problem was my winpcap version. I was using the 3.1.
    Now, with the 3.0 it works.

    Really thanks. :)


    > For what it's worth, I can run that on my XP Professional SP2 machine and
    > it works perfectly:
    >
    >>>> pcapy.findalldevs()

    > [u'\\Device\\NPF_{15310604-FCFC-4016-9D36-14DAA948A600}',
    > u'\\Device\\NPF_{62280C1D-DC5C-42AF-BA0F-6BDB48418CA5}']
    >
    > I'm using WinPcap 3.0. My packet.dll is stamped as version 3.0.0.18.
    > Maybe you're running a different version?
    >
    > --
    > Richie Hindle
    >
     
    billiejoex, Aug 26, 2005
    #3
    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. CORE Security Technologies
    Replies:
    1
    Views:
    2,131
    Jeff Wagner
    Nov 28, 2003
  2. CORE Security Technologies
    Replies:
    0
    Views:
    297
    CORE Security Technologies
    Nov 27, 2003
  3. billiejoex
    Replies:
    2
    Views:
    541
    billiejoex
    Aug 27, 2005
  4. billiejoex

    icmp sniffer with pcapy module

    billiejoex, Sep 9, 2005, in forum: Python
    Replies:
    0
    Views:
    848
    billiejoex
    Sep 9, 2005
  5. pranesh
    Replies:
    1
    Views:
    1,304
    Diez B. Roggisch
    Nov 2, 2009
Loading...

Share This Page