TongxiJi / shadowsocks-java

shadowsocks server base on netty4 , tcp & udp full support,
MIT License
275 stars 77 forks source link

加混淆这个特性,在Windows上是怎么玩的 #14

Closed mokitoo closed 5 years ago

mokitoo commented 5 years ago

如题,我是在ss的客户端上用了一个simple-obfs的插件,然后用这个java服务端开启http_simple混淆,但是好像用不了

ERROR SSProtocolCodec - client /127.0.0.1:54086,error :java.lang.ArrayIndexOutOfBoundsException SSProtocolCodec - client /127.0.0.1:54086,error :java.lang.NullPointerException

mokitoo commented 5 years ago

我试了下,用SSR的客户端启用http_simple才能用

但是好像后台会报错 WARN AbstractChannelHandlerContext - An exception 'java.lang.NullPointerException' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception: org.bouncycastle.util.encoders.DecoderException: exception decoding Hex string: invalid characters encountered in Hex string

ERROR SSProtocolCodec - client /1.1.1.1:51994,error :java.lang.Exception: unsupported msg type:class io.netty.handler.codec.http.LastHttpContent$1

2019-05-17 22:12:43 ERROR HttpSimpleHandler - simple_http decode error ,pip close

看报错是HttpSimpleHandler 类里面 ByteBuf encodeData = Unpooled.wrappedBuffer(Hex.decode(strHexData)); 这段代码抛出的,strHexData 貌似不是一个hex值,类似于这样的东西 search?src=typd&q=e1f5192adbef416a2f55d0870087cce13cfb20302fa0d47038a8cbb2fc731911643a&lang=en

TongxiJi commented 5 years ago

是的 ssr的 http-simple

mokitoo commented 5 years ago

是的 ssr的 http-simple

但是你看我上面的那个报错

看报错是HttpSimpleHandler 类里面 ByteBuf encodeData = Unpooled.wrappedBuffer(Hex.decode(strHexData)); 这段代码抛出的,strHexData 收到的貌似不是一个hex值,类似于这样的东西 search?src=typd&q=e1f5192adbef416a2f55d0870087cce13cfb20302fa0d47038a8cbb2fc731911643a&lang=en

TongxiJi commented 5 years ago

贴你的混淆参数

mokitoo commented 5 years ago

混淆参数用的是Windows的域名 *****.blob.core.windows.net

TongxiJi commented 5 years ago

strHexData 应该是 IV的

mokitoo commented 5 years ago

没太听懂 这个跟混淆参数有关系么。。。。混淆参数不是可以自定义么

TongxiJi commented 5 years ago

你参数应该没错的

mokitoo commented 5 years ago

对,因为我用ssr的python版是可以用的

那么是HttpSimpleHandler decode 这块的java代码写的有问题么?

TongxiJi commented 5 years ago

你等等, 我当时写的时候是用sockscap64测得, 我刚刚用ssr测了下, 确实发的东西不太一样

mokitoo commented 5 years ago

坐等大佬更新一波代码了~

TongxiJi commented 5 years ago

https://github.com/TongxiJi/shadowsocks-java/commit/d5cc8e9337c455383755845e317c176632728bef 测试完成了, 更新了

mokitoo commented 5 years ago

话说你是怎么做单元测试的啊?直接用ss客户端来测的么…

mokitoo commented 5 years ago

试了下好像有新的报错抛出来 SSCipherCodec.java 的 第49行

Caused by: java.lang.Exception: unsupported msg type:class io.netty.handler.codec.http.LastHttpContent$1 at cn.wowspeeder.ss.SSCipherCodec.decode(SSCipherCodec.java:49)