changeset 657:71e998951fbf draft

d3v11 added im-steal.c for splice3 in contrib/splice3/TOOLS/IM-STEAL enjoy :-)
author d3v11 <d3v11@d3v11.ano>
date Sat, 08 Oct 2011 00:33:36 -0500
parents d6e8a6c39807
children bd1f56c22102
files contrib/splice3/CHANGES contrib/splice3/README contrib/splice3/TOOLS/IM-STEAL/README contrib/splice3/TOOLS/IM-STEAL/im-steal.c
diffstat 4 files changed, 274 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/splice3/CHANGES	Thu Oct 06 21:38:49 2011 -0500
+++ b/contrib/splice3/CHANGES	Sat Oct 08 00:33:36 2011 -0500
@@ -1,11 +1,11 @@
 CHANGES:
-     Fri Sep  9 2011
-     d3v11 added timed iterations to bruteforcing algorithms.
+	Fri Sep  9 2011
+	d3v11 added timed iterations to bruteforcing algorithms.
            This allows that a user can pause the attacks for
            "X" seconds after every "N" tries.
 
-     Sat Sep 10 2011
-     d3v11 fixed bugs associated with previous iteration
+	Sat Sep 10 2011
+	d3v11 fixed bugs associated with previous iteration
            controls.
 
            fixed an old bug from splice* projects that gave
@@ -23,8 +23,8 @@
            unused modules and libraries trimmed from import
            on splice3.py and *deshadow.py .
 
-     Sun Sep 11 2011
-     d3v11 fixed --stdout
+	Sun Sep 11 2011
+	d3v11 fixed --stdout
 
            added --no-char flag to override appending
            characters to passwords.
@@ -32,8 +32,8 @@
            added --wep-5 and --wep-13 to generate WEP key
            compatible passwords.
 
-     Thu Sep 15 2011
-     d3v11 fixed Makefile
+	Thu Sep 15 2011
+	d3v11 fixed Makefile
 
            added --usernames for -u.
 
@@ -41,8 +41,8 @@
  
            added `make update`.
 
-     Sun Sep 18 2011
-     d3v11 Changed Makefile to prevent install/uninstall
+	Sun Sep 18 2011
+	d3v11 Changed Makefile to prevent install/uninstall
            bugs.
 
            Made some changes to the manual pages.
@@ -50,11 +50,16 @@
            added `make clean`.
 
            
-     Sat Sep 24 2011
-     d3v11 Changed Makefile and disabled py_compile
+	Sat Sep 24 2011
+	d3v11 Changed Makefile and disabled py_compile
            to avoid interpreter errors.
 
-     Sat Oct  1 2011
-     d3v11 added setup and setup-deb with Makefile
+	Sat Oct  1 2011
+	d3v11 added setup and setup-deb with Makefile
            to check for dependencies and set the
            correct environment paths.
+
+	Sat Oct  8 2011
+	d3v11 added im-steal.c, C code that uses
+           libpurple to test successfull logins
+           on several instant messenger protocols. 
--- a/contrib/splice3/README	Thu Oct 06 21:38:49 2011 -0500
+++ b/contrib/splice3/README	Sat Oct 08 00:33:36 2011 -0500
@@ -1,60 +1,63 @@
 DESCRIPTION:
-       Brute Force Utilities For The Linux Shell.
+	Brute Force Utilities For The Linux Shell.
 
 NOTE:
-       splice3 is currently under development. Major changes and bug
-       fixes will be appended to a CHANGES file. Some changes like
-       spelling errors or other small edits may not be shown. While
-       splice3 is being developed.
+	splice3 is currently under development. Major changes and bug
+	fixes will be appended to a CHANGES file. Some changes like
+	spelling errors or other small edits may not be shown. While
+	splice3 is being developed.
 
 USER: 
-      splice3 is community ideas in a python2.7 implementation. please
-      feel free to fork or modify this project and upload it as you see
-      fit under the terms of the GPLv3.
+	splice3 is community ideas in a python2.7 implementation. please
+	feel free to fork or modify this project and upload it as you see
+	fit under the terms of the GPLv3.
 
 LICENSE:
-      This program is free software: you can redistribute it and/or modify
-      it under the terms of the GNU General Public License as published by
-      the Free Software Foundation, either version 3 of the License, or
-      (at your option) any later version.
+	This program is free software: you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation, either version 3 of the License, or
+	(at your option) any later version.
 
-      This program is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-      GNU General Public License for more details.
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
 
