sqlmap/lib/utils
Raju Ranjan 5e2a6aeec8
fix(search): parse current Bing result links (#6150)
While looking into #6009 I noticed the Bing fallback in -g never
returns anything, even when Bing itself serves a normal results page.

Two things changed on Bing's side. The result anchor now carries
target="_blank" before href, so '<h2><a href="..." h=' no longer
matches at all. And the href is no longer the target URL but a
tracking redirect (https://www.bing.com/ck/a?...&u=a1<base64url>),
where the real link sits base64url-encoded after the "a1" prefix
in the u parameter.

The regex now allows extra attributes on both tags and captures
either the u payload of a ck/a redirect or a plain href. The payload
is decoded with decodeBase64(), which already deals with the
URL-safe alphabet and the missing padding. Plain hrefs still work
the same as before (with &amp; unescaped), in case Bing serves the
old markup to some clients.

Checked against a saved live results page (0 -> 10 links) and the
old markup, and --smoke-test passes. Google still can't be scraped
since it only serves a JS page now, so this doesn't fully close
#6009, but Bing is usable again as a fallback when DuckDuckGo blocks
the IP.
2026-10-21 10:41:33 +02:00
..
__init__.py
api.py Minor cleaning after #6146 2026-10-17 13:06:38 +02:00
bcrypt.py Minor refactoring 2026-07-09 09:56:51 +02:00
brotli.py Hardening Brotli/Zstandard decoding against hostile input 2026-07-25 09:59:53 +02:00
brute.py Fixing --common-columns for -T A,B 2026-07-28 16:42:37 +02:00
crawler.py Improved crawling 2026-07-25 19:10:58 +02:00
dbwire.py Adding embedded dbwire library 2026-07-12 10:32:57 +02:00
deps.py Some more patches for -d 2026-07-11 15:51:04 +02:00
dialect.py Improving dialect checks 2026-07-17 14:46:52 +02:00
getch.py
grpcweb.py Add experimental gRPC-Web (text) support 2026-07-17 23:38:34 +02:00
gui.py Improved --gui 2026-07-19 16:31:08 +02:00
har.py Couple of trivial bug fixes 2026-08-04 17:02:57 +02:00
hash.py Fixes #6143 2026-10-11 21:20:29 +02:00
hashdb.py Switching from pickle to json for serialization 2026-07-08 12:13:49 +02:00
jwt.py Do not crash on a JWT with a non-base64url signature (fixes #6101) (#6102) 2026-09-01 10:24:58 +02:00
keysetdump.py Fixes #6097 2026-08-16 23:52:22 +02:00
library.py Adding support for import sqlmap as a library (#2083) 2026-07-02 09:58:48 +02:00
nonsql.py Minor patch 2026-08-08 01:07:07 +02:00
paraminer.py Adding switch --mine-params 2026-07-24 14:27:05 +02:00
pivotdumptable.py Fixes #1545 2026-07-02 00:19:31 +02:00
progress.py Fixing --eta 2026-07-09 13:25:50 +02:00
prove.py Improved mechanism for --proof 2026-08-07 17:04:32 +02:00
purge.py Couple of bug fixes 2026-06-14 17:05:32 +02:00
safe2bin.py Adding a minor comment 2026-07-28 21:58:51 +02:00
search.py fix(search): parse current Bing result links (#6150) 2026-10-21 10:41:33 +02:00
sgmllib.py
sqlalchemy.py Minor patch 2026-07-19 14:46:23 +02:00
sqllint.py Minor update for SQLlinter 2026-07-12 20:27:37 +02:00
timeout.py
tui.py Minor update 2026-06-24 11:11:03 +02:00
versioncheck.py
wafbypass.py Removing some unused imports 2026-06-28 02:09:50 +02:00
xrange.py Fixing custom xrange for negative steps 2026-06-12 13:04:51 +02:00