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

Set read deadline while making tlsConn handshake #267

Merged
merged 4 commits into from
Jun 1, 2023

Conversation

RamanaReddy0M
Copy link
Contributor

@RamanaReddy0M RamanaReddy0M commented May 25, 2023

closes #263

@RamanaReddy0M RamanaReddy0M self-assigned this May 25, 2023
@RamanaReddy0M RamanaReddy0M linked an issue May 25, 2023 that may be closed by this pull request
@RamanaReddy0M
Copy link
Contributor Author

Screenshot 2023-05-25 at 8 25 24 PM

Copy link
Contributor

@ShubhamRasal ShubhamRasal left a comment

Choose a reason for hiding this comment

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

The issue mentioned above persists when using the -ce cipher enum with ztls. With ctls taking approximately 1 minute to compute, ztls continues to experience hanging.

tlsx on 🌱 issue-263-timeout-no [$?] via 🐹 v1.20.3 ⚛️ took 47s time echo https://example.com  | ./tlsx -sm ctls  -retry 1 -ce
  

  _____ _    _____  __
 |_   _| |  / __\ \/ /
   | | | |__\__ \>  < 
   |_| |____|___/_/\_\	v1.0.9

		projectdiscovery.io

[INF] Current tlsx version v1.0.9 (latest)
[INF] Started TLS Cipher Enumeration using ctls mode
example.com:443 [tls10] [TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA]
example.com:443 [tls11] [TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA]
example.com:443 [tls12] [TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256]

real	1m2.552s
user	0m0.989s
sys	0m0.400stime echo https://example.com  | ./tlsx -sm ztls  -retry 1 -ce
  

  _____ _    _____  __
 |_   _| |  / __\ \/ /
   | | | |__\__ \>  < 
   |_| |____|___/_/\_\	v1.0.9

		projectdiscovery.io

[INF] Current tlsx version v1.0.9 (latest)
[INF] Started TLS Cipher Enumeration using ztls mode
^C

real	2m7.189s
user	0m1.445s
sys	0m0.459s```

@ShubhamRasal
Copy link
Contributor

ShubhamRasal commented May 26, 2023

The issue mentioned above persists when using the -ce cipher enum with ztls. With ctls taking approximately 1 minute to compute, ztls continues to experience hanging.

tlsx on 🌱 issue-263-timeout-no [$?] via 🐹 v1.20.3 ⚛️ took 47s 
❯ time echo https://example.com  | ./tlsx -sm ctls  -retry 1 -ce
  

  _____ _    _____  __
 |_   _| |  / __\ \/ /
   | | | |__\__ \>  < 
   |_| |____|___/_/\_\	v1.0.9

		projectdiscovery.io

[INF] Current tlsx version v1.0.9 (latest)
[INF] Started TLS Cipher Enumeration using ctls mode
example.com:443 [tls10] [TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA]
example.com:443 [tls11] [TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA]
example.com:443 [tls12] [TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256]

real	1m2.552s
user	0m0.989s
sys	0m0.400s


❯ time echo https://example.com  | ./tlsx -sm ztls  -retry 1 -ce
  

  _____ _    _____  __
 |_   _| |  / __\ \/ /
   | | | |__\__ \>  < 
   |_| |____|___/_/\_\	v1.0.9

		projectdiscovery.io

[INF] Current tlsx version v1.0.9 (latest)
[INF] Started TLS Cipher Enumeration using ztls mode
^C

real	2m7.189s
user	0m1.445s
sys	0m0.459s```

it is working with ztls, but as it has to range over many ciphers than ctls, it taking much longer time

time echo https://example.com  | ./tlsx -sm ztls  -retry 1 -ce -v
  

  _____ _    _____  __
 |_   _| |  / __\ \/ /
   | | | |__\__ \>  < 
   |_| |____|___/_/\_\	v1.0.9

		projectdiscovery.io

[INF] Current tlsx version v1.0.9 (latest)
[INF] Processing input example.com:443
[INF] Started TLS Cipher Enumeration using ztls mode
[ztls] Starting cipher enumeration with 345 ciphers in tls12
[ztls] Starting cipher enumeration with 345 ciphers in tls10
[ztls] Starting cipher enumeration with 345 ciphers in tls11
example.com:443 [tls12] [TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384]
example.com:443 [tls10] [TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA]
example.com:443 [tls11] [TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA]

real	8m37.448s
user	0m2.477s
sys	0m1.003s

pkg/tlsx/ztls/ztls.go Show resolved Hide resolved
Copy link
Contributor

@ShubhamRasal ShubhamRasal 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 54cd9f3 into dev Jun 1, 2023
@ehsandeep ehsandeep deleted the issue-263-timeout-not-respected branch June 1, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timeout not respected in certain conditions
3 participants