Comments (1)
I've been using a fork of this code for years and only just now discovered this huge issue. I am face palming hard. It means that the vast majority of servers aren't going to respond to the stun request because the request will be malformed. Yet here is your issue right here. Posted 8 years ago... You were definitely right. The fact that anyone has success with this library is actually a bug according to the standard. I only learned this by chasing packet logs. It seems the upstream library that forks this (pystun3) has no issues enabled but this is a good place to collect them. I think this is the biggest issue and very easily fixed:
My fix was to set transaction ID to 12 bytes (so its the expected size for the payload) and then prepend the magic cookie hex string where the payload is built. My fix looks like this:
str_data = ''.join([BindRequestMsg, str_len, "2112A442", tran_info_hex, extra_data])
...
I'm not bothering with a pull here because the project isn't maintained and the networking code here is very basic.
from pystun.
Related Issues (20)
- Is pystun still being maintained? HOT 5
- [Bug] The wrong way to determine the port restricted NAT or restricted NAT HOT 1
- [Bug] Never returns OpenInternet if explicit bind address not specified
- Installation on IronPython error
- dict_item indexing issue in Python 3.5 HOT 9
- KeyError: b'0101' issue in Python 3.5 HOT 2
- KeyError: '0100'
- NAT type detect run "Do Test3" had a BUG HOT 1
- how set passwd and username
- i think the stun server is all down, so this tool can't work well now.
- KeyError: u'0800'
- why not test mapping rules?
- TypeError: 'dict_items' object is not subscriptable HOT 2
- Fixed multiple bugs with pystun and added async support
- Broken on Python 3.11 HOT 2
- Stun request doesnt include a magic cookie making all requests invalid for this program (most servers wont work)
- UnboundLocalError
- Logic error in handling error response HOT 2
- always getting 54320 as external port HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pystun.