Log in

View Full Version : Finding Ip of FTPS



rchainho
11-07-2006, 11:32 PM
hi:

i'm new here and i don't know if i have posted right. I need a program that finds the current ip address from ftps. Can you help me? thanks in advanced. Maria

Twey
11-08-2006, 12:50 PM
Er, ping should do it -- it displays the IP of the host. Alternatively, a quick-and-dirty method in C:
#include <arpa/inet.h>
#include <netdb.h>

int main(int argc, char **argv) {
struct hostent *host;
if(argc != 2) {
printf("Usage: %s <host>\n", argv[0]);
exit(1);
}
if(!(host = gethostbyname(argv[1]))) {
printf("Unable to look up host.\n");
exit(2);
}
printf("%s\n", inet_ntoa(*((struct in_addr *)(host->h_addr))));
return 0;
}

rchainho
11-09-2006, 09:27 AM
well, i don't understand what i have to do to find the current ip address of a ftp. sorry! :confused:

djr33
11-09-2006, 09:42 AM
I would assume this is the same as your host. So... just look at your hosting account and find the IP.
Or, you could use php. There's a function in that to display the current IP from which the script is running, I believe.

...Ok. Just checked on php.net

Just make a new file, name it something.php and use this as it's contents:
<?php echo $_SERVER['SERVER_ADDR']; ?>

Use notepad or another text editor to do this. PHP is just like html, but also is first sent through a php processor on the server, and output as just html. When looking at the webpage's source, ALL you will see, then, is just the IP of the server, which will also be all that is displayed on the page.
Note that you need php to be installed/working on your server for the script to run.

codeexploiter
11-09-2006, 11:32 AM
If you are using Windows operating system go to the Command Prompt and type the following command

ping your_ftps_server_domain_name and press enter key

That will solve this.

rchainho
11-09-2006, 01:29 PM
give me an example, please. thanks in advanced

Twey
11-09-2006, 01:33 PM
Go to Start->Run...
Enter "command" and press enter or click OK. In the window that appears, if your server was ftps://www.example.com/, you would type:
C:\WINDOWS> ping /n 1 example.comThe program will respond with something like:
PING example.com (192.0.34.166) 56(84) bytes of data.
64 bytes from www.example.com (192.0.34.166): icmp_seq=1 ttl=44 time=152 ms

--- example.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 152.800/152.800/152.800/0.000 msActual output may vary; this is from the linux-netkit variant of the utility. The text in red is the IP address of the server.

rchainho
01-20-2007, 07:36 PM
how do you find the ip adress of a dinamic ftp?

thetestingsite
01-20-2007, 07:38 PM
dynamic ftp? Never heard of that. Can you give an example?