Hurricane Electric's IPv6 Tunnel Broker Forums

Advanced search  

News:

Welcome to Hurricane Electric's Tunnelbroker.net forums!

Pages: 1 [2]

Author Topic: Script for Certification tests  (Read 16821 times)

edmundwatson

  • Newbie
  • *
  • Posts: 13
Re: Script for Certification tests
« Reply #15 on: May 30, 2011, 04:30:44 AM »

to johnpoz

does sound like you had a ipv6 failure.
I have noticed that sixy.ch is slow over ipv4, and often timesout. (You can change the timeout somewhere in the code. I think it is set to 30 seconds) but yeah  if you ipv6 is not working better check that :-P

You can see what was submitted to HE by looking at tracertraw.txt (or named something simliar) also check fail.html. If you have look at that it may explain your errors.

"Fail - unknown error"  is just when the error isn't one I haven't come across before. But then it extracts the reason from the returned page on HE and display it. Hence the "Can't find any IPv6 hops or this is an invalid IPv6 traceroute!" I will add it to the list of know errors...


Have fun

Ed
Logged

johnpoz

  • Full Member
  • ***
  • Posts: 114
Re: Script for Certification tests
« Reply #16 on: May 30, 2011, 08:11:19 AM »

well that */1445 is not working its running every hour on the hour with that.

Which is kind of hammering he.net if you ask me -- I would be kind of pissed if everyone was doing that.  So turning it off.

So still need a way to run the script 24 hours and few minutes later every day to get around the 24 hour clock on he.net  they really should make it like a 23:55 clock.

But got my 5 points today from the script running.
Logged

yakatz

  • Newbie
  • *
  • Posts: 20
Re: Script for Certification tests
« Reply #17 on: May 30, 2011, 10:10:27 AM »

well that */1445 is not working its running every hour on the hour with that.
Mine too. I looked at having the script use a scheduled job (AT) instead of CRON.
« Last Edit: May 30, 2011, 10:50:38 AM by yakatz »
Logged

yakatz

  • Newbie
  • *
  • Posts: 20
Re: Script for Certification tests
« Reply #18 on: May 30, 2011, 10:51:13 AM »

(I moved this to a new post so that the email notifications will activate.)


Code: [Select]
#!/bin/bash
php he.php
echo "$0" | at tomorrow + 5minutes
I named this he.sh and put it in the same directory as everything else.
Code: [Select]
chmod +x he.shExecute it once to set it up/

I also added it to my user crontab so it will run if the server is restarted:
Quote from: crontab -e
Code: [Select]
# m h dom mon dow user  command
@reboot cd /home/yehuda/he; ./he.sh
Logged

johnpoz

  • Full Member
  • ***
  • Posts: 114
Re: Script for Certification tests
« Reply #19 on: May 30, 2011, 11:53:55 AM »

yeah that looks like a great idea, will give it a go tmrw after my current 24 hour clock has expired.
Logged

yakatz

  • Newbie
  • *
  • Posts: 20
Re: Script for Certification tests
« Reply #20 on: June 11, 2011, 08:29:33 PM »

I would like to report that this script along with my AT job addition has been working well for over a week.

I did run in to a minor issue with my jobs not being run, but that was a Ubuntu bug
Logged

juhoostman

  • Newbie
  • *
  • Posts: 11
Re: Script for Certification tests
« Reply #21 on: June 19, 2011, 05:09:41 AM »

