This is a discussion on Completely O.T. but perhaps interesting Q. within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> As per subject line this is completely O.T., but anyway... I have a remote Slack server using a dynamic ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| As per subject line this is completely O.T., but anyway... I have a remote Slack server using a dynamic dns service which is currently "lost in space". Through miscommunication while moving it to easydns.com from one of their cobranded services, the box was left updating ip to the old service, but was moved to the new. My bad luck it appears to have had an update since then. I'm pretty sure it's still online, but obviously, can't ssh to an unknown address to fix it! I CAN get this solved tomorrow by getting the (non-technical) folk on whose premises the slack box is located to log in locally, but I'd rather do it the hard way :-) As part of its auto updating (it is behind a cable router) it wgets a php page on another server where I have an hosting account that echoes back the correct address, writes it to a tmp file and so on... I WANT THAT ADDRESS! I have ftp access only (no shell) on the server with the echoing page. Question: what kind of change to the echoing php page could I upload to write the address to a file I can retrieve by ftp, or even mail it to me. (It's running freebsd if that's useful). Would appreciate any suggestions. Apologies in advance for those who are offended by the post. Moss Hart |
| |||
| In article <1073429585.314945@Virginia.BMTS.Com>, Moss Hart wrote: > As part of its auto updating (it is behind a cable router) it wgets a php > page on another server where I have an hosting account that echoes back the > correct address, writes it to a tmp file and so on... I WANT THAT ADDRESS! I agree that the php solution is the best way to get the IP. Unfortunately I can't help with that. But there may be other ways. One time my boss' computer got similarly "lost" whilst he was away on holiday (this despite paying for a static IP!) To find it I nmap'ed all the possible netblocks looking for a specific port we knew would be open. Scanning just that one port didn't take long, and a single-port port scan isn't the kind of thing likely to bring you to the attention of the ISP's security people. Obviously you're running sshd on there. If it's not in a netblock populated by a lot of Unix-ish servers, there might not be many hosts listening on 22. > Would appreciate any suggestions. Apologies in advance for those who are > offended by the post. I'm offended by the thought of people who would be offended by the post. -- /dev/rob0 - preferred_email=i$((28*28+28))@softhome.net or put "not-spam" or "/dev/rob0" in Subject header to reply |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Moss Hart <act1@operamail.com> wrote: > Question: what kind of change to the echoing php page could I > upload to write the address to a file I can retrieve by ftp, or > even mail it to me. (It's running freebsd if that's useful). If I understand you correctly, the following will add a line to your username's crontab that will email you the output of "ifconfig" every half hour. The problem is, of course, getting a hit on the PHP page to actually execute the command. But that's a problem common to pretty much all PHP-based activity. <? passthru("echo "0,30 * * * * ifconfig | mail -s \"Your IP\" you@yourisp.com" | crontab - -u yourusername"); ?> (this should all be on the one line) *** WARNING *** The command replaces the existing crontab. If you insert this line in the PHP page you FTP to be "wget"ed, you can then sit tight and wsit for the first hit. Apologies if this is a rather convulated solution. I just woke up - -- George Georgakis-geeg AT tripleg net au-http://www.tripleg.net.au/ SlackBuild Central - http://slackpack.tripleg.net.au/ -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com> iQA/AwUBP/rArElp3nJf7PixEQKLXgCfSbd/nSlplGhQz0NvwjS8JeJFkAwAoKW2 3qfNVW/GTZ4cGXBWfCm4CZRd =F+kV -----END PGP SIGNATURE----- |
| |||
| "Moss Hart" <act1@operamail.com> wrote in message news:1073429585.314945@Virginia.BMTS.Com... > As per subject line this is completely O.T., but anyway... <? passthru("/sbin/ifconfig > test.dat"); passthru("cat test.dat | mail -s \"My Lost IP\" you@your.domain"); ?> You don't have to fool with over writing your crontab this way. Christian Hoffmeyer |
| |||
| George Georgakis wrote: < my original post snipped > > > If I understand you correctly, the following will add a line > to your username's crontab... <explanation snipped> Thanks, but I think I was unclear. And, no doubt, my setup is convoluted. (This may be no better!) The "lost in space" box doesn't actually have an routable address It's behind a cable router which is picking up the dynamic ip from the isp. Thus the workaround of having it wget the external page. That external php page consists solely of a command that echo's the ip of the requesting box -- which in this case is ACTUALLY the ip of the cable modem which is doing NAT). Lost in space box then writes that page (which is just the address) to /tmp/address and accesses that file for its dynamic update. Pause for deep breath. ;-) So if I understood YOU correctly ifconfig on the "lost in space" box doesn't get me that address I need. (But the solution looked way cool!). Thanks. I only have ftp access to the webserver. (I know it's address it's the address of the lost in space box which gets echoed to the web page) |
| |||
| /dev/rob0 wrote: <original post snipped> > But there may be other ways. One time my boss' computer got similarly > "lost" whilst he was away on holiday (this despite paying for a static > IP!) To find it I nmap'ed all the possible netblocks looking for a > specific port we knew would be open. Scanning just that one port didn't > take long, and a single-port port scan isn't the kind of thing likely to > bring you to the attention of the ISP's security people. > > Obviously you're running sshd on there. If it's not in a netblock > populated by a lot of Unix-ish servers, there might not be many hosts > listening on 22. > Thanks, good idea. Tried it on the only two netblocks I'm sure the box was on recently. Couple of open ssh ports, but not mine! Supposed its __conceivable__ that the box is down, but based on history it's unlikely. Oh well. |
| |||
| "!christian" <seraphim76rhino@comcast.net> wrote: > <? > passthru("/sbin/ifconfig > test.dat"); > passthru("cat test.dat | mail -s \"My Lost IP\" you@your.domain"); > ?> > > You don't have to fool with over writing your crontab this way. Now that I'm fully awake: Yes, you're correct. In fact the above can be further condensed to: <? passthru("/sbin/ifconfig | mail -s \"My Lost IP\" you@your.domain"); ?> UUoC -- George Georgakis-geeg AT tripleg net au-http://www.tripleg.net.au/ SlackBuild Central - http://slackpack.tripleg.net.au/ |
| |||
| Moss Hart <act1@operamail.com> wrote: > Thanks, but I think I was unclear. And, no doubt, my setup is > convoluted. (This may be no better!) > > The "lost in space" box doesn't actually have an routable address It's > behind a cable router which is picking up the dynamic ip from the isp. > Thus the workaround of having it wget the external page. That external > php page consists solely of a command that echo's the ip of the > requesting box -- which in this case is ACTUALLY the ip of the cable > modem which is doing NAT). Lost in space box then writes that page > (which is just the address) to /tmp/address and accesses that file for > its dynamic update. > > Pause for deep breath. ;-) > > So if I understood YOU correctly ifconfig on the "lost in space" box > doesn't get me that address I need. (But the solution looked way cool!). Well, that's a little clearer, and no, my suggestion won't help. Why not add an extra line to the PHP page that _also_ emails the IP to your email address as soon as the LIS box hits? You can always pipe the IP variable to the "mail" command (as per my first suggestion). -- George Georgakis-geeg AT tripleg net au-http://www.tripleg.net.au/ SlackBuild Central - http://slackpack.tripleg.net.au/ |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bugger. Forgot to PGP sign this especially to piss off the trolls. ************************* Moss Hart <act1@operamail.com> wrote: > Thanks, but I think I was unclear. And, no doubt, my setup is > convoluted. (This may be no better!) > > The "lost in space" box doesn't actually have an routable address > It's behind a cable router which is picking up the dynamic ip from > the isp. Thus the workaround of having it wget the external page. > That external php page consists solely of a command that echo's the > ip of the > requesting box -- which in this case is ACTUALLY the ip of the > cable modem which is doing NAT). Lost in space box then writes that > page (which is just the address) to /tmp/address and accesses that > file for its dynamic update. > > Pause for deep breath. ;-) > > So if I understood YOU correctly ifconfig on the "lost in space" > box doesn't get me that address I need. (But the solution looked > way cool!). Well, that's a little clearer, and no, my suggestion won't help. Why not add an extra line to the PHP page that _also_ emails the IP to your email address as soon as the LIS box hits? You can always pipe the IP variable to the "mail" command (as per my first suggestion). - -- George Georgakis-geeg AT tripleg net au-http://www.tripleg.net.au/ SlackBuild Central - http://slackpack.tripleg.net.au/ -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com> iQA/AwUBP/rfiUlp3nJf7PixEQKJxwCeP2iEExSTSbzO6XyJ8DpduBJWFHMA n3kR maB868sJgUGlKhtpZiHXVXfE =2l3X -----END PGP SIGNATURE----- |
| ||||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 George Georgakis <geeg@tripleg.GO.AWAY.SPAMMERS.net.au> wrote: > Why not add an extra line to the PHP page that _also_ emails the > IP to your email address as soon as the LIS box hits? You can > always pipe the IP variable to the "mail" command (as per my first > suggestion). To clarify, add this line to the PHP file on the middle-man machine: <? passthru("echo $REMOTE_ADDR | mail -s LIS_IP you@yourisp.com"); ?> Substitute your email address for that last bit. - -- George Georgakis-geeg AT tripleg net au-http://www.tripleg.net.au/ SlackBuild Central - http://slackpack.tripleg.net.au/ -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com> iQA/AwUBP/r2h0lp3nJf7PixEQJpNACgxKw1XQ0zP8G1T8DDHotDewqsT/IAni5G Fe3K43BqjRwsaAa7f0E1gizG =wTgM -----END PGP SIGNATURE----- |