I use java program to get the ip addresses from log file, then i need get the ISP of ip and
the organization of ip. I use
URL url = new URL("http://www.ip-adress.com/ip_tracer/"+ip);
to get the html content and then get the ISP information from the html content,
but this website can only free use 20 times per day, so can you give me someother methods to get the ISP information.
Thanks,
request.getHostAddress();
this will give the ip address
Related
I have different issues with this exception, Please try to understand.
I'm sending data from one application to another through web service call in Java.
whenever I called it will connect to some other application. in that
a situation I get the above exception, this problem occur only in
byte Grid server.
We solved above problem like this our admin removed security,
means we have https they removed s so we are working with
HTTP, but it's not good, I want to connect through web service call with security, can any one give me the best idea.Please see my sample code
byte[] postData = urlParameters.getBytes(StandardCharsets.UTF_8);
int postDataLength = postData.length;
String request = PropertyFactory.getProperty("someUrl");
url = new URL(request);
postConnection = (HttpURLConnection) url.openConnection();
can I handle through code?
If you are using Oracle JDK between 1.8.0_51 and 1.8.0_60, there was an issue when connecting via IP address instead of hostname. In the case of using the IP-address, this address also has to be mentioned in the Subject alternative names of the cert. According to Mulesoft Support a workaround would be to set the JVM argument "jdk.tls.trustNameService" to true - resulting in a reverse name lookup for the IP address.
Byte grid having internal firewall so its may be stop, Please contact with byte grid team.
I am using SubethaSMTP to proxy smtp emails. I have an application sending emails to this proxy.
It happens that sometimes the application send malformed emails (for historical reasons).
This I cannot change. This is a buggy external solutions.
I am handling the received emails and route them based on the email value.
My issue is when I call the following method on the received emails:
Address[] tos = message.getRecipients(RecipientType.TO);
When there are malformed emails in the recipients list, I cannot get the list because I receive an exception.
My objective is to get all the emails and correct the malformed ones.
But because of the exception, I cannot get them.
Is there a way to get all the recipient emails even if there are some bad ones? Just read them without any issue? Is it possible to bypass the controls?
The stack trace is: The email address is #TEST(value) . this is generated by the external application. I'd like to be able to get it, and remove it from the list, and correct it to resend it
javax.mail.internet.AddressException: Missing local name in string ``#TEST''
at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:1216)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:1096)
at javax.mail.internet.InternetAddress.parseHeader(InternetAddress.java:663)
at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:733)
at javax.mail.internet.MimeMessage.getRecipients(MimeMessage.java:565)
at MessageHandler.done(TestMessageHandler.java:128)
at org.subethamail.smtp.server.Session.endMessageHandler(Session.java:513)
at org.subethamail.smtp.server.Session.resetMessageState(Session.java:490)
at org.subethamail.smtp.command.DataCommand.execute(DataCommand.java:84)
at org.subethamail.smtp.server.RequireTLSCommandWrapper.execute(RequireTLSCommandWrapper.java:30)
at org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:99)
at org.subethamail.smtp.server.Session.runCommandLoop(Session.java:244)
at org.subethamail.smtp.server.Session.run(Session.java:145)
I have an app engine application that runs REST web services.
I want to extract the ip address from all requests that are handled by my web services.
from javax.servlet.http.HttpServletRequest i'm trying to extract the ip address checking the "X-Real-IP" , if empty or "unknown" check the first ip in the list of "X-Forwarded-For" header if empty or "unknown" get it from request.getRemoteAddr().
I thought i covered all the cases but i'm still getting ip addresses like 10.x.x.x, or 127.0.0.1 or unknown.
I know that app engine applications are running behind load balancers, and instances are dynamic and i'm certainly omitting a header in the request cuz i can see the original ip address in the logs (from google) .
Edit : all the requests i'm working on are direct request to service (no queue or cron requests).
Any idea of the other headers to check ?
thx .
The answeres of this Question might help you. There are a lot of headers to check for:
private static final String[] HEADERS_TO_TRY = {
"X-Forwarded-For",
"Proxy-Client-IP",
"WL-Proxy-Client-IP",
"HTTP_X_FORWARDED_FOR",
"HTTP_X_FORWARDED",
"HTTP_X_CLUSTER_CLIENT_IP",
"HTTP_CLIENT_IP",
"HTTP_FORWARDED_FOR",
"HTTP_FORWARDED",
"HTTP_VIA",
"REMOTE_ADDR" };
I get the Yahoo IP address using InetAddress class in java. The result of yahoo.com IP address is not working while given in URL of web browsers.
InetAddress[] all = InetAddress.getAllByName("www.yahoo.com");
for (int i=0; i<all.length; i++)
{
System.out.println(" address = " + all[i]);
}
It shows result as,
address = www.yahoo.com/67.195.160.76
address = www.yahoo.com/69.147.125.65
When i entered those ip into browser's url(ie., http://67.195.160.76), the browser shows "Requisted URL not found".
What's the problem in that. Is the result produced by the java program wrong?
The IP address is not wrong. However, the web server is told exactly what you type into the URL bar, and it can choose to show you different content based on the hostname that you use. In this case, a Yahoo web server (which is at that address) is choosing not to show you anything when you request the host 67.195.160.76.
This information is passed in the Host HTTP header. This header is the basis of how virtual hosts, or "vhosts", work.
I'm writing a web application, I need to do a audit log for all the actions in the application. For this purpose I need to get the IP Address of the client systems.
I'm using request.getRemoteAddr() to get the remote IP Address. But this has a problem, if the client is behind a proxy this method will give the IP of the proxy system.
When I did some search I found a header attribute called 'X-FORWARDED-FOR' in the HttpRequest object.
Can somebody tell me how exactly this header property works and how can I used this header to get the IP address of the client system.
Thank you
getRemoteIP returns the remote IP address of the user (assuming all HTTP intermediaries are well behaved wrt XFF header).
String getRemoteIP(HttpServletRequest request) {
String xff = request.getHeader("X-Forwarded-For");
if (xff != null) {
return xff.split("[\\s,]+")[0];
}
return request.getRemoteAddr();
}
The client's proxy - typically a firewall or somesuch - will populate the x-forwarded-for header with the ip it receives from its client, which is typically, but is not required to be (in the case of a user going through multiple proxies or firewalls) the ip of the user's machine.
'X-FORWARDED-FOR' is used for identifying the originating/actual IP address of a client connecting to a web server through an HTTP proxy.
You can simply use the value for this attribute to find out the originating client IP, even if it's behind a proxy.