Security fix:
Code: [Select]
diff --git a/getips.php b/getips.php
index 5256ca0..74d1b0a 100644
--- a/getips.php
+++ b/getips.php
@@ -22,7 +22,7 @@ if ($xml && !empty($xml))
 foreach($xml->entry as $entry) {
  $title = base64_encode($entry->title);
  //getting ip from dig
- $arip = preg_split("/((?<!\\\|\r)\n)|((?<!\\\)\r\n)/",trim(shell_exec("dig $entry->title AAAA +short")));
+ $arip = preg_split("/((?<!\\\|\r)\n)|((?<!\\\)\r\n)/",trim(shell_exec("dig ".escapeshellcmd($entry->title)." AAAA +short")));
  //may have multiply ips so adds them a different entries.
  foreach($arip as $ipraw)
  {
That is because I would hate if an RSS feeded commands to my shell.
Logged

yakatz

  • Newbie
  • *
  • Posts: 20
Re: Script for Certification tests
« Reply #22 on: June 19, 2011, 06:33:35 AM »

Security fix:
Code: [Select]
- $arip = preg_split("/((?<!\\\|\r)\n)|((?<!\\\)\r\n)/",trim(shell_exec("dig $entry->title AAAA +short")));
+ $arip = preg_split("/((?<!\\\|\r)\n)|((?<!\\\)\r\n)/",trim(shell_exec("dig ".escapeshellcmd($entry->title)." AAAA +short")));
That is because I would hate if an RSS feeded commands to my shell.
I put in a pull request for this change to edmundwatson on GitHub.

https://github.com/tactmaster/HECT/pull/1
Logged

edmundwatson

  • Newbie
  • *
  • Posts: 13
Re: Script for Certification tests
« Reply #23 on: June 20, 2011, 08:03:38 AM »

Sorry for not poking at this for a while, Tallinn is a very nice city I would recommend it for a short trip :-P

Cool. Thanks very much for this. That should now be in the code.
Also line 23
Code: [Select]
$title = base64_encode($entry->title)has the same problem as that is used later when the real test are used. That has been fixed also.

I have tided up the code a bit.
The settings have been moved in to a setting.json file.
Which gets created on first run.
This means that in future update you can just update from the git repo and you won't have to reset you settings.

(It also means I don't accidently commit my username and password  ;))

The at solution looks good.

I am writing another php script at the moment which needs to be daemonised. So I may add this to code in the near future.
Logged

klank

  • Newbie
  • *
  • Posts: 2
Re: Script for Certification tests
« Reply #24 on: June 20, 2011, 10:52:19 AM »

Just wanted to poke my head in and say "Thank You" for making this script!

 ;D
Logged

juhoostman

  • Newbie
  • *
  • Posts: 11
Re: Script for Certification tests
« Reply #25 on: June 20, 2011, 12:00:03 PM »

Also line 23
Code: [Select]
$title = base64_encode($entry->title)has the same problem as that is used later when the real test are used. That has been fixed also.
Was that not taken care of in getAddress:
Code: [Select]
    $address = array('host' => escapeshellcmd(base64_decode($ipdata[0])), 'ip' => escapeshellcmd(base64_decode($ipdata[1])));
It seems that the hostname would be escaped twice, not that it matters for any valid input.
As for me, I would escape the strings just before they are used to form a command line.
Logged

edmundwatson

  • Newbie
  • *
  • Posts: 13
Re: Script for Certification tests
« Reply #26 on: June 20, 2011, 12:04:39 PM »

Yeap fair enough! I forgot about that.
Logged

chandro

  • Newbie
  • *
  • Posts: 27
  • hello!!
    • Chandro & Co
Re: Script for Certification tests
« Reply #27 on: June 23, 2011, 08:53:38 AM »

i only get errors, why?

root@orev [~/HE]# php he.php
Current Dir: HECT/
Start:Thu, 23 Jun 11 09:50:15 -0600
RSS Check adding:pokeritieto.fi 2a01:4f8:110:3162:0:a:bad:beaf cG9rZXJpdGlldG8uZ
adding:iki.fi 2a00:1c30:1c1::51 aWtpLmZp  MmEwMDoxYzMwOjFjMTo6NTE=
Count:54
IP:2001:8c0:3202:1::3 Host:ventelo.no
Whois
Not Done
Performing again : 0
Performing Test..
whois 2001:8c0:3202:1::3
Fail - invalid submission
IP:2001:5c0:1000:b::57e9 Host:galactic.no
Performing again : 1
Performing Test..
whois 2001:5c0:1000:b::57e9
Fail - invalid submission
IP:2a01:4f8:110:3162:0:a:bad:beaf Host:pokeritieto.fi
Performing again : 2
Performing Test..
whois 2a01:4f8:110:3162:0:a:bad:beaf
Fail - invalid submission
IP:2a00:1c30:1c1::51 Host:iki.fi
Performing again : 3
Performing Test..
whois 2a00:1c30:1c1::51
Fail - invalid submission
Ran Out
RSS Check Count:54
IP:2001:638:804:a082::1:225 Host:wwwiuk.informatik.uni-rostock.de
Performing again : 4
Performing Test..
whois 2001:638:804:a082::1:225
Logged
2001:0:0:7::B0ND

edmundwatson

  • Newbie
  • *
  • Posts: 13
Re: Script for Certification tests
« Reply #28 on: June 23, 2011, 10:52:55 AM »

In ~/HE/HECT you should have a file called whoisraw.txt
Can you let me know what is in that file. That should display your error.

Thanks.
Ed
Logged
Pages: 1 [2]