sanecz / pingtunnel Goto Github PK
View Code? Open in Web Editor NEWa tiny TCP over ICMP tunnel in pure python
a tiny TCP over ICMP tunnel in pure python
This part of code, basicly the struct parts and not functioning correctly, if you help me with that i will share with you also a private project of mine, i mannged to use your code to make reverse Socks5 proxy server using ICMP.
BUT i need to work in python3 since my code is in python3, im not able to figure out the logic of what you did there i port it my self, please help :)
Thanks in advance
def create(self):
pack_str = "!BBHHH4sH"
pack_args = [self.type, self.code, 0, self.id, self.sequence,
socket.inet_aton(self.dest[0]), self.dest[1]]
if self.length:
pack_str += "{}s".format(self.length)
pack_args.append(self.data)
self.checksum = self._checksum(struct.pack(pack_str, *pack_args))
pack_args[2] = self.checksum
return struct.pack(pack_str, *pack_args)
From the README.md
, it looks like you want to rework the thread & socket management. The Python community seems to have shifted to the asynchronous IO paradigm. It could probably give cleaner code & better performance.
For a small project build from scratch that doesn't need to leverage other libraries I would recommend curio (much easier to grasp and has less pitfalls than asyncio or there is trio which I never used but is inspired by curio's design principles).
I'll let you look at the examples to see how much the a client/server implementation may be cleaner.
Also, it seems you require root permissions so why don't you bring up a real tunnel and handle more than TCP by creating TUN or TAP devices (by opening /dev/net/tun
on Linux)? It's easy to do with Python, if a bit obscur (since you'll have to define a couple of things yourself instead of relying on header files). The downside being you'll probably need to assign IP addresses on both sides.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.