gojue/ecapture

how to print text not hex in curl

fancy45daddy opened this issue · 7 comments

I try curl https://httpbin.org/ip

But in sudo ecapture tls
00000000 00 00 12 04 00 00 00 00 00 00 03 00 00 00 80 00 |................|
00000010 04 00 01 00 00 00 05 00 ff ff ff 00 00 04 08 00 |................|
00000020 00 00 00 00 7f ff 00 00 00 00 00 04 01 00 00 00 |................|
00000030 00 00 00 70 01 04 00 00 00 01 88 61 96 df 3d bf |...p.......a..=.|
00000040 4a 01 e5 30 96 35 04 01 34 a0 19 b8 06 6e 01 d5 |J..0.5..4....n..|
00000050 31 68 df 5f 8b 1d 75 d0 62 0d 26 3d 4c 74 41 ea |1h._..u.b.&=LtA.|
00000060 5c 02 33 30 00 85 41 6c ee 5b 3f 8b 9a da 8c 43 |.30..Al.[?....C|
00000070 d9 53 01 7d 77 d7 07 00 93 19 08 54 21 62 1e a4 |.S.}w......T!b..|
00000080 d8 7a 16 1d 14 1f c2 c7 b0 d3 1a af 01 2a 00 96 |.z...........*..|
00000090 19 08 54 21 62 1e a4 d8 7a 16 1d 14 1f c2 c4 b0 |..T!b...z.......|
000000a0 b2 16 a4 98 74 23 83 4d 96 97 00 00 1e 00 00 00 |....t#.M........|
000000b0 00 00 01 7b 0a 20 20 22 6f 72 69 67 69 6e 22 3a |...{. "origin":|
000000c0 20 22 32 34 2e 36 2e 32 31 34 2e 37 36 22 0a 7d | "24.6.214.76".}|
000000d0 0a 00 00 00 00 01 00 00 00 01 |..........|

I try sudo ecapture tls -m text but still not help

it seems like encode bytes,not entrypted?

or ecapture works.

I try in wget

wget https://httpbin.org/ip -O -

sudo ecapture tls output:

ET /ip HTTP/1.1
Host: httpbin.org
Accept: */*
Accept-Encoding: identity
Connection: Keep-Alive
User-Agent: Wget/1.21.2


tls_2024/02/08 15:33:59 UUID:227447_227447_wget_3_0, Name:HTTPResponse, Type:3, Length:259
tls_2024/02/08 15:33:59 
HTTP/1.1 200 OK
Content-Length: 30
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Type: application/json
Date: Thu, 08 Feb 2024 23:33:58 GMT
Server: gunicorn/19.9.0

{
  "origin": "24.6.214.76"
}

It is only text output not hex output. Is there any way to curl output text just like that in wget not output hex?

Is your curl using the nspr or gnutls library?

You can confirm it by using the ldd command.

ldd `which curl`|grep -E "libssl|nspr|gnutls"

You can fix this problem by modifying EventTypeEventProcessor to EventTypeOutput.

event.eventType = EventTypeEventProcessor

event.eventType = EventTypeEventProcessor

the outpt of ldd which curl|grep -E "libssl|nspr|gnutls" is

libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007f989a2c7000)
libgnutls.so.30 => /lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f989994c000)

You means I need to change ecapture/user/event/event_gnutls.go

Line 103 and compile the source code?

That's right.

ping?

No response for more than 7 days