hmgle / graftcp

A flexible tool for redirecting a given program's TCP traffic to SOCKS5 or HTTP proxy.
GNU General Public License v3.0
2.07k stars 174 forks source link

Improve efficiency / speed #58

Closed m3dus444 closed 1 year ago

m3dus444 commented 1 year ago

Hi man ! The work you made is insane, it works perfeclty for me. I ended up here because i needed to proxy my traffic from some Go pentesting tools (like Kerbrute). I wanted to say congrats, and also bring to light something you could improve : speed. I don't know if it's possible for you to add an option to set a number of threads or something like that, but i've noticed that it took me like 25 min to make a basic kerbrute attack (which usually takes less than 1 min).

I was wondering if theres a way for you to improve that, because it can be very unpractical if we need to proxy a lot of requests.

Anyway, that is said, you did a great job man. Thanks a lot ! ❤️‍🔥

hmgle commented 1 year ago

Thank you for your feedback! I'm glad to hear that the tool works well for you. May I confirm the version you are using? The latest version(v0.6.1) has greatly improved its speed through seccomp-bpf. According to my tests, it is now very close to the speed of the original program. If you are already using the latest version(v0.6.1), please let me know and it would be great if you could provide a speed comparison with the original program.

m3dus444 commented 1 year ago

Hi, thanks for the quick answer you gave me, i wasn't online this week-end. I do use the 0.6.1 version (i just checked but i was quite sure because I've downloaded the latest release at the time i wrote the issue). It might be the network that was laggy at the time, or the tool itself (not yours but the one i was proxying) because I tested others techniques/tools and i had native speed like everything was alright... So I'm not sure, if i come across the same situation in a different environment and I notice the same problem I'll let you know (I'll send you a dm with the logs or smth) , but for me it was an external issue, so false positive, my-bad 😞

That is said, I'm closing the issue now, thanks again ! 😃

EDIT : I just tested the network between the two hosts and that's the result i had : `Connecting to host 10.129.213.186, port 5201 [ 5] local 10.10.16.11 port 37838 connected to 10.129.213.186 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 431 KBytes 3.53 Mbits/sec 0 46.6 KBytes
[ 5] 1.00-2.00 sec 269 KBytes 2.21 Mbits/sec 0 58.3 KBytes
[ 5] 2.00-3.00 sec 356 KBytes 2.92 Mbits/sec 0 73.8 KBytes
[ 5] 3.00-4.00 sec 254 KBytes 2.08 Mbits/sec 0 89.3 KBytes
[ 5] 4.00-5.00 sec 381 KBytes 3.12 Mbits/sec 0 105 KBytes
[ 5] 5.00-6.00 sec 381 KBytes 3.12 Mbits/sec 0 126 KBytes
[ 5] 6.00-7.00 sec 381 KBytes 3.12 Mbits/sec 0 170 KBytes
[ 5] 7.00-8.00 sec 254 KBytes 2.08 Mbits/sec 0 236 KBytes
[ 5] 8.00-9.00 sec 317 KBytes 2.60 Mbits/sec 0 298 KBytes
[ 5] 9.00-10.00 sec 381 KBytes 3.12 Mbits/sec 0 401 KBytes


[ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 3.32 MBytes 2.79 Mbits/sec 0 sender [ 5] 0.00-11.27 sec 2.88 MBytes 2.14 Mbits/sec receiver

iperf Done. `

So it has to be kerbrute, i did try to increase the number of threads but i didn't really changed anything. Lemme know if you want some details.