my software on the local machine needs to send http request to a specific web server , is there any way to protect the http request url from being found by Packet analyzer software like Wireshark and fiddler.
The sever is not mine, so I can do nothing in the server .
It would be better to show some code, I am an absolutely newbie in encryption .
P.S the server doesn't support https protocol
After some retinking on my question ,I found what I am really want is not let any other guys using packet analyzer software know the server name (host name) my software is sending data to .
so I translate the host name to IP address format, it somewhat hide the host name.
Another question is : for common sites, is the IP address under the host name hardly changing ?
Related
I have never used OPC-UA before, but now faced with a task where I have to pull data from a OPC-UA machine to push to a SQL database using python. I can handle the database part, but how to basically connect to the OPCUA server when I have only the following fields available?
IP address 192.168.38.94
Port 8080
Security policy: Basic256
Username: della_client
Password: amorphous##
Some tutorials I saw directly use a url, but is there any way to form the URL from these parameters, or should I ask the machine owners something more specific to be able to connect? I just want to be sure of what I need before I approach him.
Related, how to use the same parameters in the application called UA-Expert to verify the connections as well? Is it possible?
If it is relevant, I am using python 3.10 on Ubuntu 22.04.
You need to know which protocol is used. Then you can create the URLs by using the IP address as domain:
OPC UA binary: opc.tcp://ip:port
https https://ip:port
OPC UA WebSockets opc.wss://ip:port
http http://ip:port (Deprecated in Version 1.03)
In your example this could be opc.tcp://192.168.38.94:8080 or https://192.168.38.94:8080
In most cases, the binary protocol is used. But the port 8080 is a typical http(s) port.
The credential and the securityPolice are needed later in the connection process.
And yes: You can test the URLs with the UaExpert. You can finde a step-by-step tutorial in the documention
What I am doing
I have a flask website and I am making it accessible to a client using ngrok tunneling.
What I want
I am trying to get the IP address of the client.
What I have done so far
I have tried these so far,
request.environ.get('HTTP_X_REAL_IP', request.remote_addr)
and
request.environ['REMOTE_ADDR']
But both of them are returning 127.0.0.1. I have also checked out this question But it didn't help me out since the answer written there are for getting client IP's in production server environment whereas I am looking for any method using which I can get IP address of client in the development mode of server which is tunneled using ngrok.
I have two possible methods in my mind,
If I can get the IP address of the connection requester from Ngrok. I don't know is there any way to do it but this can solve my problem.
Or I add something to my javascript code so that whenever the index page loads up it sends an ajax request to the server telling it the IP address of the client. (Correct me if wrong)
In case of Flask , you cannot get the client ip address directly on the server side but you cannot get the IP address if your web app grabs the client ip and then using AJAX request sends it back to the server so that you can log it.
That's the only possible way i think you can do it in flask.
I have a service host on Amazon ECS.
It also have load balancer and CloudFront in front of my ECS, below picture is their architecture:
When my service is running, it will need it's own public IP address to record.
And I want get this information without third party library or website. I dig into the fields in HTTP header, I found this in my chrome (see picture below), but I can't access this information by the fields in the header.
My questions is:
Can I get public IP of server without third party library?
(This seems impossible without third party library due to following asked questions)
Get public/external IP address?
Discovering public IP programmatically
How can I get the public IP using python2.7?
Can I get the field like I saw in chrome in python?
You can read remote IP address of AWS Cloud Front host using almost any HTTP client in any language or using command line tools like cURL.
However keep in mind that Cloud Front remote IP address you see in your HTTP client (like Chrome in your example) is not "your" address. It is an IP address of the Cloud Front endpoint nearest to your client. Don't confuse Cloud Front endpoint IP (which is not "yours" and might change) with your Elastic Load Balancer IP (which can be "yours" i.e. reserved for you).
I have managed to built a simple client server application in Twisted that takes the data from the serial port and send it to the server. I want to know how i can add any kind of authentication for accessing the server. Right now anyone with the server IP can send data to the server. Any help would be highly appreciated .
I can redirect you to this question.
Basically, you need to implement a protocol client & server sides that parses username and password, validates them and keeps the connection open / routes it to a new address, or closes it.
Lower level approaches are also possible, but way more complicated.
Twisted has an SSL auth built in, if it is of any interest to you.
I have domain on a shared hosting provider. How do I find the direct IP address of my domain using Python?
Is it possible to post to a script on my domain using the IP address and not the website itself?
Thanks.
I guess the IP should be static so do you really need to look it up more than once?
You need to specify the domain name so that the webserver knows which host configuration to use if you don't have a dedicated IP or your host is the default for that webserver
import socket
socket.gethostbyname("www.stackoverflow.com")
'69.59.196.211'
will get you the ip address (as a string) of your domain.
However, if it's shared hosting I would think it highly unlikely that you'll be able to access your hosting via the ip - most likely you'll have something like Apache's VirtualHost Directive in place which limits you to only 'seeing' requests to your domain. Requests to the IP address will be served by some default configuration.
Would very much depend on the nature of your hosting.
A curious request ...
To look up a domain name, do something like this:
import socket
ipaddress = socket.gethostbyname('www.bbc.co.uk')
Regarding posting to the IP address:
I don't think it would work in the normal way (like from a browser), because there will probably be many sites held under that address.
But, I guess you could do it in a very manual way, using a programming language (e.g. Python), if you connected a client socket to the site's IP address, but still sent the website's name in the HTTP Host request header.
I don't know if that poses more questions than it answers, and I don't know why you'd want to do either of the above, but there it is.
Good luck!