XAMPP - Share my PC localhost on mobile hotspot to any devices - mobile

I wanted to try localhost in my mobile, so I can see if it is really responsive cause in the chrome there are only few selections like iPad,etc.. so My PC has a mobile hotspot. Is it possible to share my localhost to the connected devices?

Why are you using your PC as mobile hotspot? Isn't there another network that both your PC and other devices can connect to and find each other on?
Either way, localhost is just a shorthand for the local loopback IP address (127.0.0.1), which is used for a computer to handle network requests to itself. Now, if the other devices can connect to the PC, then all you need to do is find out what your IP address on the local network is, if XAMPP's Apache server is listening for requests on the network and if any local Firewall isn't blocking access.
(Windows)Before you do anything else, make sure Windows IIS isn't running! It occupies the default http port (80) and is going to cause problems if it's there!
First up, figuring out your IP address:
(Windows)Open the commandprompt (start -> search cmd.exe or run and enter cmd) // (Linux/Unix/Mac)Open a terminal
(Windows)run ip-config and look for the line that specifies your IPv4 address, write it down if you have to // (Linux/Unix/Mac)run ifconfig and look for the line stating inet.
Either way, this address probably looks like 192.168.X.Y
Next, check to see if Apache is listening
As this is often the default setting, it probably is. So grab any other device connected on the same network and open a browser
In the address bar type the 192.168.X.Y IP address of the PC running XAMPP
If you don't see an error, go to your files and enjoy!
If you do get an error, change the config for Apache (httpd.conf) and search for a line containing "Listen 80", if you can't find it then it's probably listening to 0.0.0.0:80 and you need to edit that line to "Listen 80" as that will allow it to listen to all addresses on the network.
Finally, you can't reach it so check if your firewall is blocking access. This is usually Windows firewall not trusting anything that doesn't carry a Microsoft label
Go to Control Panel > Windows Firewall > Allow a program to communicate through windows firewall > Add another program Name: http Port: 80
If it still doesn't work and you're running Windows, refer to this Stack Overflow question as you are not the first person that has trouble setting things up.

Related

Substrate Blockchain - Create First Blockchain FrontEnd doesn´t open

