From 38fd80af340e9509b26029284a904da448e08d63 Mon Sep 17 00:00:00 2001 From: tilman Date: Tue, 17 Jul 2012 10:16:01 +0200 Subject: [PATCH] initial commit --- WebCallerID/.classpath | 36 ++ WebCallerID/.project | 23 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.eclipse.m2e.core.prefs | 4 + WebCallerID/Header.txt | 427 ++++++++++++++++++ WebCallerID/pom.xml | 23 + .../de/tilman/callerId/CallerIdClient.java | 144 ++++++ .../java/de/tilman/callerId/ClientApp.java | 212 +++++++++ 8 files changed, 874 insertions(+) create mode 100755 WebCallerID/.classpath create mode 100755 WebCallerID/.project create mode 100755 WebCallerID/.settings/org.eclipse.jdt.core.prefs create mode 100755 WebCallerID/.settings/org.eclipse.m2e.core.prefs create mode 100755 WebCallerID/Header.txt create mode 100755 WebCallerID/pom.xml create mode 100755 WebCallerID/src/main/java/de/tilman/callerId/CallerIdClient.java create mode 100755 WebCallerID/src/main/java/de/tilman/callerId/ClientApp.java diff --git a/WebCallerID/.classpath b/WebCallerID/.classpath new file mode 100755 index 0000000..9fc2de7 --- /dev/null +++ b/WebCallerID/.classpath @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebCallerID/.project b/WebCallerID/.project new file mode 100755 index 0000000..d86c620 --- /dev/null +++ b/WebCallerID/.project @@ -0,0 +1,23 @@ + + + WebCallerID + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/WebCallerID/.settings/org.eclipse.jdt.core.prefs b/WebCallerID/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 0000000..abec6ca --- /dev/null +++ b/WebCallerID/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/WebCallerID/.settings/org.eclipse.m2e.core.prefs b/WebCallerID/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 0000000..f897a7f --- /dev/null +++ b/WebCallerID/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/WebCallerID/Header.txt b/WebCallerID/Header.txt new file mode 100755 index 0000000..05ce029 --- /dev/null +++ b/WebCallerID/Header.txt @@ -0,0 +1,427 @@ +https://speedport.ip/index/login.cgi + +POST /index/login.cgi HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/ +Content-Length: 36 +Content-Type: text/plain; charset=UTF-8 +Cookie: SessionID_R3=Rian5OU7Cuj +Pragma: no-cache +Cache-Control: no-cache +Username=admin&Password=NTM3OTUzMDY= +HTTP/1.1 200 OK +Set-Cookie: SessionID_R3=CEjlGlQAHj1; path=/ +Content-Type: text/plain +Content-Length: 24 +---------------------------------------------------------- +https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 + +GET /auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/ +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Content-Type: text/html +Content-Length: 16452 +---------------------------------------------------------- +https://speedport.ip/pub/js_prf_25.js + +GET /pub/js_prf_25.js HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: */* +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: text/js +Content-Length: 2105 +---------------------------------------------------------- +https://speedport.ip/pub/style_as_25.css + +GET /pub/style_as_25.css HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/css,*/*;q=0.1 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: text/css +Content-Length: 730 +---------------------------------------------------------- +https://speedport.ip/pub/pic_b.gif + +GET /pub/pic_b.gif HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Content-Type: image/gif +Content-Length: 2264 +---------------------------------------------------------- +https://speedport.ip/pub/pic_c_startbild_v_kl.jpg + +GET /pub/pic_c_startbild_v_kl.jpg HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/jpeg +Content-Length: 15547 +---------------------------------------------------------- +https://speedport.ip/pub/pic_c_startbild_h_kl_1.jpg + +GET /pub/pic_c_startbild_h_kl_1.jpg HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/jpeg +Content-Length: 21913 +---------------------------------------------------------- +https://speedport.ip/pub/pic_c_startbild_h_1.jpg + +GET /pub/pic_c_startbild_h_1.jpg HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/jpeg +Content-Length: 45836 +---------------------------------------------------------- +https://speedport.ip/pub/pic_m_back_1.gif + +GET /pub/pic_m_back_1.gif HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/pub/style_25.css +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/gif +Content-Length: 1160 +---------------------------------------------------------- +https://speedport.ip/pub/pic_c_as2.gif + +GET /pub/pic_c_as2.gif HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/gif +Content-Length: 134 +---------------------------------------------------------- +https://speedport.ip/pub/pic_m_menu1.gif + +GET /pub/pic_m_menu1.gif HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/pub/style_25.css +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/gif +Content-Length: 2016 +---------------------------------------------------------- +https://speedport.ip/pub/pic_c_as1.gif + +GET /pub/pic_c_as1.gif HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/gif +Content-Length: 133 +---------------------------------------------------------- +https://speedport.ip/pub/pic_t_butlang.gif + +GET /pub/pic_t_butlang.gif HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/pub/style_25.css +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/gif +Content-Length: 1225 +---------------------------------------------------------- +https://speedport.ip/pub/info_startseite_de.xml + +GET /pub/info_startseite_de.xml HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:53 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: text/xml +Content-Length: 10485 +---------------------------------------------------------- +https://speedport.ip/pub/pic_c_inet_aktiv.gif + +GET /pub/pic_c_inet_aktiv.gif HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: image/png,image/*;q=0.8,*/*;q=0.5 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 + +HTTP/1.1 200 OK +Date: Mon, 16 Jul 2012 14:44:54 GMT +Connection: Keep-Alive +Last-Modified: Tue, 07 Feb 2012 12:05:23 GMT +Content-Type: image/gif +Content-Length: 1267 +---------------------------------------------------------- +https://speedport.ip/refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 + +POST /refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 +Pragma: no-cache +Cache-Control: no-cache +Content-Length: 0 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Content-Type: text/plain +Content-Length: 248 +---------------------------------------------------------- +https://speedport.ip/refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 + +POST /refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 +Pragma: no-cache +Cache-Control: no-cache +Content-Length: 0 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Content-Type: text/plain +Content-Length: 248 +---------------------------------------------------------- +https://speedport.ip/refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 + +POST /refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 +Pragma: no-cache +Cache-Control: no-cache +Content-Length: 0 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Content-Type: text/plain +Content-Length: 248 +---------------------------------------------------------- +https://speedport.ip/refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 + +POST /refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 +Pragma: no-cache +Cache-Control: no-cache +Content-Length: 0 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Content-Type: text/plain +Content-Length: 248 +---------------------------------------------------------- +https://speedport.ip/refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 + +POST /refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 +Pragma: no-cache +Cache-Control: no-cache +Content-Length: 0 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Content-Type: text/plain +Content-Length: 248 +---------------------------------------------------------- +https://speedport.ip/refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 + +POST /refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 +Pragma: no-cache +Cache-Control: no-cache +Content-Length: 0 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Content-Type: text/plain +Content-Length: 248 +---------------------------------------------------------- +https://speedport.ip/refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 + +POST /refajax/getStartSeite.cgi?cookie=SessionID_R3,CEjlGlQAHj1 HTTP/1.1 +Host: speedport.ip +User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Connection: keep-alive +Referer: https://speedport.ip/auth/hcti_startseite.php?cookie=SessionID_R3,CEjlGlQAHj1 +Cookie: SessionID_R3=CEjlGlQAHj1 +Pragma: no-cache +Cache-Control: no-cache +Content-Length: 0 + +HTTP/1.1 200 OK +Cache-Control: no-cache +Content-Type: text/plain +Content-Length: 248 +---------------------------------------------------------- diff --git a/WebCallerID/pom.xml b/WebCallerID/pom.xml new file mode 100755 index 0000000..afc7d2d --- /dev/null +++ b/WebCallerID/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + WebCallerID + WebCallerID + 0.0.1-SNAPSHOT + + + ant + ant-apache-log4j + 1.6.5 + + + org.apache.commons + commons-lang3 + 3.1 + + + org.apache.httpcomponents + httpclient + 4.2.1 + + + \ No newline at end of file diff --git a/WebCallerID/src/main/java/de/tilman/callerId/CallerIdClient.java b/WebCallerID/src/main/java/de/tilman/callerId/CallerIdClient.java new file mode 100755 index 0000000..3059b15 --- /dev/null +++ b/WebCallerID/src/main/java/de/tilman/callerId/CallerIdClient.java @@ -0,0 +1,144 @@ +package de.tilman.callerId; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpRequest; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.ProtocolException; +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.BasicResponseHandler; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.client.DefaultRedirectStrategy; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.protocol.HttpContext; +import org.apache.http.util.EntityUtils; + +public class CallerIdClient { + + DefaultHttpClient httpclient = new DefaultHttpClient(); + + public CallerIdClient() { + + // HttpGet httpget = new HttpGet("http://www.myspace.com/auth/form"); + // com.sun.org.apache.xerces.internal.impl.dv.util.Base64.encode(null); + + + httpclient.setRedirectStrategy(new DefaultRedirectStrategy() { + public boolean isRedirected(HttpRequest request, + HttpResponse response, HttpContext context) { + boolean isRedirect = false; + try { + isRedirect = super.isRedirected(request, response, context); + } catch (ProtocolException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + if (!isRedirect) { + int responseCode = response.getStatusLine().getStatusCode(); + if (responseCode == 301 || responseCode == 302) { + return true; + } + } + return isRedirect; + } + }); + + try { + getTest(); + } catch (Exception e) { + e.printStackTrace(); + } + + httpclient.getConnectionManager().shutdown(); + } + + private void getTest() throws Exception { + + HttpGet httpGet = new HttpGet("https://speedport.ip"); +// HttpResponse response1 = httpclient.execute(httpGet); + +// HttpGet httpget = new HttpGet("http://www.google.com/"); + ResponseHandler responseHandler = new BasicResponseHandler(); + String responseBody = httpclient.execute(httpGet, responseHandler); + System.out.println("----------------------------------------"); + System.out.println(responseBody); + System.out.println("----------------------------------------"); + + + try { +// System.out.println(response1.getStatusLine()); +// HttpEntity entity1 = response1.getEntity(); + // do something useful with the response body + // and ensure it is fully consumed +// EntityUtils.consume(entity1); + } finally { + httpGet.releaseConnection(); + } + + + + // ----- + + HttpPost httpPost = new HttpPost("https://speedport.ip/index/login.cgi"); + List nvps = new ArrayList(); + nvps.add(new BasicNameValuePair("username", "admin")); + nvps.add(new BasicNameValuePair("password", Arrays + .toString(org.apache.commons.codec.binary.Base64 + .encodeBase64("53795306".getBytes())))); + httpPost.setEntity(new UrlEncodedFormEntity(nvps)); + HttpResponse response2 = httpclient.execute(httpPost); + + try { + System.out.println(response2.getStatusLine()); + HttpEntity entity2 = response2.getEntity(); + // do something useful with the response body + // and ensure it is fully consumed + EntityUtils.consume(entity2); + } finally { + httpPost.releaseConnection(); + } + } + + private void speedportLogin() { + // client.getParams().setParameter("j_username", "abc"); + // client.getParams().setParameter("j_password", "pqr"); + /* + * PostMethod post = new + * PostMethod("https://speedport.ip/index/login.cgi"); NameValuePair[] + * data = { new NameValuePair("username", "admin"), new + * NameValuePair("password", + * Arrays.toString(org.apache.commons.codec.binary + * .Base64.encodeBase64("53795306".getBytes()))) }; + * post.setRequestBody(data); + * + * // post.setParameter("Cookie", "SessionID_R3=Rian5OU7Cuj"); + * post.addRequestHeader("Referer", "https://speedport.ip/"); + * post.addRequestHeader("Cookie", "SessionID_R3=Rian5OU7Cuj"); + * + * try { int resp = client.executeMethod(post); + * System.out.println("Response Code: " + resp); } catch (HttpException + * e1) { e1.printStackTrace(); } catch (IOException e1) { + * e1.printStackTrace(); } + * + * // execute method and handle any error responses. try { InputStream + * in = post.getResponseBodyAsStream(); System.out.println("response: " + * + in); } catch (IOException e) { e.printStackTrace(); } // handle + * response. + */ + } + + /** + * @param args + */ + public static void main(String[] args) { + new CallerIdClient(); + } + +} diff --git a/WebCallerID/src/main/java/de/tilman/callerId/ClientApp.java b/WebCallerID/src/main/java/de/tilman/callerId/ClientApp.java new file mode 100755 index 0000000..b80afdf --- /dev/null +++ b/WebCallerID/src/main/java/de/tilman/callerId/ClientApp.java @@ -0,0 +1,212 @@ +//package de.tilman.callerId; +// +///* +// * $HeadURL$ +// * $Revision$ +// * $Date$ +// * ==================================================================== +// * +// * Licensed to the Apache Software Foundation (ASF) under one or more +// * contributor license agreements. See the NOTICE file distributed with +// * this work for additional information regarding copyright ownership. +// * The ASF licenses this file to You under the Apache License, Version 2.0 +// * (the "License"); you may not use this file except in compliance with +// * the License. You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// * ==================================================================== +// * +// * This software consists of voluntary contributions made by many +// * individuals on behalf of the Apache Software Foundation. For more +// * information on the Apache Software Foundation, please see +// * . +// * +// * [Additional notices, if required by prior licensing conditions] +// * +// */ +// +//import java.awt.BorderLayout; +//import java.awt.FlowLayout; +//import java.awt.event.ActionEvent; +//import java.awt.event.ActionListener; +//import java.awt.event.WindowAdapter; +//import java.awt.event.WindowEvent; +//import java.io.ByteArrayInputStream; +//import java.io.IOException; +// +//import javax.swing.JButton; +//import javax.swing.JComboBox; +//import javax.swing.JEditorPane; +//import javax.swing.JFrame; +//import javax.swing.JLabel; +//import javax.swing.JPanel; +//import javax.swing.JScrollPane; +//import javax.swing.JSplitPane; +//import javax.swing.JTextArea; +//import javax.swing.SwingUtilities; +//import javax.swing.text.BadLocationException; +//import javax.swing.text.html.HTMLDocument; +// +//import org.apache.commons.httpclient.HttpClient; +//import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; +//import org.apache.commons.httpclient.methods.GetMethod; +// +///** +// * A simple Swing application that demonstrates how to use the Jakarta +// * HttpClient API. This application loads HTML from servers and displays the +// * content as text and as rendered HTML. +// * +// * @author Sean C. Sullivan +// * @author Ortwin Glück +// * @author Michael Becke +// */ +//public class ClientApp { +// +// public static void main(String[] args) { +// HttpClientFrame f = new HttpClientFrame(); +// f.setTitle("HttpClient demo application"); +// f.setSize(700, 500); +// f.addWindowListener(new WindowAdapter() { +// public void windowClosing(WindowEvent e) { +// System.exit(0); +// } +// }); +// f.setVisible(true); +// } +// +// public static class HttpClientFrame extends JFrame { +// +// private JComboBox cmbURL; +// private JTextArea taTextResponse; +// private JEditorPane htmlPane; +// +// private HttpClient client; +// +// public HttpClientFrame() { +// client = new HttpClient(new MultiThreadedHttpConnectionManager()); +// client.getHttpConnectionManager().getParams() +// .setConnectionTimeout(30000); +// +// JPanel panInput = new JPanel(new FlowLayout()); +// +// String[] aURLs = { "http://www.apache.org/", +// "http://www.google.com/", "http://www.opensource.org/", +// "http://www.anybrowser.org/", "http://jakarta.apache.org/", +// "http://www.w3.org/" }; +// +// final JButton btnGET = new JButton("GET"); +// btnGET.addActionListener(new ActionListener() { +// public void actionPerformed(ActionEvent ae) { +// String url = (String) cmbURL.getSelectedItem(); +// if (url != null && url.length() > 0) { +// loadPage(url); +// } +// } +// }); +// +// cmbURL = new JComboBox(aURLs); +// cmbURL.setToolTipText("Enter a URL"); +// cmbURL.setEditable(true); +// cmbURL.setSelectedIndex(0); +// +// JLabel lblURL = new JLabel("URL:"); +// +// panInput.add(lblURL); +// panInput.add(cmbURL); +// panInput.add(btnGET); +// +// taTextResponse = new JTextArea(); +// taTextResponse.setEditable(false); +// taTextResponse.setCaretPosition(0); +// +// htmlPane = new JEditorPane(); +// htmlPane.setContentType("text/html"); +// htmlPane.setEditable(false); +// +// JSplitPane splitResponsePane = new JSplitPane( +// JSplitPane.HORIZONTAL_SPLIT, +// new JScrollPane(taTextResponse), new JScrollPane(htmlPane)); +// splitResponsePane.setOneTouchExpandable(false); +// splitResponsePane.setDividerLocation(350); +// // it would be better to set resizeWeight, but this method does +// // not exist in JRE 1.2.2 +// // splitResponsePane.setResizeWeight(0.5); +// +// this.getContentPane().setLayout(new BorderLayout()); +// this.getContentPane().add(panInput, BorderLayout.NORTH); +// this.getContentPane().add(splitResponsePane, BorderLayout.CENTER); +// } +// +// /** +// * Sets the HTML content to be displayed. +// * +// * @param content +// * an HTML document +// */ +// private void setDocumentContent(String content) { +// +// HTMLDocument doc = new HTMLDocument(); +// try { +// doc.remove(0, doc.getLength()); +// } catch (BadLocationException e) { +// e.printStackTrace(); +// } +// doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE); +// +// try { +// htmlPane.read(new ByteArrayInputStream(content.getBytes()), doc); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// +// htmlPane.setDocument(doc); +// htmlPane.setCaretPosition(0); +// +// taTextResponse.setText(content); +// taTextResponse.setCaretPosition(0); +// taTextResponse.requestFocus(); +// } +// +// /** +// * Loads the page at the given URL from a separate thread. +// * +// * @param url +// */ +// private void loadPage(final String url) { +// // create a new thread to load the URL from +// new Thread() { +// public void run() { +// GetMethod get = new GetMethod(url); +// get.setFollowRedirects(true); +// +// try { +// int iGetResultCode = client.executeMethod(get); +// final String strGetResponseBody = get +// .getResponseBodyAsString(); +// +// if (strGetResponseBody != null) { +// // set the HTML on the UI thread +// SwingUtilities.invokeLater(new Runnable() { +// public void run() { +// setDocumentContent(strGetResponseBody); +// } +// }); +// } +// } catch (Exception ex) { +// ex.printStackTrace(); +// } finally { +// get.releaseConnection(); +// } +// } +// }.start(); +// } +// +// } +// +//}