Restrict selenium 2 port - localhost only - no external IP access - selenium-webdriver

I have a headless setup in a VPS where selenium server can run - without X server. However, the selenium port is accessible via port 444 across the internet.
Is it possible so that only localhost:4444 is only allowed and external access is not allowed? Be it selenium command line option or firewall/ip table option.
I usually let the port 4444 open like 2-3 hours while doing testing and I'm afraid of being attacked on that port.
I'm using selenium-server-standalone-2.32.0.jar and behat+mink.
Thanks

Why not trying to close port on WAN interface using iptables or equivalent ?
If you and only you, need to access it using internet, consider setup a VPN.

Related

how to self-hosting a website on ubuntu 18.04 system and using lampp server?

I'm trying to self hosting a website on ubuntu 18.04 system and using lampp server. i can not access the site through my public ip address. can anyone help me out?
i have also created a virtual server in my router. but till something is wrong.
you can do that by logging into the router which provides you the internet …
then make port forward to all the requests that coming from external under port 80 ( which is the http browsing port ) and forward it to the IP which has your ubunto OS …
you may as well add RDP connection if you have windows , in short , you will have to find the responsible port which works for each protocol and then forward it to your ubunto OS
like https , will work under 443 so you may as well forward it if you wan your website to work securely as https .
as for the domain name … you may use services fore free like DYN.com or noip.com
some routers btw can accept logins directly from dyn and noip and other similar websites which provide the dynamic hosting service .

Not able to access a port on ec2 instance for an Angular app

I am working on an angular app using the angular cli to set things up. Running the ng serve command spawns a server at this address <my_ec2_host_name>:4200. When I try to access the page on the browser it doesn't work (connection timed out error). I believe this is because of security reasons so I added the following rule to my security groups for the ec2 instance:
Port 4200 should now be accessible but I still can't get the page to load. Can someone think of how to get this to work?
Start angular with below command.
ng serve --host=0.0.0.0 --disable-host-check
it will disable host check and allow to access with IP
You can set up the host option like this:
ng serve -host 0.0.0.0
The steps you are doing are correct for opening a port via Security Groups in the EC2 console. Make sure you are modifying the correct security group, and make sure that your changes have been saved.
Your container may have additional firewalls in place, so you will want to check the OS documentation. For Example, RHEL uses iptables as a further security measure: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide-IPTables.html.
That looks correct. Are you sure that your server is running and listening for connections?
You should ssh to that server and verify that the page can be loaded locally. Eg:
curl http://<YOUR HOST IP ADDRESS>:4200
eg: curl http://54.164.10.123:4200
You should be careful to use the public ip address (eg: IPv4 Public IP when you're in the EC2 console). I've run into problems in the past where I've got a server listening on one IP address (often localhost) and not the public ip address.
Also maybe a problem: Is your host inside a VPC of some sort?

How to use local macbook server to allow multiple devices to view Reactjs page?

I have a local server running Reactjs on my Macbook. (newbie in React)
1) How could I change the http://localhost:4001 name to something else (e.g. http://www.test.com)
--> I'm using webpack-dev-server --port 4001
2) How could I allow up to 500 iOS/Android device to connect to this local server? (e.g do how to setup a router to broadcast this?)
--> Found this ReactJS-and-ngrok but not sure what's the concurrent users it's able to support.
3) How to allow the device to connect to a wifi without internet access?
First, see what IP is your Macbook in your local network. System Preferences->Network. Suppose your Macbook IP is 192.168.1.70 and your server is on 4001 port. Then you can start your webpack-dev-server with the following options: --output-public-path="http://192.168.1.70:4001/" --host="0.0.0.0" --public="192.168.1.70:4001". You can still access it via localhost name on Macbook, but on other devices use full IP + port number as address.
Can't say anything about setting domain... may be you can configure your router somehow? Sorry, newer had to face such a task

Webstorm localhost from mobile

I can't access my Webstrom localhost on port 63342 from mobile.
I opened the port in Windows firewall and ESET (but port online checkers say me that the port still close).
I checked option "Can accept external connections" in Webstorm (but it caused message that Built-in HTTP server on that port disabled).
But when I check 192.168.0.48:63342 in mobile chrome - it still not available.
Please help.
I'd suggest using a different port (8080, 8090) if you need to access the server from another host. External connections to 63342 are not supported for security reasons.
Here are instruction for connecting to WebStorm internal web server from a different host:
- on a remote host, make sure to install JetBrains IDE Support extension into Chrome
- in extension options (chrome-extension://hmhgeddbohgjknpmjagkdomcpobmllji/options.html), specify the IP and port of the target machine
- on a target computer, start WebStorm, make sure that the port specified in Settings/JavaScript/Debugger is the same as above and 'Can accept external connections' is on. Open your project and run your application
Changing the port number to something else than 63342, does work. However I had some difficulties changing the debug port number. If you have the Chrome plugin, changing the debug port number from Webstorm's settings will not override the plugin's default debug port. Thus, you should right click on the plugin, click "Options", change port number and hit apply. At the same time, you should enable external connections in Webstorm's settings: "Settings/JavaScript/Debugger". Then you can access your web app from your smartphone by specifying the IP and port address of the app.

Public LAMP with a modem and router

I am using an Apache2 with a PHP and MySQL installed on Ubuntu. What I would like to do is to run the server public, to access it from outside my network.
However, I am having trouble configuring it, since I am using a ZyXEL P660HW-T3 v2 ADSL Modem with an IP 90.xxx.xxx.xxx together with an ASUS RT-N16 Wi-Fi router with the LAN address 192.168.1.1.
Could someone help me to set up the configuration file correctly to make the server public?
You need to configure your router to forward port 80 from the WAN interface to 192.168.1.1.

Resources