NetStumbler.org Forums

Go Back   NetStumbler.org Forums > Software > Unix/Linux
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 06-24-2005   #1 (permalink)
Dutch
Humourless EuroMod.
 
Dutch's Avatar
 
Join Date: Mar 2004
Location: City of Mermaids, Denmark
Posts: 6,819
Fix for Gpsdrive-Kismet-Mysql bug posted

If you use GPSDrive with Kismet and mysql the following posted to the GPSDrive mailing list by yours truely might be of interest :
Quote:
Originally Posted by Gpsdrive mailing list
As previously noted on the list, gpsdrive fails inserting or updating accesspoint data in the mysql database, if the SSID of the accesspoint contains a "\" character.
WinXP bleads bits of memory into proberequests, so sometimes kismet detects an AP in the form of "^F^G^[^\" which then makes GPSDrive dump to desktop due to a malformed SQL query for inserting or updating the data.

Checking the gpskismet.c file, the reason is clear. The escape routine is wrong.

The enclosed patch for the 2.10pre3 code pulled from cvs today, fixes the escape routine and adds a printout of the orig SSID and the escaped SSID when gpsdrive is run with debug enabled.

Save the patch to the toplevel gpsdrive source directory and apply it the command :
patch -n src/gpskismet.c fixkismetescape.patch

B. Rgds

Dutch (from the NS forums)
Patch enclosed here as well. Remove the .txt suffix if following the above advice on how to apply it.


Dutch
__________________
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....

Last edited by Dutch : 07-02-2005 at 02:55 PM. Reason: removed old patch
Dutch is offline   Reply With Quote
Old 06-24-2005   #2 (permalink)
King_Ice_Flash
Alien Paranoid Stumbler
 
King_Ice_Flash's Avatar
 
Join Date: May 2003
Location: WI
Posts: 2,688
Nice. I was trying to figure out why mine stopped working.
__________________
"Yeah," said a voice from under the table, "you go to pieces so fast people get hit by the shrapnel."
King_Ice_Flash is offline   Reply With Quote
Old 06-24-2005   #3 (permalink)
Dutch
Humourless EuroMod.
 
Dutch's Avatar
 
Join Date: Mar 2004
Location: City of Mermaids, Denmark
Posts: 6,819
Quote:
Originally Posted by King_Ice_Flash
Nice. I was trying to figure out why mine stopped working.
You should have asked..
And a correction, it's not the "/" character, but the "\" character that generate the malformed SQL query, and it's the escaping of this char that is fixed by the patch.
It should work on 2.09 as well, so no need to go to 2.10pre3 unless you want to.

Dutch
__________________
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....

Last edited by Dutch : 06-24-2005 at 11:46 AM.
Dutch is offline   Reply With Quote
Old 07-02-2005   #4 (permalink)
Dutch
Humourless EuroMod.
 
Dutch's Avatar
 
Join Date: Mar 2004
Location: City of Mermaids, Denmark
Posts: 6,819
New updated patch, that fixes what I broke with the previous patch, which just shows you shouldn't be coding when under the influence of morphine...

This patch, which should be applied to the original gpskismet.c from the gpsdrive 2.10pre3 cvs checkout, properly escapes the characters in a SSID, that will generate a malformed SQL update or insert query. Just as the previous patch, it also adds a printout of the original SSID and the escaped SSID, if gpsdrive is run with debug output enabled.

The patch should be saved in the toplevel gpsdrive source directory, and applied with the command :
patch -p0 -l < newfixkismetescape.patch.txt

The patch can also be applied to the gpsdrive 2.09 source, with the same command, and has been tested with that version as well.

Sorry for the inconvenience...

Dutch
Attached Files
File Type: txt newfixkismetescape.patch.txt (544 Bytes, 74 views)
__________________
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....
Dutch is offline   Reply With Quote
Old 07-02-2005   #5 (permalink)
King_Ice_Flash
Alien Paranoid Stumbler
 
King_Ice_Flash's Avatar
 
