How to access devices with IPV6 link local address from browser(like IE,firefox etc)? - server

Both my device and the host through which i'm trying to access are in the same subnet.
Scenario:
I have a switch and a server in same subnet. I have to access switch using ipv6 link local address from the browser in my server.
Can anyone pls tell me the exact syntax??

To give an answer specific to browsers: for most common browsers, you can't.
There is a proposed standard format, as Sander Steffann pointed out, for specifying the interface for a URL, which is in RFC 6874.
The developers of both Chromium and Firefox, and seemingly most other browsers, have decided to intentionally not support this. Firefox has actually had ipv6 link-local support intentionally removed. Bug reports are closed as WONTFIX. See Chromium bug 70762, and Firefox bug 700999. Furthermore, WHATWG also rejected implementation of RFC 6874. This has been the case for years, so I doubt anything short of a patch or fork will result in link-local addresses working. It appears that a number of people are quite set on not allowing link-local address support.
One workaround, however, is to use SSH forwarding. For example,
ssh -L '8080:[FE80::XXXX:XXXX:XXXX:XXXX%wlp4s0]:80' localhost

A link local address can be valid on multiple links. If for example your system has both Ethernet and Wi-Fi those might be connected to different networks. Therefore you need to add a scope identifier to a link-local address. The syntax for that is to add % and the scope to the IPv6 address. The score is usually the name of the interface, for example eth0 or ens192 on Linux, or 13 on Windows. The value is different on each system, so you'll need to check what to use in your case.
That gives you for example fe80::1111:2222%eth0. The problem is that % has special meaning in URLs, so you need to escape it. The escape for % is %25.
The correct URL syntax is http://[fe80::1111:2222%25eth0]/. The official standard for this is RFC 6874. Unfortunately many browsers don't follow the standard, so it might not work for you. In that case please file a bug report. There need to be more people complaining to get this fixed.

For those who have no sshd server set up on their laptop and find it would be troublesome to set up one --- try finding port-forward scripts.
Here is a usable python script, without external dependencies.
https://gist.github.com/NeverBehave/357ca63941d4af4ee3f54920be3d1f3c

Related

.gethostbyaddr() does not work on all devices. Why? (Python)

I wrote a script that goes through all local IPs in the '0' network (192.168.0.*).
I use a loop with socket.gethostbyaddr(ip_modified_by_the_loop_each_time).
The loop returns me 3 devices their hostnames.
Now, I found that it does not find 4 devices (at least).
It does wind my Windows Laptop, not my Android Phone. It does find
one MacBook, not the iMac, not the other MacBook. It also does not
find any phone.
I know that all the devices are online and have an IPv4 address.
I can ping them very well, it responds just fine. But when I use socket.gethostbyaddr(ip_modified_by_the_loop_each_time) it throws an error.
I used a try:/except: statement to get around the error, but it still can not find my phone by IP and get the hostname, but I know it is there.
I am using python 3.3
Why is that happening, how to fix that?
Thank you.
gethostbyaddr tries to find out the hostname for a given IP address by using either locally stored information (i.e. /etc/hosts) or doing a reverse DNS lookup. The result does not depend on the host being online or not, they only depend on the availability of these information.
And these information can also not be trusted. For example the DNS operator of a domain could add the following records:
test.example.com A public.ip.of.test
public.ip.of.test PTR localhost.
In this case a lookup (gethostbyname) of test.example.com would return the IP address of this host while a reverse lookup (gethostbyaddr) would claim that the hostname is localhost. And if the PTR record would be missing gethostbyaddr would fail, even if the host is online.
See also wikipedia: reverse dns lookup.

Hosting a website using server software

How can i host a website through my computer using server softwares?
I tried to host a website through my own computer using apache tomcat server but it didnt work ( please briefly explain every point )
The main issue that you need to deal with is getting the clients to your computer.
Yes, it is possible and yes I have done it, albeit a while ago.
You need to see if you can browse to your computers website from another device on your network, this will ensure that apache is working. Try another computer/laptop/tablet/whatever to see if this site reachable by other computers using the IP Address and possibly port number. If you cannot get to the site, there are settings in apache to deny certain ip's, google it to get the exact steps for your version. If it works, move on to step 2.
You will need a static IP Address to ensure that all further steps stay working, google this if you are not sure how to do it
You need to have the external IP address of your router(whatsmyip.org) or use Dynamic DNS to route traffic from an address to your ip and there are services that allow this. I can recommend no-ip.com - This is all assuming that you have access to the router.
You would be required to set up port forwarding on your router. This will direct the internet traffic to your computer. You will need to get the exact instructions for your specific model of router.
Please be aware that you need to have proper firewalls and systems in place to prevent attacks. I am sure that you are just testing at this point though...
All the best!

How can I reach my localhost over the web from outside local? i.e ip/page?

