Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Support for TLS ClientHello randomization (experimental) #1199

Merged
merged 5 commits into from
Jun 17, 2023

Conversation

Mzack9999
Copy link
Member

@Mzack9999 Mzack9999 commented May 30, 2023

Description

This PR adds support for random tls impersonate

echo https://192.168.1.1 | httpx # standard
for i in {1..2}
do
 echo https://192.168.1.1 | httpx -tls-impersonate
done

image

while true; do echo https://tls.peet.ws/api/clean | ./httpx -tlsi -json -irr -silent | jq -r '.body | fromjson | .ja3_hash'; done
426883aecb370a32eb7e56d49fcbd109
872f0f752cb3c72e60ea0e75a8cf447b
746e5c2e7c3165381c4ed314b4ddb72a
3d2221a43cb6d3c2ca9a24c90b11c58d
49e3e2fba8a75dbf1f30322b28b6b4ff
ee08e8edec425a5a45eabf3adb651dc0
de7cca01df4fa791dd924d91ac05d186
050fa02ddb4fb8db45d02dcbc1785e74
3fa63fa34ee5d0fb6a8ee262715aee7d
391292581b5f4526c9e85a40b963ca14
d7cbe86a3bd3e661aa15fd577e478b00
3c5c2f19ba499ebe18ee8127a1ce8e15
a57c2fb52cb1fd78c2018a7263d08c0d
20aa66ed9663337d0cf4a7d9df538a30
d41affdd476b4a50cbcb7b9b0ea10214
8fa12d16dd6866afa6cbf48b4d0c5b1b
5fea1927e70bb4fc7f657e974d7128a1

Further possible improvement - https://github.com/projectdiscovery/team-backlogs/issues/172

@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label May 30, 2023
@Mzack9999 Mzack9999 self-assigned this May 30, 2023
DialContext: httpx.Dialer.Dial,
DialTLSContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
if options.TlsImpersonate {
return httpx.Dialer.DialTLSWithConfigImpersonate(ctx, network, addr, &tls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS10}, impersonate.Random, nil)

Check failure

Code scanning / CodeQL

Disabled TLS certificate check

InsecureSkipVerify should not be used in production code.
DialContext: httpx.Dialer.Dial,
DialTLSContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
if options.TlsImpersonate {
return httpx.Dialer.DialTLSWithConfigImpersonate(ctx, network, addr, &tls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS10}, impersonate.Random, nil)

Check failure

Code scanning / CodeQL

Insecure TLS configuration

Using insecure TLS version VersionTLS10 for MinVersion.
Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for i in {1..10}; do echo evil.com | ./httpx -tls-impersonate -silent; done
Screenshot 2023-06-12 at 2 16 38 PM

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

@ehsandeep ehsandeep merged commit 8ea85e9 into dev Jun 17, 2023
@ehsandeep ehsandeep deleted the feat-tls-impersonate branch June 17, 2023 11:04
@ehsandeep ehsandeep changed the title Adding prototype of tls impersonate Added Support for TLS ClientHello randomization (experimental) Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants