Mimicing ip addresses to the server

I'm trying to set the user agent property to other than Java/1.4.2_02, and also mimic different ip addresses. In another words i am trying that I could send the request with variety of different setting of user-agent and ip address. I have this piece of code that works fine for the user-agent. But how can I send request to the server mimicing different ip addresses. Any ideas?thanks
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.text.html.HTMLDocument;
public class teste {
private static HttpURLConnection conn = null;
private static URL url = null;
private static HTMLDocument html = new HTMLDocument();
public static void main(String args[]) {
BufferedReader in = null;
String str = "";
try {
url = new URL("http://www.google.com/search?hl=de&ie=ISO-8859-1&q=test");
} catch(MalformedURLException e) {
System.out.println(e);
System.exit(-1);
try {
conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.2) Gecko/20040803");
conn.connect();
in = new BufferedReader(new InputStreamReader(url.openStream()));
} catch(IOException e) {
System.out.println(e);
System.exit(-1);
}

I would suggest you try 1.4.2_08 as many bugs have been fixed since 1.4.2_02
A better choice would be 1.5.0_04.
You can creta emltiple addresses using multiple loop back interfaces. How this is setup is OS dependant and I only know how to do this for Solaris.
However, this kind of testing is unlikely to make any difference unless you need to test network based secuirty features.
BTW: When a reply is sent, it goes to the address which openned the connection. If you use dummy addresses how will you be able to get any of the replies?
My suggestion, don't worry about many different hosts, just run many clients on the same machine.

Similar Messages

  • How to setup default gateway in a DHCP client. The default gateway will be the Ip address of the server that has RRAS installed, hence routing cabalities.

    How to setup default gateway in a DHCP client. The default gateway will be the Ip address of the server that has RRAS installed, hence routing cabalities.

    Hi Bill,
    Thank you for replying back...Yes, I was actually asking how do you set the default gateway address on the DHCP server?,
    I believe I got the answer below:
    To configure the DHCP default gateway option Click Start, point to Administrative Tools and then click DHCP. In the console tree, expand the applicable DHCP server, expand IPv4, and then right-click Scope Options Click Configure Options, check 003
    Router, type the applicable Server name and IP address, and then click OK.
    Thank you

  • How to retrieve ip address of the server running PAM inside its module?

    Hello all,
    I've configured Solaris 8 with a deal of ip aliases on the network interface.
    Also I've a handwritten PAM module to auth users. It have some specific functionality which is needed for me.
    For the moment, this module need to be updated. This update requires a knowledge of IP address the user connecting to.
    Is it possible to determine IP address (alias IP) of the machine inside PAM module the user connecting to?
    Thank you for your answers.
    Mikhail.

    > Can i access the ip address of the DB server through SQL or PL/SQL code?
    No. It is the wrong place to look.
    Reason: a sever can, and often has, multiple IP addresses.
    So when you run SQL or PL/SQL code (or a Java stored proc), that will likely report the 1st IP address of the server - and you could have connected via another IP address of that server.
    The actual socket call to get the hostname returns an array of IP addresses. So which one is the correct one? How do you know whether or not your client session connected to the 1st IP in this array?
    The correct place to look is at the socket handle for that Oracle session on the client. And determine to what IP address that socket is connected to.
    This is not that easy - I do not think that the OCI exposes the socket handle it creates. But you can use kernel calls to get a list of established TCP sessions and to what IP address they're connected to. The netstat command on Windows and Unix/Linux is an example of how this can be done.

  • How to determine the address of the server whence the application through W

    The application is loaded from the server taking place in Intranet networks. How to determine from this application the address of the server with which it it is loaded?
    KSV

    Use could use the javax.jnlp BasicService.getCodeBase(). See http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/examples.html and http://java.sun.com/j2se/1.5.0/docs/guide/javaws/jnlp/javax/jnlp/BasicService.html

  • How to assign static ip address to the server having solaris 10. i.e. nge0

    hi,
    how to assign static ip address to the server having solaris 10. i.e. nge0 i.e. 192.168.3.125 ipshold be persistantt across reboots. what steps do i need to follow to put all information including gateway,netmask etc..Also i want to integrate one init script ..can i integrate it using /etc/init.d/<service name> like linux. and do chkconfig on it?i am not getting complex procedure of SPF and FMRI etc..can u help me?

    Create a file in your /etc directory called hostname.nge0. Add the hostname of your system to this file. In your /etc/hosts file, assign the static IP address you want to the same hostname. You can then disable and enable the network-physical service to configure the network interface:
    svcadm disable network-physical
    svcadm enable network-physical

  • How do I get the hostname(or address) of the server?

    How do I get the hostname(or address) of the server inside code
    running on the server? I can use
    Admin.getServer().getListenPort() to get the port number; but
    calling Admin.getServer().getListenAddress() returns null.
    Thanks
    Rajesh

    Rajesh,
    Try this:
    import java.net.InetAddress;
    Address.getHostName(); // This returns a string with hostname
    "Rajesh Kommu" <[email protected]> wrote:
    >
    How do I get the hostname(or address) of the server inside code
    running on the server? I can use
    Admin.getServer().getListenPort() to get the port number; but
    calling Admin.getServer().getListenAddress() returns null.
    Thanks
    Rajesh

  • I.P address of the server

    Hi All,
    Is there any way by which i can know the I.P address of the server on which my program is running.
    waiting for reply.
    Thanks and Regards.

    REPORT zipaddr
      DATA: BEGIN OF KINFOSTRUC,
              RSYN_FILE(40) TYPE C,
              IP_ADDRESS(15) TYPE C,
              KERNEL_RELEASE(3) TYPE C,
              DATABASE_LIBRARY(16) TYPE C,
              DATABASE_DBSLVERS(16) TYPE C,
              KERNEL_COMPILATION(45) TYPE C,
              KERNEL_PATCH_LEVEL(5) TYPE C,
              SUPPORTED_SAP_VERS(40) TYPE C,
              SUPPORTED_DATABASE(40) TYPE C,
              VALID_OP_SYSTEM(50) TYPE C,
              OP_SYSTEM_RELEASE(25) TYPE C,
              ABAP_LOAD(5) TYPE C,
              CUA_LOAD(3) TYPE C,
              KERNEL_KIND(6) TYPE C,
            END OF KINFOSTRUC.
    DATA: BEGIN OF KERNEL_VERSION OCCURS 0,
               KEY(21) TYPE C,
               DATA(69) TYPE C,
            END OF KERNEL_VERSION.
    CLEAR KINFOSTRUC.
      CALL 'SAPCORE' ID 'ID' FIELD 'VERSION'
                   ID 'TABLE' FIELD KERNEL_VERSION-*SYS*.
      READ TABLE KERNEL_VERSION INDEX 11.
    write :/1 KERNEL_VERSION-key, 25 KERNEL_VERSION-data.
    Rgds
    Vijay

  • How to print the client ip address at the server side( reqd for logging )??

    Hello everybody...
    joined this forum recently.....
    In RMI programming.... is there any way by which the server can know the the Client ip address or machine name.... i want to know this bcoz i need to create a log file as to who all had connected withe the server..
    need a solution soon..... thanks in advance....

    @ejp....
    thanks buddy....
    u made my world a better place to live.....

  • How to determine the address of the server of loading app...?

    The application is loaded from the server on the client computer by means of mechanism WebStart. How to receive (to calculate) from this application the address of this server of loading?
    Beforehand thank for answers...
    K$V

    use the BasicService in the JNLP Api:
    public URL getCodebase().
    see: http://java.sun.com/j2se/1.5.0/docs/guide/javaws/jnlp/index.html
    /Andy

  • How can a client lie about its IP address to the server (HTTP)

    I'm trying to set the user agent property to other than Java/1.4.2_02, and also send requests to the server that should appear coming from ip specified by me. In another words i am trying that I could hit the server with variety of different setting of user-agent and ip address. I have this piece of code that works fine for the user-agent. But how can I send request to the server mimicking different ip addresses. Any ideas?thanks
    I don't to download the page. I just have to send the requests.
    Here is the code that sends different user-agent configurations to the server:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.swing.text.html.HTMLDocument;
    public class teste {
    private static HttpURLConnection conn = null;
    private static URL url = null;
    private static HTMLDocument html = new HTMLDocument();
    public static void main(String args[]) {
    BufferedReader in = null;
    String str = "";
    try {
    url = new URL("http://www.google.com/search?hl=de&ie=ISO-8859-1&q=test");
    } catch(MalformedURLException e) {
    System.out.println(e);
    System.exit(-1);
    try {
    conn = (HttpURLConnection) url.openConnection();
    conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.2) Gecko/20040803");
    conn.connect();
    in = new BufferedReader(new InputStreamReader(url.openStream()));
    } catch(IOException e) {
    System.out.println(e);
    System.exit(-1);
    }

    There is bad news, and their is worse news.
    You need raw sockets. Java doesn't do raw sockets.
    Windows doesn't eithier (XP SP2), though there ARE ways arround it, the problem is you will need to be administrator and it will be throttled (read SLOW) by the OS itself (no way arround this) and it will refuse to send Spoofed IPs (no sensible way arround this).
    Linux you need to be root.
    You need to write a JNI that will drop your requests onto the network.
    It's horrible, and you need to consider whether java is the right language for this. Sounds like you are just doing some NATting or proxying or such, which would be much easier to do in pure c. Unfortunately I have to have raw packets from java so pain and suffering for me.

  • In azure cloud service with Location West Europe, why the IP address shows the server is locate in United States?

    We have 9 projects in azure cloud service, and all are use West Europe location, but with different subscription, and we found that one of those cloud service which its IP address is United
    States(Why?) and others are all in Amsterdam(this is correct)
    Can someone explain why? the server which it's ip located in United
    States is very slow, BTW i'm in Amsterdam.

    Hi LH,
    I have saw the same problem on Brazil. There has some comments about this issue, you can refer to it:
    Microsoft owns large ranges of IP addresses which are typically registered in Redmond, so usually Azure IP addresses around the world show up as being
    physically located in Redmond when using these types of tools.
    It's more or less an issue with the way our IP are registered. They all "belong" to Microsoft in the US and Brasil
    IP locator tools like whatismyip are sometimes incorrect. Some will give the real location, some will give the location of the ISP, etc …
    IP geo lookup tools typically rely on a static database of IP address range registrations.
    It's a Microsoft issue in the sense that we may publish the correct location for our datacenters
    (eg. Amsterdam should locate in Europe and not in Redmond…) – but it's also a 3rd party tools issue.
    If you want to be sure – use
    http://msdn.microsoft.com/en-us/library/windowsazure/dn175718.aspx 
     And you could also  see this blog about this issue :
    http://azure.microsoft.com/blog/2014/06/11/windows-azures-use-of-non-us-ipv4-address-space-in-us-regions/
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • IP address of the server

              Hi,
              To do clustering, should all the instances of the servers need to have multicasting
              IP address ? ( I mean b/n 224.0.0.1 to 239.*.*.* ??).
              thanks in advance,
              vijay
              

              More in-line.
              Vijay wrote:
              > Thanks Tom,
              > I have few more questions..
              >
              > 1. You said, "the admin server should not be a part of cluster". What does it
              > mean? According to the docs, what i understood is, which ever server starts first
              > becomes the admin server. Is that correct?
              >
              See the 6.x docs:
              http://edocs.bea.com/wls/docs61/cluster/setup.html#675975
              5.1 is different, if you're using 5.1 I'm not the one to ask.
              >
              > 2. Assume my application is nor clustered. Should I make a request to the multicasted
              > IP address or to the individual instances of my application?
              >
              Client URLs refer to the server address, not multicast address.
              The multicast address is used internally by a cluster for propagating shared info.
              >
              > Thanks in advance
              > vijay
              > Tom Barnes <[email protected]> wrote:
              > >
              > >vijay wrote:
              > >
              > >> Hi,
              > >>
              > >> To do clustering, should all the instances of the servers need to have
              > >multicasting
              > >> IP address ? ( I mean b/n 224.0.0.1 to 239.*.*.* ??).
              > >>
              > >
              > >Yes. They must each have the same one. In addition, they must each
              > >have
              > >the same listen port. Note that the admin server should NOT be a member
              > >of the cluster. For more info, see the administration docs.
              > >
              > >
              > >>
              > >> thanks in advance,
              > >> vijay
              > >
              

  • Changing the ip address of the server..

    i have seen that once we change the ip adress of the server issuing these commands will help in starting the database control
    Emca -deconfig dbcontrol db -repos drop
    Emca -config dbcontrol db -repos create
    (OR)
    Emca -deconfig dbcontrol db
    Emca -config dbcontrol db -repos recreate
    this situation can be used when we changed the static ip adress of the server to another static ip adress.
    no i wonder if we want to have the database ip address to be assigned by the dhcp server ever time the server starts up setting the environmental parameter EMHOSTNAME to the local host name will help..
    can any one tell me the real purpose of this enviromental variable because i couldnt find any info about this parameter every after googling...

    Databases shouldn't reside on a DHCP assigned IP address.
    The documentation is quite clear about that, and states you need a local loopback adapater (which is local to your system) to connect to a database on a DHCP assigned computer.
    Basically switching to a DHCP address will mean no one will be able to connect to the database.
    The reasons for this are obvious: DHCP addresses expire
    Sybrand Bakker
    Senior Oracle DBA

  • AOL email address refusing the server password

    Hi all,
    Two days ago the AOL servers started to reject my password on all my MAC hardware ,IMac ,Macbook Air and Iphone 4. This is also happening to my wifes Aol email account on her systems. I can access the email account through Safari OK so it is not a problem with our passwords being corrupt.
    Any ideas. Not too much a problem for me but my wife uses her AOL account for business and it is causing her some agro and I am getting the blunt end .
    Any advise accepted.

    Hello:
    No help to you, but my AOL mail works fine here in Apple's mail application.
    I am sure you know that AOL's tech support is spotty at best. 
    The only thing I can think of is to trash the preference file (com.apple.mail.plist) and restart.  I have had occasional password issues in the past with AOL, but they usually disappeared on their own - I assumed that AOL was the culprit.
    Barry

  • How to get the IP address of RMI server???

    Hi:
    Is there a way to know the IP address of RMI server before client and server connect?
    I am assuming that client didn't know the IP address of the server.
    Because I know that client must hold a server reference so that client can connect to server.
    But I want my client program to find out server IP address before they connect and use this finding to connect to server.
    Is it possible?
    Thanks!

    So you KNOW that the client MUST know where the server is yet you want the client to find out where the server is?
    Simple answer: forget it.
    If you don't know where to connect to how are you ever going to connect to it?
    And if you do know you don't have to go looking it up...
    You can probably do something with JNDI, but then you're only putting off the inevitable as now you need to both know how to contact the JNDI server AND the JNDI server needs to know where the the RMI registry for the service you want to connect to is.

Maybe you are looking for

  • Error while inserting data into a table.

    Hi All,   I created a table.While inserting data into the table i am getting an error.Its telling "Create data Processing Function Module".Can any one help me regarding this? Thanx in advance anirudh

  • I'm going overseas!

    Hi, I'll be going out of the country soon for a 2 month stay. I don't have nay kind of international plan or add on. I have an iPhone 5 and was just wondering what my options are for having a cellphone while Im over there! Thanks! >> Edited to remove

  • 1300 bridges trunking question

    Hi all, I have two 1300 bridges connecting two buildings. Both buildings are using native vlan. I only have one SSID and native vlan on the birdges. There is a L3 switch connecting to the root bridge and L2 switch connecting to the non-root bridge. R

  • Using a script or VB language to a Numbers spreadsheet

    I Have been working on a very comprehensive, very useful spreadsheet in Numbers This spreadsheet has sub-spreadsheets which Numbers created. I want to be able to use a query, enter a "key word" and find  find the information related to the keyword di

  • Is there any way of unlocking a 4S Sprint iphone without having a Sprint account?

    I bought my phone off ebay with good ESN. I contacted Sprint and they said they will only unlock it if I have a Sprint account.Is there any other way I can get my phone unlocked?