Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ipsite = (new-object net.webclient).DownloadString("http://myip.ru")
- if ($ipsite -cmatch '(?s)<TD bgcolor=white align=center valign=middle>([0-9]{1,3}?\.[0-9]{1,3}?\.[0-9]{1,3}?\.[0-9]{1,3}?)</TD>') {
- $ip = $matches[1]
- } else {
- Write-Error "Cannot get ip!"; return
- }
- $redirtemp = '<?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>
- Dynamic IP Page
- </title>
- </head>
- <body>
- The IP now is: ' + $ip +' <br></br>
- <a href="http://' + $ip +'">Router Control</a><br></br>
- <a href="http://' + $ip +':6566/gui/">Torrent Client Control</a><br></br>
- <a href="http://wmorein.com/rdpcreator/remote.php?servername=' + $ip +'">RDP Session (to Laptop)</a><hr></hr>
- Updated at ' + [string](Get-Date) +'
- </body>
- </html>'
- $redirtemp > redir.xhtml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement