Comments (4)
also, what's the proper way to replace a library for libcurl in linux using /usr/local/lib ?
It looks like renaming to /usr/local/lib/libcurl.so.4 doesn't work, even after running ldconfig, it looks like it know it is "libcurl-impersonate" and not "libcurl".
Libcurl impersonate only works in conjonction of LD_LIBRARY_PATH or LD_PRELOAD, but that's not great. Do you know a better way using ldconfig ?
Directly replacing /usr/lib/x86_64-linux-gnu/libcurl.so.4 only works until a package is updated on the system
from curl-impersonate.
Actually, LD_PRELOAD doesn't work due to SONAME
LD_PRELOAD=/home/libcurl-impersonate.so php script.php
script.php content :
print_r(curl_version());
will show
[ssl_version] => OpenSSL/1.1.1n
if I replace /usr/lib/x86_64-linux-gnu/libcurl.so.4 with libcurl-impersonate.so (after renaming), it works
[ssl_version] => BoringSSL
instead of replacing /usr/lib/x86_64-linux-gnu/libcurl.so.4, i can do this :
LD_PRELOAD will only work if I do this before
patchelf --set-soname libcurl.so.4 /home/libcurl-impersonate.so
from curl-impersonate.
When using libcurl-impersonate.so (not sure which one to use, there is .so, .so.4, .so.4.7.0) compiled and replaced, curl will show an error with version not available
libcurl-impersonate is intentionally built without the version information. If I remember correctly, when I built it with version information it wouldn't work since the symbol version information contains the TLS library used. Then you get a mismatch (i.e OpenSSL vs. BoringSSL). I think it is better to leave libcurl-impersonate without versioning info, and I believe you can safely ignore this error.
Libcurl impersonate only works in conjonction of LD_LIBRARY_PATH or LD_PRELOAD, but that's not great. Do you know a better way using ldconfig ?
I think these methods should be preferred. I would consider them less hacky than replacing the system's libcurl, which is not really a good way to do this as you mentioned. LD_PRELOAD
exists for exactly these kind of situations :)
Actually, LD_PRELOAD doesn't work due to SONAME
LD_PRELOAD
definitely works even without changing the SONAME. Try doing LD_PRELOAD=/path/to/libcurl-impersonate-chrome.so curl --version
and it will output:
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 BoringSSL zlib/1.2.11 brotli/1.0.9 nghttp2/1.46.0
If I had to guess, what you are seeing is some PHP-specific quirk. My guess would be that PHP loads libcurl dynamically at runtime and somehow uses its symbols instead of libcurl-impersonate
from curl-impersonate.
Is it possible to use the libcurl soname so it will work for every situation without requiring to tweak with patchelf ?
from curl-impersonate.
Related Issues (20)
- Homebrew recipe? HOT 1
- JA4+ HOT 2
- Homebrew unofficial receipt available HOT 1
- Ubuntu 22:04 libcurl-impersonate-chrome.so cannot be preloaded HOT 3
- Websocket on Windows HOT 6
- Pre shared key extension
- make chrome-build fails HOT 1
- Fiddler Intergration / Cloudfare bypass
- WS/WSS Protocol in Docker Image HOT 3
- compile error on boringssl - [-Werror,-Wunused-but-set-variable] HOT 3
- Content-Encoding may be gzip but the response body is uncompressed
- Safari http2 fingerprints are not correct
- make chrome-build failed HOT 7
- Bypassing Cloudflare HOT 6
- Impersonation no longer good enough?
- recompile php with curl-impersonate HOT 1
- curl: (56) HTTP/2 stream 1 was reset
- Namespace wrapping for firefox and chrome in one?
- Use Different browsers, ... , But get same fingerprints
- Precompiled binary doesn't work, but docker version works well for chatGPT.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curl-impersonate.