View Full Version : How to Get the ip from the user
DaSoulRed
06-27-2008, 04:29 PM
I hope some one can send me a tip about this issue
Do Exist any how to get the ip off the User and send it some how back to me
thanks in Advance
By The Way, have a nice Day :D
mwreyf1
06-27-2008, 04:45 PM
Have a look at System.GetLANInfo to get IP.
As for how you send it back to you...could be a FTP or HTTP based solution.
ShadowUK
06-28-2008, 01:38 AM
TextFile.WriteFromString(_TempFolder.."\\ip.txt", HTTP.Submit("http://luacom.net/ip.php", {}, SUBMITWEB_GET, 20, 80, nil, nil));
FTP.Connect("server-goes-here.com", "username", "password", "", true);
FTP.Upload(_TempFolder.."\\ip.txt", "ip_"..Math.Random(10000000000)..".txt", nil);
DaSoulRed
06-28-2008, 01:04 PM
Thanks Trying today
It will be fun
Thanks Again :yes
Bruce
06-29-2008, 12:56 PM
http://www.indigorose.com/forums/showthread.php?t=16688
Imagine Programming
06-29-2008, 04:53 PM
PHP file:
<?
if(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} elseif(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} else {
$ip = $_SERVER["REMOTE_ADDR"];
}
echo $ip;
?>
AMS:
IP=HTTP.Submit("http://adresstophpfile.com/filename.php", {}, SUBMITWEB_GET, 20, 80, nil, nil));
Dialog.Message("Your IP Adress", IP);
DaSoulRed
06-30-2008, 09:16 AM
Elevation for you People Thanks
Solving and complementing your stuf with my Stuff
Wish you Fun
Bytes
DaSoulRed
06-30-2008, 10:18 AM
PHP file:
<?
if(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} elseif(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} else {
$ip = $_SERVER["REMOTE_ADDR"];
}
echo $ip;
?>
AMS:
IP=HTTP.Submit("http://adresstophpfile.com/filename.php", {}, SUBMITWEB_GET, 20, 80, nil, nil));
Dialog.Message("Your IP Adress", IP);
So this one it is only to read the ip or does store some place at the server i wish to know the ip off the user who is using my program.
do this work like that
DaSoulRed
06-30-2008, 10:51 AM
TextFile.WriteFromString(_TempFolder.."\\ip.txt", HTTP.Submit("http://luacom.net/ip.php", {}, SUBMITWEB_GET, 20, 80, nil, nil));
FTP.Connect("server-goes-here.com", "username", "password", "", true);
FTP.Upload(_TempFolder.."\\ip.txt", "ip_"..Math.Random(10000000000)..".txt", nil);
Do i did it rigth
TextFile.WriteFromString(_TempFolder.."\\ip.txt", HTTP.Submit("http://www.mysite.com/ip.php", {}, SUBMITWEB_GET, 20, 80, nil, nil));
FTP.Connect("ftp://mysite.com/", "login", "password", "", true);
FTP.Upload(_TempFolder.."\\ip.txt", "ip_"..Math.Random(10000000000)..".txt", nil);
do i need to replace the word _TempFolder.. with my folder all ready created at the ftp server
ShadowUK
06-30-2008, 11:02 AM
No, you need to tick the FTP Action Plugin in the Plugins dialog.
DaSoulRed
06-30-2008, 11:19 AM
No, you need to tick the FTP Action Plugin in the Plugins dialog.
Where is the ip.txt uploaded, at the server?:huh
ShadowUK
06-30-2008, 11:55 AM
Where is the ip.txt uploaded, at the server?:huh
Yes. It's uploaded to your FTP server. As ip-*RANDOM*.txt
DaSoulRed
06-30-2008, 12:19 PM
Yes. It's uploaded to your FTP server. As ip-*RANDOM*.txt
Do i need another file or other code becouse i cant find the random txt file u talk about
i just change the url add login and pass add ftp server and i leave anything else
TextFile.WriteFromString(_TempFolder.."\\ip.txt", HTTP.Submit("http://luacom.net/ip.php", {}, SUBMITWEB_GET, 20, 80, nil, nil));
FTP.Connect("server-goes-here.com", "username", "password", "", true);
FTP.Upload(_TempFolder.."\\ip.txt", "ip_"..Math.Random(10000000000)..".txt", nil);
mwreyf1
06-30-2008, 12:58 PM
If all is working correctly you should see the file on the FTP sever.
Imagine Programming
06-30-2008, 02:10 PM
dude activate the FTP plugin, and what i would do is also add a value to an ini file wich IP is wich File... so you can read it with an application or with the naked eye...
DaSoulRed
07-01-2008, 09:57 AM
dude activate the FTP plugin, and what i would do is also add a value to an ini file wich IP is wich File... so you can read it with an application or with the naked eye...
Thanks for the Feedback (C-B) Hope u have some time to add the line missing or if some one can letme know why on the ShadowUK i cant find the random.txt on the server
longedge
07-01-2008, 11:38 AM
You could also write the information directly to a txt file on your web server
and read that text file directly into AMS something like -
<?
$ip = $_SERVER['REMOTE_ADDR'];
$da = date("l, F d, Y h:i" ,time());
$fp = fopen("ip.txt", "a");
fwrite($fp, $ip . " : " . $da . "**");
fclose($fp);
?>
I can't work out how to insert a \r\n into the text. The "**" just makes the end of the entry easier to find.
I've tried "\\n" and "<br>" but they don't work - any ideas?
Imagine Programming
07-01-2008, 12:19 PM
if you use
<? if(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} elseif(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} else {
$ip = $_SERVER["REMOTE_ADDR"];
} ?>
you'll have more insurance that you actually get the IP adress:) REMOTE_ADDR doesn't always work:)
You could also write the information directly to a txt file on your web server
and read that text file directly into AMS something like -
<?
$ip = $_SERVER['REMOTE_ADDR'];
$da = date("l, F d, Y h:i" ,time());
$fp = fopen("ip.txt", "a");
fwrite($fp, $ip . " : " . $da . "**");
fclose($fp);
?>
I can't work out how to insert a \r\n into the text. The "**" just makes the end of the entry easier to find.
I've tried "\\n" and "<br>" but they don't work - any ideas?
longedge
07-01-2008, 12:37 PM
OK thanks, any idea how to 'inject' the new line/carriage return?
Imagine Programming
07-01-2008, 12:41 PM
You mean newrule in PHP? that's \n
<?
if(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} elseif(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} else {
$ip = $_SERVER["REMOTE_ADDR"];
}
$da = date("l, F d, Y h:i" ,time());
$fp = fopen("ip.txt", "a");
fwrite($fp, $ip . " : " . $da . "\n");
fclose($fp);
?>
This code above should work
longedge
07-01-2008, 12:56 PM
No the code . "\n" does nothing at all and I also tried escaping the \ to make it . "\\n". That writes "\n" inline to the text.
Imagine Programming
07-01-2008, 12:59 PM
Strange it works on my server... do you have PHP5?:P you could still try \r\n, maybe that works... also works for me...
i don't know any other solutions to this issue
DaSoulRed
07-01-2008, 01:01 PM
You mean newrule in PHP? that's \n
<?
if(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} elseif(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} else {
$ip = $_SERVER["REMOTE_ADDR"];
}
$da = date("l, F d, Y h:i" ,time());
$fp = fopen("ip.txt", "a");
fwrite($fp, $ip . " : " . $da . "\n");
fclose($fp);
?>
This code above should work
Thanks can some one tellme how to compile this at AMS and wich file is uploaded to the server and where finally can i see the resultant ip wich is obtain from the user?
Thanks (C-B) and (L-E) or any One else ?
longedge
07-01-2008, 02:12 PM
Strange it works on my server... do you have PHP5?:P you could still try \r\n, maybe that works... also works for me...
i don't know any other solutions to this issue
Version on my ISP's web server is 4.3.10. so perhaps that's the problem? I read somewhere that it might be necessary to escape the \ and I've tried that without success.
DaSoulRed - I put that code in a php that I named ip.php and uploaded it to my cgi web space. If I put http://mywebaddress.directory/ip.php it just runs the code and writes the ip to a file called ip.txt in the same directory. I can view http://mywebaddress.directory/ip.txt in a web object or download it as a text file etc.
Imagine Programming
07-01-2008, 02:28 PM
I think that could be the problem.. strange though i'll look in to this:)
clueless
07-01-2008, 03:27 PM
DaSoulRed you neglected to mention the perpous of your program. Why would you want to get hold of a persons IP number in this way?
If this was something like a chat program then the client would have the servers IP number to start with and the clients IP would be detected when the CLIENT decides to connect..
Ill admit there are some legitimate reasons for wanting to have someones ip number but its doubtful that someone who doesnt know how to obtain an IP in the first place is then going to use it constructivly with it once they have it.
Is this for some kind of trojan horse??
DaSoulRed
07-01-2008, 04:48 PM
DaSoulRed you neglected to mention the perpous of your program. Why would you want to get hold of a persons IP number in this way?
If this was something like a chat program then the client would have the servers IP number to start with and the clients IP would be detected when the CLIENT decides to connect..
Ill admit there are some legitimate reasons for wanting to have someones ip number but its doubtful that someone who doesnt know how to obtain an IP in the first place is then going to use it constructivly with it once they have it.
Is this for some kind of trojan horse??
No Way this will be use for evil purposses, i just want to know the ip
clueless
07-01-2008, 05:09 PM
Sorry I'm not buying that ... what you have there is the program equivalent of a PHP notifier.
The SAFE way to get the ip from a user is to let them connect to you and that's just one of many friendly ways to obtain someones ip. I don't agree that wanting to know someones ip is enough reason to covertly steal it.
DaSoulRed
07-01-2008, 05:16 PM
Sorry I'm not buying that ... what you have there is the program equivalent of a PHP notifier.
The SAFE way to get the ip from a user is to let them connect to you and that's just one of many friendly ways to obtain someones ip. I don't agree that wanting to know someones ip is enough reason to covertly steal it.
Some times High Rated info on Naive Hands can be harmless, i think with yor comments here, u need now to worry about the readers and not only for my self.
so i advice you, if u have an idea off my level, let me be, im sure i cant do much rigth.
I wish you well, be kewl and forget about it man, dont worry im just triying to learn
Bye Man-Masta
Imagine Programming
07-01-2008, 05:42 PM
Sorry I'm not buying that ... what you have there is the program equivalent of a PHP notifier.
The SAFE way to get the ip from a user is to let them connect to you and that's just one of many friendly ways to obtain someones ip. I don't agree that wanting to know someones ip is enough reason to covertly steal it.
Haha...This is an efficient way of obtaining someones IP adress, this can be usefull for some applications, or even neccesary...
This is just a lesson/example for somebody, what he/she does with it is not our problem...
@DaSoulRed, +1 :)
clueless
07-01-2008, 08:11 PM
DaSoulRed .. i haven't got a clue what your trying to say could you try it again in English?
This is just a lesson/example for somebody, what he/she does with it is not our problem...
That is a very childish and irresponsible attitude.
DaSoulRed
07-01-2008, 08:23 PM
DaSoulRed .. i haven't got a clue what your trying to say could you try it again in English?
That is a very childish and irresponsible attitude.
Leave this subject alone, Have a Nice Day Man :cool
ShadowUK
07-02-2008, 12:20 AM
DaSoulRed .. i haven't got a clue what your trying to say could you try it again in English?
That is a very childish and irresponsible attitude.
Did you ever think that it was just an example?
longedge
07-02-2008, 01:56 AM
I'm only speaking for myself here. In a good (or is it bad week ) I might produce 1,000 CD's. We constantly try to decide whether what we are sending out, stuff like planning aids, examples of good practice, govt. guidance are being used.
My interest is the same as that satisfied by web logs - usage, and it seems that this method might be a useful, non-invasive way of getting an idea of what is happening.
Imagine Programming
07-02-2008, 09:36 AM
@ShadowUK indeed it's an example:)
@clueless
That is a very childish and irresponsible attitude.
what you are doing is a little bit more childish and irresponsible:) trying to talk us down and your better... it's just an example and besides firefox log's IP, IE7 log's IP and msn aswell... and this is an example:P
ShadowUK
07-02-2008, 10:19 AM
@ShadowUK indeed it's an example:)
@clueless
what you are doing is a little bit more childish and irresponsible:) trying to talk us down and your better... it's just an example and besides firefox log's IP, IE7 log's IP and msn aswell... and this is an example:P
What? Firefox is logging mah IP?
Imagine Programming
07-02-2008, 12:44 PM
yeah on first run... besides that every site where you can login and alot of other sites also log IP adresses to monitor the visitor count... so it's used alot:)
ShadowUK
07-02-2008, 12:59 PM
yeah on first run... besides that every site where you can login and alot of other sites also log IP adresses to monitor the visitor count... so it's used alot:)
Oh, Of course to keep the use count and that stuff.
Imagine Programming
07-02-2008, 02:40 PM
Yeah if they don't they'll count people more times a day.. that's not accurate:P and they also do it when people use GET or POST Forms on a website, they log the IP for safety:)
longedge
07-02-2008, 02:57 PM
Afaik all web servers log requests against IP. Both my ISP and a provider where I host a small site provide, amongst a great number of other things, the numbers of unique visitors.
In an environment of constant performance monitoring, measuring of effectiveness and cost cutting, anything that enables you to provide hard facts is useful (unless of course it turns out that you are getting zero/minimal hits :D )
rexzooly
07-02-2008, 02:59 PM
Yeah if they don't they'll count people more times a day.. that's not accurate:P and they also do it when people use GET or POST Forms on a website, they log the IP for safety:)
and most IP's are dynamic these days so dose not matter if a IP is logs once or twice i log ips of all members of my site but my host logs them for visters and
abuse so a IP is just a root what is able to get lost for most of use sometime
its weeks sometimes its months i have no problem with my Net ip going out as ever server you talk to users that IP or you would not be online lol.
clueless
07-02-2008, 03:04 PM
Yes there are legitimate reasons why an ip is recorded but DaSoulRed has already stated he hasnt got one. Im sure there's 100's of reasons why as a programmer you might need to do this but its more than obvious that this guy is not a programmer.
Wow this is Great, Wait a Sec. How i Use This...
He cant even work out what the code does after you have written it for him !
hope some one can send me a tip about this issue
Do Exist any how to get the ip off the User and send it some how back to me
thanks in Advance
...that's not a request for programming advice its a straight up request on how to take someones ip
When surfing the web or using a chat messenger you would expect an IP to be taken but not with computer based software. I think you will find that in most cases your IP number wont leave your computer until you use that bit of software to go on the net. This is good programming practice ,anything else is by definition spyware
What? FireFox is logging my IP?
This is how most people would react to finding out some bit of software has recorded their ip for no good reason.
95% of the programming forums i use wouldn't entertain a request for some code that could easily be used for illegal perpouses. You just don't give out this sort of info to someone who doesn't even know how to compile the program once hes got the code.
rexzooly
07-02-2008, 03:17 PM
Yes there are legitimate reasons why an ip is recorded but DaSoulRed has already stated he hasnt got one. Im sure there's 100's of reasons why as a programmer you might need to do this but its more than obvious that this guy is not a programmer.
He cant even work out what the code does after you have written it for him !
...that's not a request for programming advice its a straight up request on how to take someones ip
When surfing the web or using a chat messenger you would expect an IP to be taken but not with computer based software. I think you will find that in most cases your IP number wont leave your computer until you use that bit of software to go on the net. This is good programming practice ,anything else is by definition spyware
This is how most people would react to finding out some bit of software has recorded their ip for no good reason.
95% of the programming forums i use wouldn't entertain a request for some code that could easily be used for illegal perpouses. You just don't give out this sort of info to someone who doesn't even know how to compile the program once hes got the code.
Hang on AMS gets the Local IP yes so what use would he have for it hes
lost me if he thinks with that he can do anything with it.
Really i see the point in friendly mods been made to open up a program to do more then it was made to do more to be more but hacking and ******** is
just out of the question but silly if you ask me.
Hmm wont let me say cracing strange lol.
But i know what you mean hes asked some strange questions like this before
clueless
07-02-2008, 03:48 PM
Hang on AMS gets the Local IP yes so what use would he have for it hes
lost me if he thinks with that he can do anything with it.
Exactly ;) This is a typical script kiddie request thinking that having the local IP is going to help you gain access to anyones puter. :rolleyes
DaSoulRed
07-02-2008, 04:38 PM
Man u are SPECULATING over me
1.- I never say i wose a programmer ( u are very clever becouse no body notice that before)
2.- Keep in mind this is a self learning forum so the question is valid
3.- Man u saying if some one knows how to make explosives he will use in bad way harming people
4.- that makes you bad person if u know how to do a few tricks like this maybe u are a hacker who gets money from inoccent people
Man Life and let die, in other words my advice donīt speculate over people lt them be
i want to end this issue, please take no offense from me, i think this is a waste off time.
i show you my respects to you and i say thanks for those who help with my question.
Feel Free to feedback but after all ur choice
Imagine Programming
07-02-2008, 04:40 PM
Maybe he's a beginner, everyone has been a beginner, besides that... he asks us a question... we awnser it...
If he want's to get his self into trouble that's his problem... there is absolutely no proof of the statement that he would use it for spyware/hacking etc...
just as little as the reason he has... so why really keep on going on this subject?
ShadowUK
07-03-2008, 12:43 AM
Exactly ;) This is a typical script kiddie request thinking that having the local IP is going to help you gain access to anyones puter. :rolleyes
Come now clueless,
I've registered at many programming forums and all but this one had incredibly stupid staff which could not even code in the language the forum was about, Members that talked like 9 year olds and flaming everywhere.
This forum is not like that, I don't like this thread after you started flaming in it. He wants a script, It's for an example. This forum is for people who need help or who want to showcase a program here, There's no need to assume he's going to use it to hack people.
Although uploaded IP's on a FTP server is rather suspicious, It's still an example. If he asked how to crack some program, It would be reported and removed, This was not removed and assuming an IndigoRose Member saw it, I'm sure they thought it was fine.
Basically. If you think he's going to do something bad, Don't reply and report it but you need more proof.
Imagine Programming
07-03-2008, 07:02 AM
Man u saying if some one knows how to make explosives he will use in bad way harming people
nicely said:O
mwreyf1
07-03-2008, 08:38 AM
I write programs using AMS for a large corporation with over 5000 store locations and they specifically requested this feature so that they could accurately track usage. It is a VERY handy means of knowing which stores have installed it, re-installed it and never installed it, all based off of the IP.
I believe he had a valid question.
Innocent until proven guilty, I say.
Imagine Programming
08-08-2008, 09:31 AM
Yeah, besides that, you can't gain access to somebodies system by just the IP adress... so this really is only for logging (where is use it for)
I write programs using AMS for a large corporation with over 5000 store locations and they specifically requested this feature so that they could accurately track usage. It is a VERY handy means of knowing which stores have installed it, re-installed it and never installed it, all based off of the IP.
I believe he had a valid question.
Innocent until proven guilty, I say.
ShadowUK
08-08-2008, 01:21 PM
Whats he gonna use it for? Making a huge botnet? :p
clueless
08-08-2008, 04:01 PM
I studied how to make virus and Trojans for a while to work out how to make secure software. Most people playing about with Trojans and virii are typical script kiddies who know practically nothing about programming with ams being so easy to use its perfect for creating all-in-one type packages that are just used to infect unprotected users. This presents one problem for the would-be hacker.. how to know when he's infected someone and what their IP number is. A lot of Trojans call the hacker when its done but this is unsafe as its a trail back to the hacker.
Like I said before there's 1000's of reasons why a legitimate programmer would want someone's IP. But most legitimate programmers would have an idea of how to go about this in the first place.. and this guy didn't even know how to compile the program.
Imagine Programming
08-08-2008, 05:18 PM
yes i do aggree on that last part, he asked howto compile a php file in ams... but well...
RizlaUK
08-08-2008, 05:56 PM
yes i do aggree on that last part, he asked howto compile a php file in ams... but well...
lmao, i only read this last page, but ^^thats^^ enough for me,
altho there many valid reasons to obtain the users ip address i agree that a legitimate programmer would know thay need a php enabled server to run a php script.
AMS is not really a virus maker kind of dev platform, but it has enough power to seriously mess up someones pc if in the wrong hands.
Imagine Programming
08-08-2008, 06:53 PM
agreed, we helped, let him try now... won't be doing any damage i guess:p
DaSoulRed
08-08-2008, 07:18 PM
agreed, we helped, let him try now... won't be doing any damage i guess:p
Yes listen to him, i will not do any damage Muaha Muaha Muaha (evil laffing with hands rising)
lol lol :wow
RizlaUK
08-08-2008, 08:07 PM
yes, me and mini me will take over the world with this script
-- Global takeover function
function TakeOverWorld()
local nBrainWashed=0
local nPopulation=Planet.GetPopulation()
for nVictim = 0, nPopulation do
if EvilPlan.Execute(nVictim) then
nBrainWashed=nBrainWashed+1
end
end
return nBrainWashed
end
-- Test
nTotal=TakeOverWorld()
Dialog.Message(Notice","You successfully brainwashed "..nTotal.." people.")
EDIT: this function is untested and may contain some bugs
what :eek:
i was board, lol
ShadowUK
08-09-2008, 03:06 AM
yes, me and mini me will take over the world with this script
-- Global takeover function
function TakeOverWorld()
local nBrainWashed=0
local nPopulation=Planet.GetPopulation()
for nVictim = 0, nPopulation do
if EvilPlan.Execute(nVictim) then
nBrainWashed=nBrainWashed+1
end
end
return nBrainWashed
end
-- Test
nTotal=TakeOverWorld()
Dialog.Message(Notice","You successfully brainwashed "..nTotal.." people.")
EDIT: this function is untested and may contain some bugs
what :eek:
i was board, lol
attempt to local nil value (Planet)
!!!!!!!!!
RizlaUK
08-09-2008, 06:16 AM
attempt to local nil value (Planet)
yes, it will give you errors because you do not have my EvilGenius action plugin!!
EDIT, [plz tell me you dident try and run that code, lol]
Imagine Programming
08-09-2008, 06:32 AM
yes, it will give you errors because you do not have my EvilGenius action plugin!!
EDIT, [plz tell me you dident try and run that code, lol]
one word.... hahahahahahahahahah! xD
sIP = Dialog.Input("Network", "Please enter your IP Address:", "127.0.0.1", MB_ICONQUESTION)
RizlaUK
08-09-2008, 07:55 AM
what, just ask the user, naaaa, thats to easy, lol :yes
rexzooly
08-11-2008, 02:07 PM
what, just ask the user, naaaa, thats to easy, lol :yes
Wat happend to the good old mac address seems people forgot about the poor little mac addy witht the right tool thats all you need to locat and access a system.
Nar i don't think he could really do any real damage with ams, but the question to bring up some of use to think why but all to are own hey ;-) and that take over the world plugin got it all wrong never made my cup of tea right to i changed it for am i so lucky plugin and it simple said no.
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.