Still safe, GOGOPH Server is not in the list... XD<br><br><div class="gmail_quote">2012/5/14 Kim Holviala <span dir="ltr"><<a href="mailto:kim@holviala.com" target="_blank">kim@holviala.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On May 14, 2012, at 19:27 , Kim Holviala wrote:<br>
<br>
> And related to the above; I can determine with 100% reliability all of the existing gopher servers. Got code too to prove it.<br>
<br>
</div>Still one more before I go see teh ladies.<br>
<br>
/*<br>
* Figure out gopher server software<br>
*/<br>
char *get_gopherd(char *host, int port)<br>
{<br>
static char result[128];<br>
char page[BUFSIZE];<br>
char *c;<br>
<br>
/* Try fingerprinting hURL reply */<br>
if (tcp_request(host, port, "URL:<a href="http://www.google.com/" target="_blank">http://www.google.com/</a>" CRLF,<br>
page, sizeof(page)) == ERROR) return NA;<br>
<br>
if (strstr(page, "pygopherd")) return "PyGopherd";<br>
if (strstr(page, "bucktooth")) return "Bucktooth";<br>
if (strstr(page, "Gophernicus")) return "Gophernicus";<br>
if (strstr(page, "GopherBlock")) return "GopherBlock";<br>
if (strstr(page, "You'll be redirected")) return "mgod";<br>
if (strstr(page, "This page is for redirecting you")) return "Geomyidae";<br>
if (strstr(page, "It appears that you clicked on a")) return "Grumpy";<br>
if (strstr(page, "refresh\" content=\"0;URL=") &&<br>
!strstr(page, "</HTML>")) return "Gophserv";<br>
<br>
if (sstrncmp(page, "3Server error: Sorry, access denied") == MATCH &&<br>
strstr(page, "\terror.host")) return "GN";<br>
<br>
/* Synchronet? */<br>
if (page[0] == '.') {<br>
if (tcp_request(host, port, "ver" CRLF,<br>
page, sizeof(page)) == ERROR) return NA;<br>
if (strstr(page, "Synchronet")) return "Synchronet";<br>
}<br>
<br>
/* VenVen */<br>
if (page[0] == '\0') {<br>
if (tcp_request(host, port, CRLF,<br>
page, sizeof(page)) == ERROR) return NA;<br>
if (strstr(page, "0./") || strstr(page, "1./")) return "VenVen";<br>
}<br>
<br>
/* Do one more detection test */<br>
if (tcp_request(host, port, "lkjsdflkjsadlflksjdflkjasdfklj" CRLF,<br>
page, sizeof(page)) == ERROR) return NA;<br>
<br>
if (strstr(page, "no handler found")) return "PyGopherd";<br>
if (strstr(page, "[pselect]")) return "GN";<br>
if (strstr(page, "<html") || strstr(page, "<HTML")) return "g2httpd";<br>
<br>
/* Try /server-status */<br>
if (tcp_request(host, port, "/server-status" CRLF,<br>
page, sizeof(page)) == ERROR) return NA;<br>
<br>
if ((c = strstr(page, "Server: "))) {<br>
sstrlcpy(result, c + 8);<br>
if ((c = strchr(result, '/'))) *c = '\0';<br>
if ((c = strchr(result, '('))) *c = '\0';<br>
return result;<br>
}<br>
<br>
/* Damn */<br>
return "Unknown";<br>
<div class="HOEnZb"><div class="h5">}<br>
<br>
<br>
<br>
_______________________________________________<br>
Gopher-Project mailing list<br>
<a href="mailto:Gopher-Project@lists.alioth.debian.org">Gopher-Project@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Damien CAROL<br>
<a href="gopher://dams.zapto.org/1/" target="_blank">gopher://dams.zapto.org/1/</a><br>