I installed usbwebserver
everthing is running, I am trying to reach the root page index.php?
I read everything I possibly can and sorry but I still cant figure out how to reach my localhost
I reach my page with localhost:8080 and the page I want shows up but if I replace it with IP:8080 it does not.
I am trying to reach this page outside of my local network.
I'm sorry, I need to provide you a separate answer for your reformatted question for the "down the street" scenario. I can troubleshoot a few of the issues you're probably having.
ISP's don't typically allow residential internet connections to serve resources over port 8080, or 80. Even if you were to configure your computer as needed, if you're on a standard internet service provider they're probably blocking you in the middle even if you have punched holes all your local security in an attempt to serve assets over port 8080/80.
Assuming they don't allow that you're going to have to first configure your outbound middleware(php in your case) to listen to calls into your ip on a different port. ( You can do this in your C:\WAMP\ folder, in the "wampserver" configuration file. Here's a good walkthrough here: (http://forum.wampserver.com/read.php?2,13744)
Now, you're going to have to drop any firewalls windows/ubuntu/macOS are providing on that port. (This is the part where you've rolled out the red carpet for hackers to get into your box(es) so be careful!) Here's a link for a short and sweet explanation on windows here: (http://yourbusiness.azcentral.com/turn-off-windows-firewall-19396.html) Note that you can open individual ports, you don't have to drop your entire firewall.
Make sure you have opened up access to any folders/mySQLdb's/resources to outside requests as well (seriously, this is a REALLY bad idea from an #home server if you don't know what you're doing)
Then figure out the correct ip and the correct port and give it a go! If it still doesn't work you can download a program like [wireshark] (https://www.wireshark.org/download.html) or [fiddler] (http://www.telerik.com/download/fiddler/fiddler2) to debug your inbound/outbound traffic and see what the machine's seeing before your browser/server gives you any user visible information.
One thing to note, if you are an amateur web developer your homepage is called "index.html" not "home.html" "home.html" only works fine locally, but internet browser engines look by default, for "index.html"
Lastly, and I really can't stress this enough don't host through your personal ISP and serve files from your own machine. Hosting through Fatcow, or hostgator, or any of the other hosts is really honestly dirt cheap and they know far better than you or I do about security.
That said, I hope very much that you succeed in using my answer, or at the very least learning something from it. Happy Coding!
http://www.canyouseeme.org/
--
Read the Background session
go to a command line, type "ipconfig"
Hit Enter.
Under "Ethernet adapter Ethernet:
It should be the third line down, has your following:
IPV4 Address : 192.168.1.xxx where "xxx" is your ip
address.
USE "//" + "the ip address shown for (ipv4)" plus ":8080" and your default page
should show just fine.
For example, if your cmd "ipconfig" for this process reads: "192.168.1.12"
your total URL in your browser will be "//192.168.1.12:8080"
Note that I used 2 forward slashes prior to using an IP address on your
local network. That let's your computer know it's using your network, not
the actual internet. The slashes alone may solve your problem. Also note, if you're accessing a database through your webapp, you will also need to properly configure your db settings to allow access.
First find your outside ip adress not local ip. After that go into router panel and open to use from apache server. Anyone able to access that port now. You can connect outside your local website now. If you can't do that. Try again. This is the way to doing this.

Binding to alternative IP in HttpWebRequest doesn't work in Windows Server 2008

I am trying to bind a HttpWebRequest call to a specific IP on my server (which has many IPs). I have successfully written this code using BindIPEndPointDelegate and it works well on my local machine (Windows 7)
My issue is with Windows Server 2008. When I run the same console app on Windows Server 2008 it fails to bind to the IP when using the delegate. To complicate matters further, it seems to work for some destination URLs (http://www.microsoft.com) and doesn't work for some (http://www.google.com, http://www.facebook.com)
If I remove the IP specific binding (delegate) and run the app it works for all URLs.
The IP I am binding to is the default server IP address - meaning, in both scenarios the same IP should be used. I have verified this and it uses the same IP if I don't bind using the delegate. If I explicitly specific the IP it fails as described above.
I have tried turning off firewall, IIS & Antivirus - the problem persists.
Alright finally figured it out.
Upon testing again I found that specifying IPAddress.Any did not work either. On the other hand, IPAddress.IPv6Any worked fine.
Finally, I unchecked the IPv6 protocol in network adapter settings and the app starting working properly for all URLs and binding for all local IPv4 addresses.
Not sure if this is a bug in .NET code or feature - but disabling IPv6 fixed it for me.
Lastly, if anyone is facing "The requested address is not valid in its context" while making calls with binding, try disabling your antivirus.

How to capture loopback traffic in Windows Server 2008

Setup:
I have client C connecting to server S
Both C and S are on the same machine
In C the server address is hardcoded to 127.0.0.1. Likewise, in S the client address is hardcoded to 127.0.0.1
Problem:
I want to be able to sniff the traffic between the client and the server.
Due to the configuration, I cannot move the client nor the server to different locations (the address are hardcoded)
Installing the loopback interface and using tools like Wireshark+WinPcap doesn't lead anywhere (was actually already known but was worth a try)
RawCap, suggested in another topic, doesn't work. IP 127.0.0.1 is listed, but does not record any traffic.
Using rinetd to route the traffic elsewhere, as suggested here doesn't work (cannot bind on 127.0.0.1)
Not interested in using a HTTP local proxy, such as Fiddler, because I'd like to capture also other protocols
Two commercial tools work, specifically CommView and Local Network Monitor, which means it must be possible to do that ;)
How can I do to capture the traffic?
Any pointer on functions I should use or documentation I should read?
Thanks!
Basically you need to write a TDI filter driver to achieve that... for some pointers see:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff565685%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/hardware/ff563317%28v=VS.85%29.aspx
Another option is to write a WinSock LSP.
BEWARE
Since Windows 8 it is strongly encouraged to use WFP (Windows Filtering Platform) for this sort of thing...
Although it might be more cost-effective to just use/buy an existing solution - esp. if you are not a very experienced driver developer...
Use RawCap, which can solve your concerns, see this