not a huge problem. I'm curious if you'd be interested in implementing some kind of functionality in mystic to understand this?
Is it documented somewhere? I'm not familiar with how the actual IP is received from the proxy.
Super raw response here, in a rush to take a meeting sorry for brevity.
There is support for two TELNET negotiation sequences for this purpose (Send Location = 23, Terminal Location Number = 28). If the BBS sends
the DO sequence for either of them, then fTelnet will respond back with the user's IP.
Sounds easy enough. It'll probably be harder for me to setup fTelnet
than it will be to make the IP work considering I've never looked at it before.
One thing I worry about though is that terminals could use that to spoof IP addresses in order to bypass an IP block. It'd be nice to determine somehow if the connection was from fTelnet so that it could only acknowledge an IP response from fTelnet. But then the terminal could
just spoof that its fTelnet.
I suppose I could only do it if the address is a local IP 127.0.0.1 or :1 or something?
Since Mystic can spawn multiple copies of its terminal servers, I could also make it a toggle in the TELNET server options and then someone
could spawn a second telnet server on an off-port just for their fTelnet connections while leaving another TELNET server running on port 23 with that feature disabled.
Sounds easy enough. It'll probably be harder for me to setup fTelnet than it will be to make the IP work considering I've never looked at before.
fTelnet has an automagic installer thingie: https://embed-v2.ftelnet.ca - this could help spin something up quick for testing. Just put it in a webroot and paste the crap in the wizard into your index.html or
whatever.
I finally got around to testing this, and the code I did does work to
get the actual IP!
The challenge now is how to best integrate that into the existing
systems? For example, since the IP comes in sometime after the
connection via a telnet operation, we're already past the blacklist checking and IP location resolution.
Another idea might be that the Telnet Send-location would only be
honored if the connection hostname or IP matched a defined value. So if you're running a proxy, all connections should be from the same
hostname. If the connection is from that hostname, then only at that
time would it honor the send location.
There will need to be a lot of shuffling to make this work with the already in place systems, without opening up an easy to exploit security hole. And the differences between how the Unix and Windows versions
work further complicates it.
The default config here could be 127.0.0.1 if someone hosts their own wss service...otherwise I don't think there are a ton of fTelnet proxies floating around on the open internet and could be pretty easy to just document something pointing at the website *shrug*
Gotcha. I'm struggling with some IP detection stuff on my board anyway...maybe it's a linux issue? In any case, even with up-to-date ip2location stuff my location is always some random place, even if the
anyway...maybe it's a linux issue? In any case, even with up-to-date ip2location stuff my location is always some random place, even if the
IP is 127.0.0.1. But that's another issue entirely :P I'm just glad this works!
Hey I doubt this is it, but I was trying to get to the bottom of this again briefly tonight and I noticed that I never initialized the country code result variable.
I don't think this will actually fix it, but its initialized now and I will upload a new build to the prealphas if you are interested in
testing it.
I could even make you a demo program that just spits out a country code when you pass it an IP on the command line. Or if you're confident
enough to toy around in free pascal I could even send you my code for IPLocation.
Hey I doubt this is it, but I was trying to get to the bottom of this again briefly tonight and I noticed that I never initialized the coun code result variable.
Ah, interesting. So you can't repro this in linux?
I don't think this will actually fix it, but its initialized now and will upload a new build to the prealphas if you are interested in testing it.
Sweet deal. I'm off to bed (actually writing this from bed hehe) but will test tomorrow. Thanks!
Ah, interesting. So you can't repro this in linux?
Yeah I've never been able to reproduce it.
Sweet deal. I'm off to bed (actually writing this from bed hehe) but test tomorrow. Thanks!
Cool deal there is also a "testiploc.zip" which is a Linux/64 binary that allows you to look up IP location from the command line. It has to run
in the root Mystic folder though because it looks for "data/iplocation.bin".
If you still have problems with the latest build, maybe trying that command line utility can help us narrow down where the error comes from. If the command line works well, then its not my IPLocation class and its something with MIS itself.
Cool deal there is also a "testiploc.zip" which is a Linux/64 binary that allows you to look up IP location from the command line. It has to run
in the root Mystic folder though because it looks for "data/iplocation.bin".
If you still have problems with the latest build, maybe trying that command line utility can help us narrow down where the error comes from. If the command line works well, then its not my IPLocation class and its something with MIS itself.
If you still have problems with the latest build, maybe trying that command line utility can help us narrow down where the error comes fr If the command line works well, then its not my IPLocation class and something with MIS itself.
Confirmed the "testiploc.zip" package works as expected, but MIS is detecting odd country results. 127.0.0.1 reports consistently "-" for country with the test, but mis reports it as "unknown", blank, "United States of America", and a handful of other random results. Very strange.
Confirmed the "testiploc.zip" package works as expected, but MIS is detecting odd country results. 127.0.0.1 reports consistently "-" for country with the test, but mis reports it as "unknown", blank, "United States of America", and a handful of other random results. Very strange.
I am thinking you have your IP address whitelisted. I think what was happening is that when an IP was whitelisted, Mystic did not do the country lookup and that combined with the earlier thing I mentioned
where the variable was initialized correctly could cause some weird results.
Originally Mystic didn't use IPLocation for anything other than country blocking, but now the country is stored in the user editor and there is
an MCI code to display it, etc. Because of that I've changed it to
always perform the country lookup even when an IP is whitelisted.
Sweet, I'll give the new prealphas a try tonight and let you know how it works out over here. I guess since I'm the only person (really) using my BBS at the moment, I was getting something of a false positive right now.
Sounds good let me know how that goes and then we can move onto
finishing off the proxy send-location stuff. I just need to decide
where I want to put the "proxy whitelist" in the configuration. If it should be a .txt file of IP/hosts or just a single setting in Servers > General Options or maybe just a field in the telnet server settings.
Hey, sorry, I'm like 50/50 on whether or not I'm getting fired soon so haven't had much time for BBS stuff :(
As far as the proxy whitelist config...I suspect there's probably one IP for anyone running their own wss proxy, but anyone using the open/public IP would be potentially a few. So basically anywhere it makes sense to throw an array. I am pretty indifferent since for me it'll always be 127.0.0.1 :)
Oh man sorry to hear that...that sucks. No rush to test this stuff,
just give it a shot whenever. We can pick up where we left off whenever you feel like it.
Its easiest for me to put a field in Server > Gen Options but it
probably makes more sense to put it in the telnet configuration since
its only used for telnet. I think a single value will be okay as long
as it compares that value to both the IP and hostname of the connection.
Sysop: | altere |
---|---|
Location: | Houston, TX |
Users: | 66 |
Nodes: | 4 (0 / 4) |
Uptime: | 14:40:43 |
Calls: | 718 |
Calls today: | 4 |
Files: | 7,654 |
Messages: | 293,881 |