#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Python with Wireshark to monitor and save activity log


    Hi guys

    I am a beginner in Python and I need some help with this programming language.
    I need to write a program which could save Wireshark logs to my desired folder into one file. The internet activity I need to capture is websites.
    There is this code for Tshark on Ubuntu:
    "sudo tshark -i wlan0 "host 192.168.1.100 and port 45000" -d tcp.port==45000,http -T pdml > dump.xml"
    but when I remove sudo and change the IP address to mine, Tshark on windows (I am using windows 7) the Tshark doesn't recognize "wlan" acronym (I googled equivalent of wlan for windows, but no luck) so I even though the task looks simple, it is not for me, so I would like somebody to help there or at least to give some links to tutorials. And many thanks to those who could help me!!

    Regards

    Povilas
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0
    I got some update here:

    I managed Tshark make XML file I wanted so now I need Python to open it, modify by removing all the garbage unneeded text from there and leave only addresses of websites.
  4. #3
  5. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    In addition to learning python syntax, built in data structures, the methods for operating operating on them, the reasons for "frozenset" versus "set", tuples vs. lists and other immutable/mutable pairs, then look into the xml parsers:
    http://docs.python.org/3/library/xml.html
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo