douzhong2954 2018-06-14 07:35
浏览 74

go_lang中的“制作” TLS客户端Hello

I am new in the go programming language and I am crafting Ethernet frames myself with the "gopacket" library of Google. I have successfully implemented basic TCP functionality in userspace for educational purposes and I can successfully initiate 3-way-handshakes with Webservers.

Now I would like initiate a TLS handshake on top of this and my problem is that all existing TLS libraries in go use sockets or the Conn interface to initiate TLS connections. Is there some easy way to craft a raw TLS Client Hello message in go that I could use as a payload for my TCP segments?

I do not want to implement fancy things like data transmissions or whatever. It is enough if I would be able to send a Client-Hello to a server and see what the reply looks like before ending the connection.

Thank you for any advices you may have for a newbie in go. :-)

  • 写回答

2条回答 默认 最新

  • dtpt75860 2018-06-14 08:45
    关注

    I'd say one way would be to mock a Conn you feed to the TLS library so you can intercept the calls and forward/relay them or... you do this the manual way by looking at for example handshake_client.go and copy whatever you need (the methods it contains are sadly private only).

    Personally I'd probably go for the Conn approach.

    评论

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献