Repository navigation
Parse quoted SSIDs and vendor names in scan CSV - #3
Merged
Merged
Conversation
The scan line reader ended a field at the first quotation mark, so an SSID or vendor containing a quote was dropped. Unescape doubled quotes into bounded buffers and show that text on the network info screen. Co-authored-by: El Padrino <elpadrino26@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scan_networks/show_scan_resultsrows are RFC 4180 CSV:"index","SSID","vendor","BSSID","channel","auth","RSSI","band"A
"inside a field is written as"".csv_next_quoted_fieldused to end the field at the first quote, soparse_network_linerejected the row and the network never appeared.The reader now turns each
""into one", keeps reading until the real closing quote, and still refuses to write past the output buffer. Plain quoted fields (no inner quotes) are unchanged. Commas inside a quoted SSID or vendor stay in that field.The only parser of these eight-column lines is the UART scan worker. It stores the unescaped SSID, vendor, BSSID, channel, auth, RSSI, and band. Network info (Left on a scan row) draws:
moja "specjalna" siec(no prefix, so the 21-character name fits one row)Vendor: Acme "X" IncCh: 6 2.4GHz -50 dBm, and authThe scan list uses the same unescaped SSID. Evil-twin password and portal-data screens share
csv_next_quoted_field, so those quoted fields unescape too.Wardrive
,WIFIlines are a different CSV and were left alone.Test
python3 tests/test_scan_csv.pybuildssrc/scan_csv.con the host (no Flipper SDK). It checks the firmware example, a plain row, commas plus quotes, truncation that must not shift later columns, buffer bounds, and rejected rows.SSID sent back to the firmware
Commands that send a selected SSID do not escape
"(or spaces, when the SSID is unquoted). Not changed here: the command parser is separate from the scan-line writer, and doubling quotes in the command would be wrong if that parser does not unescape.Quoted form
wifi_connect "<ssid>" "<password>"(a"in the SSID closes the argument early):src/screen_arp_poisoning.csrc/screen_mitm_pcap.csrc/screen_nmap.csrc/screen_wpasec.csrc/screen_arp_from_creds.c(SSID comes from the evil-twin list, which now unescapes)Unquoted form (spaces, commas, and quotes all split the command):
src/screen_wardrive_upload.c—wifi_connect %s %ssrc/screen_rogue_ap.c—start_rogueap %s %sSame hole for typed names, not scan selection:
start_portal "%s"insrc/screen_portal.c,add_ssid "%s"insrc/screen_beacon_spam.c.select_networkssends the list index, not the SSID.show_pass evilmatchers still stop at the first"and will not match an unescaped SSID that contains a quote:arp_check_password,mitm_check_password,nmap_check_password,rogue_ap_check_password,wpasec_check_password,wdup_check_evil_password.