hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

Full Version: External Ip
MxMx
heey dudes,

how can I get someones external IP is they are behind a router using the command line? is there a tool to do this thnq
BuzzDee
lol there are many ways. for example make on ur pc nc listen on port 1333. then on the remote pc type start telnet [ur ip] 1333. then it will connect to ur nc and u will see incoming connection from bla. (bla = external ip wink.gif )
sk3tch
A somewhat "ghetto" method (although it is quite effective) is to use wget or a similar tool to download http://www.whatismyip.com's index html file which will contain the current IP of the box. Then use BLAT (to email it to you) or a parser of some sort to send the information to you.

setthesun
telnetting yourself is good but I have some better ideas;

First if you in there you can see remote IP in your netstat check it out;

netstat -an

Also you can telnet a website in commandline;


CODE
c:/telnet 67.15.74.5 80


and paste

CODE
GET /simple/ HTTP/1.0



Don't forget double enter at the end
Terminal
QUOTE(BuzzDee)
lol there are many ways. for example make on ur pc nc listen on port 1333. then on the remote pc type start telnet [ur ip] 1333. then it will connect to ur nc and u will see incoming connection from bla. (bla = external ip  )


This is easiest i think . biggrin.gif
Jumpi
try ipconfig /all
setthesun
QUOTE(Jumpi @ Oct 10 2004, 03:01 PM)
try ipconfig /all
*



If victim is behind a router you can just get internal IP, MxMx asking this for this reason
TheCodeMaster
QUOTE(setthesun @ Oct 9 2004, 04:56 PM)
telnetting yourself is good but I have some better ideas;

First if you in there you can see remote IP in your netstat check it out;

netstat -an

Also you can telnet a website in commandline;


CODE
c:/telnet 67.15.74.5 80


and paste

CODE
GET /simple/ HTTP/1.0



Don't forget double enter at the end
*



Netstat should work fine but why the "GET /simple/ HTTP/1.0"?
setthesun
QUOTE(TheCodeMaster @ Oct 10 2004, 03:49 PM)
QUOTE(setthesun @ Oct 9 2004, 04:56 PM)
telnetting yourself is good but I have some better ideas;

First if you in there you can see remote IP in your netstat check it out;

netstat -an

Also you can telnet a website in commandline;


CODE
c:/telnet 67.15.74.5 80


and paste

CODE
GET /simple/ HTTP/1.0



Don't forget double enter at the end
*



Netstat should work fine but why the "GET /simple/ HTTP/1.0"?
*



As I said it's just another method "/simple/" is directory name.
setthesun
Also I attached a small tool before for determining external IP, you can use it for your or a remote computer.

http://www.governmentsecurity.org/forum/in...pe=post&id=1824
koncept
QUOTE(MxMx @ Oct 9 2004, 12:34 PM)
heey dudes,

how can I get someones external IP is they are behind a router using the command line? is there a tool to do this thnq
*



Hey. I know this is an old subject, but if anybody is running unix:

CODE
#!/bin/sh
#
# Script for getting an external WAN IP
#

URLS[0]="http://checkip.dyndns.org"
URLS[1]="http://whatismyip.com"
URLS[2]="http://www.whatismyipaddress.com"
URLS[3]="http://ipid.shat.net"
URLS[4]="http://www.edpsciences.com/htbin/ipaddress"
URLS[5]="http://www.showmyip.com"

for URL in ${URLS[@]}
do
       THIS=${URL}
       IP=`curl -s "${THIS}" | tr -cs '[0-9\.]' '\012' \
               | awk -F'.' 'NF==4 && $1>0 && $1<256 && $2<256 && $3<256 && $4<256 && !/\.\./' | uniq`
       if [ $? == 0 ]; then
               IP=`echo $IP | awk '{print $1}'`
               echo "Your WAN IP Address is: $IP"
               exit
       fi
done
da_cash
ok here's small program to retrieve the ip from http://checkip.dyndns.org/ and the source coded in c


wanip.c
CODE
#include <wininet.h>
#include <stdio.h>

#define AUTHOR "da_cash"
CHAR buffer[100];
int i=75;

int main()
{

printf("+-----------------------+\n");
printf("+ WAN IP by %s/2k5 +\n",AUTHOR);
printf("+-----------------------+\n\n");

HINTERNET hINet, hFile;
CHAR buffer[100];


hINet = InternetOpen(AUTHOR, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );

if ( !hINet )
{

printf("Error getting WAN IP");
return;
}


hFile = InternetOpenUrl( hINet,"http://checkip.dyndns.org/" , NULL, 0, 0, 0 );


if ( hFile )
{

DWORD dwRead;
InternetReadFile( hFile, buffer, 100, &dwRead );
}
InternetCloseHandle( hFile );

InternetCloseHandle( hINet );
printf("WAN IP:");


while ((buffer[i] != 0x3C) && (i < sizeof(buffer)))
{
 printf("%c",buffer[i]);
 i++;
}

printf("\n");

return;
}


include wininet.lib


code may be unproffessional but it works..i'm still learning. binary version attached.
ninar12
i have an .exe coded in vb.net

that can resolve ur external ip
its an simple exe
if u start it a popup gets up (withg ur ip)
and then it copys the ip into the clipboard

if u want it gimme a pm
im atm at a lan party and upload is blocked curiosly

greetz ninar
Gelu
Why are all of u thinking so difficult ? Just set a nc listner "nc -vvlp urport" and telnet to urself, and that way u see what IP is connecting. And even if that is too much work u can als just type netstat -a what connections u all have.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.