grongor / knock Goto Github PK
View Code? Open in Web Editor NEWSimple python port knocking client
License: MIT License
Simple python port knocking client
License: MIT License
Hello i am a noob please can you explain how can i use Knock to hide port usage, thank you
I've added the support to my own fork: https://github.com/pro-src/knock
Generates sequences using a CSPRNG and saves them in a knockd compatible file
Reads one-time sequences from a file
Returning tuple from socket.getaddrinfo() too long using IPv6.
Working for IPv4 / IPv6:
self.address_family, _, _, _, addrinfo = socket.getaddrinfo(
host=args.host,
port=None,
flags=socket.AI_ADDRCONFIG
)[0]
self.ip_address = addrinfo[0]
@grongor
I suggest an adjustment something like:
- self.host = args.host
- self.is_ipv6 = args.host.find(':') != -1
+ self.addr = socket.getaddrinfo(args.host, 0)
+ self.is_ipv6 = self.addr[0][0] == socket.AF_INET6
- s.connect_ex((self.host, port))
+ s.connect_ex((self.addr[0][4][0], port))
allow user to chose what protocol to knock in each port
I have implemented it, see pull requests.
@grongor
For UDP s.send(...) needed between select.select(...) and s.close(...)
select.select([s], [s], [s], self.timeout)
+ if self.use_udp: s.send(bytes('', 'utf8'))
s.close()
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.