Join Date: May 2003
Location: WI
Posts: 2,688
What did you break? The previous patch worked for me.
__________________
"Yeah," said a voice from under the table, "you go to pieces so fast people get hit by the shrapnel."
King_Ice_Flash is offline   Reply With Quote
Old 07-02-2005   #6 (permalink)
Dutch
Humourless EuroMod.
 
Dutch's Avatar
 
Join Date: Mar 2004
Location: City of Mermaids, Denmark
Posts: 6,819
Quote:
Originally Posted by King_Ice_Flash
What did you break? The previous patch worked for me.
Yep, right until you run into a SSID like "KIF's WLan"...

This patch escapes not just the \ character which you often get in one of the WinXP memorybleaded proberequests, but also the ' and " characters, which should take care of them all.

Now we just need a patch to take care of that G8t3k33per character... Untill we get that, we have to settle for pouring whisky in him...

Dutch
__________________
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....
Dutch is offline   Reply With Quote
Old 07-04-2005   #7 (permalink)
Dutch
Humourless EuroMod.
 
Dutch's Avatar
 
Join Date: Mar 2004
Location: City of Mermaids, Denmark
Posts: 6,819
Fix has been applied to the current gpsdrive 2.10pre3 version in the CVS repository, including an additional fix for the regular SQL feature of gpsdrive.
The additional fix, has been also been posted on the gpsdrive mailing list, and is included here for good measure.
Save the patch to the toplevel gpsdrive source directory and apply with the following command :
patch -p0 -l < fix_gpssql_escape.patch.txt
then recompile gpsdrive.
Can also be applied to the gpsdrive 2.09 sources, if you prefer to run a stable version.

Dutch
Attached Files
File Type: txt fix_gpssql_escape.patch.txt (824 Bytes, 68 views)
__________________
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....
Dutch is offline   Reply With Quote
Old 07-20-2005   #8 (permalink)
King_Ice_Flash
Alien Paranoid Stumbler
 
King_Ice_Flash's Avatar
 
Join Date: May 2003
Location: WI
Posts: 2,688
Quote:
Originally Posted by Dutch
Fix has been applied to the current gpsdrive 2.10pre3 version in the CVS repository, including an additional fix for the regular SQL feature of gpsdrive.
Does this mean that if you use the CVS version, you will not need the fix?
__________________
"Yeah," said a voice from under the table, "you go to pieces so fast people get hit by the shrapnel."
King_Ice_Flash is offline   Reply With Quote
Old 07-21-2005   #9 (permalink)
Dutch
Humourless EuroMod.
 
Dutch's Avatar
 
Join Date: Mar 2004
Location: City of Mermaids, Denmark
Posts: 6,819
Quote:
Originally Posted by King_Ice_Flash
Does this mean that if you use the CVS version, you will not need the fix?
That is correct. At least if you have pulled the CVS version down, and compiled it AFTER the 4'th of July 2005.

Dutch
__________________
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....
Dutch is offline   Reply With Quote
Old 07-21-2005   #10 (permalink)
King_Ice_Flash
Alien Paranoid Stumbler
 
King_Ice_Flash's Avatar
 
Join Date: May 2003
Location: WI
Posts: 2,688
Quote:
Originally Posted by Dutch
That is correct. At least if you have pulled the CVS version down, and compiled it AFTER the 4'th of July 2005.

Dutch
Too bad I can't get it to compile.
__________________
"Yeah," said a voice from under the table, "you go to pieces so fast people get hit by the shrapnel."
King_Ice_Flash is offline   Reply With Quote
Old 07-21-2005   #11 (permalink)
Dutch
Humourless EuroMod.
 
Dutch's Avatar
 
Join Date: Mar 2004
Location: City of Mermaids, Denmark
Posts: 6,819
Quote:
Originally Posted by King_Ice_Flash
Too bad I can't get it to compile.
What error messages do you get ?
Have you got all the required dependencies installed, including their dev counterparts ?
If you need help, PM me a MSN id, and I'll talk you through it.

Dutch
__________________
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....
Dutch 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:29 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, 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.