I am on the first tutorial of Substrate, running substrate on Windows Subsystem for Linux. The substrate network is running correctly, but when I open the frontend on the browser i get this erros:
Because you run on the subsystem I would recommend you to check the network configuration for that. here is my be help :
Sharing Network Resources WSL
I have encountered and resolved this problem. WSL share the same ip with host, you known. you should make sure weather your wsl's ip is the same one that your frontend connect to. Generally, it is same one. I just closed the wls terminal console window and reopen it, it can be works! I don't know why, Perhaps, the bugs of wsl lead to it. Good Luck, guy!
From what I've experienced, getting Windows and WSL communicating through localhost is tricky and prone to falling over. I resolved the issue by making use of WSL's internal network IP address.
When you run the front-end server (yarn start) it shows you the internal network IP you can use to open the frontend. Or you can run
ip addr | grep -E "\b*inet.*global" | sed -E s/inet(.*)\/.*/\1/
(which I got from https://github.com/microsoft/WSL/issues/4636)
Next, you have to run the node-template with the --ws-external flag (in addition to the --dev and --tmp flags), so that it binds to 0.0.0.0 and allows you to connect to from windows.
Finally, you have to edit the src/config/development.json so that the PROVIDER_SOCKER variable uses the internal IP address and not 127.0.0.1.

Ettercap - ARP poisoning unsuccessful

Yesterday I successfully performed a MITM attack by ARP poisoning between my router and my Windows7 computer. I used Ettercap on a Linux machine.
However, today, running the same command does not work anymore. It looks like Ettercap cannot reach my computer, which IP is 192.168.0.17.
Here is what I got :
We can see that the only host added to the list is the router one (192.168.0.1)... What I don't understand is that it was working few hours ago.
I noticed also another thing.
using the command
sudo arpspoof -i wlp20s0 -t 192.168.0.17 192.168.0.1
The ARP poisonning DOES work this time. But now the problem is that it is acting like a DDOS on my victim... It completely loses internet connection.
And before it was not, it was working as expected.
So I guess something has changed on my victim computer but I cannot figure what.
Thank you.
IP forwarding is the ability for an operating system to accept incoming network packets on one interface, recognize that it is not meant for the system itself, but that it should be passed on to another network, and then forwards it accordingly.
From https://openvpn.net/faq/what-is-and-how-do-i-enable-ip-forwarding-on-linux/
When you perform MITM packets that don't match your IP are being sent to you and are not passed on correctly so the victim can reach out to the internet. With IP forwarding enabled your computer will reroute the packets correctly and the attacked computer will have access to the internet.
On Linux if I remember correctly:
echo 1 > /proc/sys/net/ipv4/ip_forward
will fo the job.
Arp replies are stored in cache, so first of all do some tricks here:
Remove arp cache from windpws with cmd.
(Cause the first priority is the cache and if host cant find the mac address it will generate an ARP request,then your router will repliy with ARP reply)
issue this command to see arp table:
arp -a
When you do Mitm with arp spoof and your computer looses internet connectivity it might be your DNS misconfiguration.
You ll need to enable dns server.
(If wan to brows web pages)
Try to do it with ettercap and enable arp poision and dns spoof module.

Howto connect to localhost:8888 from another device on the same network?

I'm trying to test my application that I develop using the Google AppEngine.
When I want to test from the computer I use to develop the application ("localhost:8888" in my browser) everything works perfectly.
But when I want to test it from my android device's browser, using "192.168.5.194:8888" (the local IP adrress of the computer), it gives me nothing (it just tries to connect to the site unsuccesfully).
So, my computer and my browser are on the same LAN. The comp is running a win7. I use eclipse (Kepler) to develop.
Your help is appreciated.
In the documentation under command line arguments there is a parameter called host.
You can start you local environment like
./dev_appserver --host=0.0.0.0
You have to replace 0 with your actual network ip address, something like 192.168.0.42 which can be found with ifconfig command in a linux all mac terminal, ipconfig for windows.
If you visit from your favorite browser your actual ip address for example 192.168.0.42:8080 at 8080 port if you didn't set one manually you will be able to access your local machine from any browser on the network.
The above instructions apply only in a non graphical environment if you are using the application for starting your server I haven't checked it out, and I can't right now cause I am running on Linux, but I am quite confident that you can define a host somewhere in the parameters.
Add the following command line flag to the App Engine launcher: --host=0.0.0.0

As a working-traveler, is there a way to get around port 80 blockage without touching the router?

I work while traveling at the moment. I'm at the point where I want to start setting up the paypal integration, but I can't because I can't open port 80 up so that paypal sandbox can communicate with my computer. I've tried getting my own USB modem w/ sim card (data plan) but it seems they are really aggressive with blocking ports on those also.
So, i can't get to the routers in the hotels since it would be wrong (and i don't have the passwords).
Is there some kind of trick that I can use so I can mess with paypal sandbox integration? I've tried using hosting (godaddy) but it's awful slow to keep uploading changes to a host just to see if what you did worked (not to mention problems with debugging).
Looks like i didn't get any help this time, but i found a way around it! I created a VPN in Windows 7 in my home network (so my work laptop can connect back home). I checked the setting that allows remote vpn connections to pick their own IP address so my work laptop would have a static ip.
I then simply opened up port 80, and forwarded it to the static IP set for my laptop. I can't believe it, but it works!

Address already in use while executing C socket programme

Hii All,
While running a socket programme (server side ) am getting message like
Address already in use
Am trying to connect to port 80 since port 80 is reserved for https application So before running server side programme i am closing all application that uses https application ,is it enough...
or am doing it wrong??
Am trying to make a communication between browser and termial...
You must run your application as super user(root) on Linux or administrator privileges on Windows in order to bind to port 80. This is the case for all service ports, which is < 1024. Either that or there still is another program binded to that port.
Try using netstat to find out what programs might be listening on port 80.
Example:
on Linux:
netstat -punta
on Windows:
netstat -ban
Both must be run with super user/admin privileges in order to see the program names that bind to specific ports.
If you just closed another process listening on 80 port, this port will be blocked for a certain timespan depending on your OS. This behavior is here to prevent an attacker to crash a service on your machine and immediately restart a malicious service on the same port.
This behavior can be disabled by using SO_REUSEADDR (by using setsockopt).
If your main problem is to communicate from a custom server to your broswer, you can use any port in your server for providing HTTP (8080 is common for that), just specify the port in the url http://server:port/ (ie. http://localhost:8080/)

Resources