-      You should have received a copy of the GNU General Public License
-      along with this program.  If not, see <http://www.gnu.org/licenses/>.
+	You should have received a copy of the GNU General Public License
+	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 DEPENDS ON:
-      python2.7, man
+	python2.7, man
 
 INSTALL AND UNINSTALL:
-      To install, `cd' to the extracted splice folder.
-      Issue the following commands as root:
+	To install, `cd' to the extracted splice folder.
+	Issue the following commands as root:
 
-      make install
+	make install
 
-      To uninstall splice3, as root do:
+	To uninstall splice3, as root do:
 
-      make uninstall
+	make uninstall
 
-      To compile/install a .deb package, as root do:
+	To compile/install a .deb package, as root do:
 
-      make install-deb
+	make install-deb
 
 UPDATE:
-      # d3v11's AnoNet update for splice3 - Not as root, do:
+	# d3v11's AnoNet update for splice3 - Not as root, do:
 
-      make update
+	make update
 
 HELP AND USAGE:
-     To obtain additional information on how to use splice3
-     enter either of the following commands after installation:
+	To obtain additional information on how to use splice3
+	enter either of the following commands after installation:
+
+	# For simple help display use:
 
-     # For simple help display use:
-     splice3 -h
-     # For the detailed manual use:
-     splice3 --rtfm
+	splice3 -h
+
+	# For the detailed manual use:
+
+	splice3 --rtfm
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/splice3/TOOLS/IM-STEAL/README	Sat Oct 08 00:33:36 2011 -0500
@@ -0,0 +1,45 @@
+DESCRIPTION:
+	im-steal.c is a modified nullclient.c that uses
+	libpurple to test for a successfull login on
+	multiple instant messenger protocols.
+
+USAGE:
+	im-steal <prpl-protocol> <username> <password>
+
+SPLICE3 USAGE:
+	splice3 
+	--command='im-steal <prpl-protocol> <username> PASSWORD'
+	--<modules>
+	--test='Account Connected'
+
+DEPENDS:
+	libpurple-dev, libpurple
+
+INSTALL:
+	gcc `pkg-config --libs glib-2.0` -I /usr/include/libpurple/
+        -I /usr/include/glib-2.0/ -I /usr/lib/glib-2.0/include/
+        -lpurple im-steal.c -o /usr/bin/im-steal
+
+UNINSTALL:
+	rm /usr/bin/im-steal
+
+PRPL-PROTOCOL:
+	libpurple requires and allows several prpl-* arguments
+	to call various instant messenger protocols.
+
+	AIM		==	prpl-aim
+	Bonjour		==	prpl-bonjour
+	Gadu-Gadu	==	prpl-gg
+	GroupWise	==	prpl-novell
+	ICQ		==	prpl-icq
+	IRC		==	prpl-irc
+	MSN		==	prpl-msn
+	MySpaceIM	==	prpl-myspace
+	QQ		==	prpl-qq
+	SILC		==	prpl-silc
+	SIMPLE		==	prpl-simple
+	Sametime	==	prpl-meanwhile
+	XMPP		==	prpl-jabber
+	Yahoo		==	prpl-yahoo
+	Yahoo JAPAN	==	prpl-yahoojp
+	Zephyr		==	prpl-zephyr
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/splice3/TOOLS/IM-STEAL/im-steal.c	Sat Oct 08 00:33:36 2011 -0500
@@ -0,0 +1,173 @@
+/*
+ * Modified libpurple nullclient.c from http://pidgin.sourcearchive.com.
+ * This libpurple program serves no other purpose other than testing
+ * for a successfull login.
+ */
+
+#include "purple.h"
+#include <glib.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#define CUSTOM_USER_DIRECTORY  "/dev/null"
+#define CUSTOM_PLUGIN_PATH     ""
+#define PLUGIN_SAVE_PREF       "/purple/user/plugins/saved"
+#define UI_ID                  "user"
+#define PURPLE_GLIB_READ_COND  (G_IO_IN | G_IO_HUP | G_IO_ERR)
+#define PURPLE_GLIB_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL)
+
+typedef struct _PurpleGLibIOClosure {
+	PurpleInputFunction function;
+	guint result;
+	gpointer data;
+} PurpleGLibIOClosure;
+
+
+static void purple_glib_io_destroy(gpointer data)
+{
+	g_free(data);
+}
+
+static gboolean purple_glib_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data)
+{
+	PurpleGLibIOClosure *closure = data;
+	PurpleInputCondition purple_cond = 0;
+
+	if (condition & PURPLE_GLIB_READ_COND)
+		purple_cond |= PURPLE_INPUT_READ;
+	if (condition & PURPLE_GLIB_WRITE_COND)
+		purple_cond |= PURPLE_INPUT_WRITE;
+
+	closure->function(closure->data, g_io_channel_unix_get_fd(source),
+			  purple_cond);
+
+	return TRUE;
+}
+
+static guint glib_input_add(gint fd, PurpleInputCondition condition, PurpleInputFunction function,
+							   gpointer data)
+{
+	PurpleGLibIOClosure *closure = g_new0(PurpleGLibIOClosure, 1);
+	GIOChannel *channel;
+	GIOCondition cond = 0;
+
+	closure->function = function;
+	closure->data = data;
+
+	if (condition & PURPLE_INPUT_READ)
+		cond |= PURPLE_GLIB_READ_COND;
+	if (condition & PURPLE_INPUT_WRITE)
+		cond |= PURPLE_GLIB_WRITE_COND;
+
+	channel = g_io_channel_unix_new(fd);
+	closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond,
+					      purple_glib_io_invoke, closure, purple_glib_io_destroy);
+
+	g_io_channel_unref(channel);
+	return closure->result;
+}
+
+static PurpleEventLoopUiOps glib_eventloops =
+{
+	g_timeout_add,
+	g_source_remove,
+	glib_input_add,
+	g_source_remove,
+	NULL,
+#if GLIB_CHECK_VERSION(2,14,0)
+	g_timeout_add_seconds,
+#else
+	NULL,
+#endif
+	NULL,
+	NULL,
+	NULL
+};
+
+static void network_disconnected(void)
+{
+	printf("This machine has been disconnected from the internet\n");
+}
+
+static void report_disconnect_reason(PurpleConnection *gc, PurpleConnectionError reason, const char *text)
+{
+	PurpleAccount *account = purple_connection_get_account(gc);
+	printf("Connection disconnected: \"%s\" (%s)\n  >Error: %d\n  >Reason: %s\n", purple_account_get_username(account), purple_account_get_protocol_id(account), reason, text);
+}
+
+static PurpleConnectionUiOps connection_uiops =
+{
+	NULL,                      /* connect_progress         */
+	NULL,                      /* connected                */
+	NULL,                      /* disconnected             */
+	NULL,                      /* notice                   */
+	NULL,                      /* report_disconnect        */
+	NULL,                      /* network_connected        */
+	network_disconnected,      /* network_disconnected     */
+	report_disconnect_reason,  /* report_disconnect_reason */
+	NULL,
+	NULL,
+	NULL
+};
+
+static void ui_init(void)
+{
+	purple_connections_set_ui_ops(&connection_uiops);
+}
+
+static PurpleCoreUiOps core_uiops =
+{
+	NULL,
+	NULL,
+	ui_init,
+	NULL,
+
+	/* padding */
+	NULL,
+	NULL,
+	NULL,
+	NULL
+};
+
+static void init_libpurple(void)
+{
+	purple_debug_set_enabled(FALSE);
+	purple_core_set_ui_ops(&core_uiops);
+	purple_eventloop_set_ui_ops(&glib_eventloops);
+
+	if (!purple_core_init(UI_ID)) {
+	fprintf(stderr,
+	"libpurple initialization failed. Dumping core.\n"
+	"Please report this!\n");
+	abort();
+	}
+	purple_set_blist(purple_blist_new()); // "Unnecessary" code left here to prevent output spam.
+}
+
+static void signed_on(PurpleConnection *gc)
+{
+	printf("Account Connected\n");
+        abort();
+}
+
+static void connect_to_signals(void)
+{
+	static int handle;
+	purple_signal_connect(purple_connections_get_handle(), "signed-on", &handle,
+	PURPLE_CALLBACK(signed_on), NULL);
+}
+
+int main(int argc, char *argv[])
+{
+	GMainLoop *loop = g_main_loop_new(NULL, FALSE);
+	signal(SIGCHLD, SIG_IGN);
+	init_libpurple();
+	connect_to_signals();
+	PurpleAccount *account = purple_account_new(argv[2], argv[1]);
+	purple_account_set_password(account, argv[3]);
+	purple_accounts_add(account);
+	purple_account_set_enabled(account, UI_ID, TRUE);
+	g_main_loop_run(loop);
+	return 0;
+}