NetStumbler.org Forums

Go Back   NetStumbler.org Forums > NetStumbler Community > Scripts
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 05-09-2005   #16 (permalink)
dwakeman
perlmonk
 
dwakeman's Avatar
 
Join Date: Jul 2004
Location: canadia
Posts: 57
Quote:
Originally Posted by dwakeman
I thought of something else to add to the module. I was reading about the problem some were having with corrupted NS1 files, and having to go through a manual trial and error process (http://members.netjunkies.net/streaker/repair_ns1.asp and http://www.frontiernet.net/~beakmyn/...le%20Recovery/) to try and save as many AP's as possible from the file. I want to see if I can get the module to try and automatically repair the file, or at least get as many good AP's as possible out.

I was able to find someone's corrupted file here: Corrupted AP file but I was hoping I could get a second one (doesn't have to be huge) so I could make sure I was doing this properly. If someone has one and wouldn't mind, please email it to me (my email is above).

Thanks,
Dave
Actually I ran that file through the module and I was able to export the ~950 AP's without changing anything. Attempting to open the file in NetStumbler produced an error: "Unexpected File Format". *shrug* Unless I get another corrupted ns1 file, I'll assume it will work.

I'm just about finished the new interface and will be releasing a new version this week.
dwakeman is offline   Reply With Quote
Old 05-10-2005   #17 (permalink)
dwakeman
perlmonk
 
dwakeman's Avatar
 
Join Date: Jul 2004
Location: canadia
Posts: 57
I have released a new version of NetStumbler::NS1 today (http://www.perldev.org/project.cgi?pid=6). I have changed the interface to OO, added two new features for extra data to be returned (IP info, and all GPS entries), and created POD documentation in the NS1.pm file.

Here is some working code:

Code:
use NetStumbler::NS1;
	
$ns1 = NetStumbler::NS1->new();
$ns1->set( ip_info => 1 );

@nsData = $ns1->parseNS1( "filename.ns1" );
This will return a nested data structure that you can view using Data::Dumper. Here is a sample template that would include ip_info and full_gps info:

Code:
[
  'Latitude',
  'Longitude',
  'SSID',
  'Type',
  'BSSID',
  'First Seen',
  'Last Seen',
  'SNR',
  'Signal',
  'Noise',
  'Flags',
  'Name',
  'Channels',
  'Beacon',
  'Data Rate',
  'Last Channel',

(--- if ip_info   ---)
  'IP Address',
  'Subnet',
  'Subnet Mask',

(--- if full_gps ---) - APDATA, new array
  [
    [
      'Time',
      'Signal',
      'Noise',
      'Location Source',
(--- if full_gps ---) - GPSDATA, new array
      [
        'Latitude',
        'Longitude',
        'Altitude',
        'NumSats',
        'Speed',
        'Track',
        'MagVariation',
        'Hdop'
      ]
    ],
    [
     [
       Next APDATA/GPSDATA entry ...
     ]
    ],
    [
     [
       Next APDATA/GPSDATA entry ...
     ]
    ]
  ],
  [
    Next APINFO entry ...
  ]
]
There can be more than one array depending on how many APDATA/GPSDATA entries you have for a single AP (there could be LOTS). Without the GPSDATA you would have:

Code:
[
  'Latitude',
  'Longitude',
  'SSID',
  'Type',
  'BSSID',
  'First Seen',
  'Last Seen',
  'SNR',
  'Signal',
  'Noise',
  'Flags',
  'Name',
  'Channels',
  'Beacon',
  'Data Rate',
  'Last Channel',

(--- if ip_info   ---)
  'IP Address',
  'Subnet',
  'Subnet Mask',
],
[
  Next entry ...
],
[
  Next entry ...
]
I know that this gets pretty confusing because of the nested data structure, but I think you can simplify this within your own code (perldoc -f map). I may attempt to simplify the returned structure at a later time, but for now I'll be leaving this as is.
dwakeman is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Google
 
Web NetStumbler.org

All times are GMT -7. The time now is 11:18 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 ©2007, Crawlability, Inc.


All messages express the views of the author and are for entertainment purposes only. Netstumbler.org cannot be held responsible for the authenticity of the content or the actions of its members. By using this site and its services, you warrant that you will not post any messages that are discriminating, obscene, hateful, threatening, or otherwise violates any laws and you release Netstumbler.org from any future claims of any kind whatsoever including, but not limited to, addiction and loss of productivity. All forum messages, private messages and any other content are properties of Netstumbler.org. Even if publicly available, personal or copyrighted information are not to be posted without the consent of the owner. Distribution of licensed and copyrighted materials in any way not endorsed by the copyright owner is strictly prohibited. You may not use this site and its resources to spam other sites or individuals or perform any action that violates any law. Items sold or bought in the For Sale forum are sold as is and no warranty or insurance of any kind is provided. Netstumbler.org cannot be held responsible for the outcome of any transactions and no warranty of any kind is provided, either express or implied. Vulgar words are not allowed in the subject lines ; they may be used in the message body in any forum. The Administrator, Super Moderators and Moderators of Netstumbler.org have the right to remove, edit, move or close any thread for any reason and to reveal your identity and other known information in the event of a complaint or legal action arising from any message posted by you.