[Pkg-privacy-commits] [onioncat] 19/241: small tool for querying hidden service descriptors added (checkhidden (sh) and getdesc.c)
Intrigeri
intrigeri at moszumanska.debian.org
Wed Aug 26 16:16:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch upstream-master
in repository onioncat.
commit daa118e01002f8d276ae62eb44bb155b5e91bd37
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date: Mon Feb 11 20:43:54 2008 +0000
small tool for querying hidden service descriptors added (checkhidden (sh) and getdesc.c)
git-svn-id: https://www.cypherpunk.at/svn/onioncat/trunk@135 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
checkhidden | 20 ++++++++++++++++++++
getdesc.c | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git a/checkhidden b/checkhidden
new file mode 100755
index 0000000..f3867c9
--- /dev/null
+++ b/checkhidden
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ -z "$1" ] ; then
+ echo "usage: $0 <hidden_service_hostname>"
+ exit 1
+fi
+
+TDIR="http://moria.seul.org:9032"
+HPID=`echo "$1" | cut -d . -f 1`
+
+rm "$HPID" >/dev/null 2>&1
+wget -q "$TDIR/tor/rendezvous/$HPID"
+
+if [ ! -f "$HPID" ] ; then
+ echo "could download \"$HPID\" from directory \"$TDIR\""
+ exit 1
+fi
+
+./getdesc < "$HPID"
+
diff --git a/getdesc.c b/getdesc.c
new file mode 100644
index 0000000..965b0cd
--- /dev/null
+++ b/getdesc.c
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+#include <time.h>
+#include <string.h>
+
+#define FRAME_SIZE 2048
+
+int main(int argc, char *argv[])
+{
+ char buf[FRAME_SIZE];
+ char timestr[32];
+ char *ptr = buf;
+ int len, intro, i;
+ time_t ts;
+ struct tm *tm;
+
+ read(0, buf, FRAME_SIZE);
+
+ len = ntohs(*((uint16_t*) ptr));
+ ptr += len + 2;
+ ts = ntohl(*((uint32_t*) ptr));
+ tm = localtime(&ts);
+ strftime(timestr, 32, "%c", tm);
+ ptr += 4;
+ intro = ntohs(*((uint16_t*) ptr));
+ ptr += 2;
+
+ printf("key_len = %d\ntimestamp = \"%s\" (%ld)\nintro_point_cnt = %d\n", len, timestr, ts, intro);
+
+ for (i = 0; i < intro; i++)
+ {
+ printf("intro_point[%d] = \"%s\"\n", i, ptr);
+ ptr += strlen(ptr) + 1;
+ }
+
+ return 0;
+}
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git
More information about the Pkg-privacy-commits
mailing list