Permalink
Browse files

first commit

  • Loading branch information...
sch3m4
sch3m4 committed May 7, 2012
0 parents commit 29f46f1b4f9c16c44272517e4b21d4cc89d16819
Showing with 24,056 additions and 0 deletions.
  1. +5 −0 CHANGELOG
  2. +15 −0 LICENSE
  3. +4 −0 README
  4. +98 −0 tools/decrypt.py
  5. 0 wforensic/__init__.py
  6. +15 −0 wforensic/manage.py
  7. +157 −0 wforensic/settings.py
  8. +4 −0 wforensic/static/css/lib/jquery-1.7.1.min.js
  9. +314 −0 wforensic/static/css/yaml/add-ons/accessible-tabs/jquery.tabs.js
  10. +136 −0 wforensic/static/css/yaml/add-ons/accessible-tabs/tabs.css
  11. BIN wforensic/static/css/yaml/add-ons/microformats/icons/external_link.png
  12. BIN wforensic/static/css/yaml/add-ons/microformats/icons/hcalendar.png
  13. BIN wforensic/static/css/yaml/add-ons/microformats/icons/hcard.png
  14. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-geo.png
  15. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-hatom.png
  16. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-haudio.png
  17. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-hcalendar-add.png
  18. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-hcalendar-download.png
  19. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-hcalendar.png
  20. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-hcard-add.png
  21. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-hcard-download.png
  22. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-hcard.png
  23. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-hresume.png
  24. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-rel-tag.png
  25. BIN wforensic/static/css/yaml/add-ons/microformats/icons/icon-xfn.png
  26. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-child.png
  27. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-colleague-met.png
  28. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-colleague.png
  29. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-friend-met.png
  30. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-friend.png
  31. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-me.png
  32. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-parent.png
  33. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-small.png
  34. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-spouse.png
  35. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-sweetheart-met.png
  36. BIN wforensic/static/css/yaml/add-ons/microformats/icons/xfn/xfn-sweetheart.png
  37. +175 −0 wforensic/static/css/yaml/add-ons/microformats/microformats.css
  38. +77 −0 wforensic/static/css/yaml/add-ons/rtl-support/core/base-rtl.css
  39. +1 −0 wforensic/static/css/yaml/add-ons/rtl-support/core/base-rtl.min.css
  40. +54 −0 wforensic/static/css/yaml/add-ons/rtl-support/navigation/hlist-rtl.css
  41. +61 −0 wforensic/static/css/yaml/add-ons/rtl-support/navigation/vlist-rtl.css
  42. +44 −0 wforensic/static/css/yaml/add-ons/rtl-support/screen/typography-rtl.css
  43. +88 −0 wforensic/static/css/yaml/add-ons/syncheight/jquery.syncheight.js
  44. +484 −0 wforensic/static/css/yaml/core/base.css
  45. +1 −0 wforensic/static/css/yaml/core/base.min.css
  46. +385 −0 wforensic/static/css/yaml/core/iehacks.css
  47. +1 −0 wforensic/static/css/yaml/core/iehacks.min.css
  48. +72 −0 wforensic/static/css/yaml/core/js/yaml-focusfix.js
  49. +421 −0 wforensic/static/css/yaml/forms/gray-theme.css
  50. +134 −0 wforensic/static/css/yaml/navigation/hlist.css
  51. +125 −0 wforensic/static/css/yaml/navigation/vlist.css
  52. +69 −0 wforensic/static/css/yaml/print/print.css
  53. +93 −0 wforensic/static/css/yaml/screen/grid-960-12.css
  54. +113 −0 wforensic/static/css/yaml/screen/grid-960-16.css
  55. +212 −0 wforensic/static/css/yaml/screen/screen-FULLPAGE-layout.css
  56. +186 −0 wforensic/static/css/yaml/screen/screen-PAGE-layout.css
  57. +468 −0 wforensic/static/css/yaml/screen/typography.css
  58. BIN wforensic/static/img/favicon.ico
  59. BIN wforensic/static/img/logo.png
  60. BIN wforensic/static/img/map.png
  61. BIN wforensic/static/img/media.png
  62. BIN wforensic/static/img/powered/django.png
  63. BIN wforensic/static/img/powered/sqlite.png
  64. BIN wforensic/static/img/thumb.png
  65. +12 −0 wforensic/static/js/adapters/mootools-adapter.js
  66. +298 −0 wforensic/static/js/adapters/mootools-adapter.src.js
  67. +15 −0 wforensic/static/js/adapters/prototype-adapter.js
  68. +358 −0 wforensic/static/js/adapters/prototype-adapter.src.js
  69. +199 −0 wforensic/static/js/highcharts.js
  70. +13,291 −0 wforensic/static/js/highcharts.src.js
  71. +133 −0 wforensic/static/js/modules/canvas-tools.js
  72. +3,114 −0 wforensic/static/js/modules/canvas-tools.src.js
  73. +22 −0 wforensic/static/js/modules/exporting.js
  74. +734 −0 wforensic/static/js/modules/exporting.src.js
  75. +263 −0 wforensic/static/js/themes/dark-blue.js
  76. +263 −0 wforensic/static/js/themes/dark-green.js
  77. +262 −0 wforensic/static/js/themes/gray.js
  78. +95 −0 wforensic/static/js/themes/grid.js
  79. +89 −0 wforensic/static/js/themes/skies.js
  80. +45 −0 wforensic/templates/activitychart.html
  81. +60 −0 wforensic/templates/base.html
  82. +49 −0 wforensic/templates/havewhatsappchart.html
  83. +49 −0 wforensic/templates/messagesfrom.html
  84. +25 −0 wforensic/urls.py
  85. 0 wforensic/whatsapp/__init__.py
  86. +55 −0 wforensic/whatsapp/models.py
  87. +14 −0 wforensic/whatsapp/pagination.py
  88. +77 −0 wforensic/whatsapp/templates/whatsapp/chat.html
  89. +46 −0 wforensic/whatsapp/templates/whatsapp/chatlist.html
  90. +55 −0 wforensic/whatsapp/templates/whatsapp/contacts.html
  91. +99 −0 wforensic/whatsapp/templates/whatsapp/index.html
  92. 0 wforensic/whatsapp/templatetags/__init__.py
  93. +26 −0 wforensic/whatsapp/templatetags/gettemplateheader_tag.py
  94. +204 −0 wforensic/whatsapp/utils.py
  95. +92 −0 wforensic/whatsapp/views.py
@@ -0,0 +1,5 @@
+WForensic (0.1b)
+
+ * First release
+
+ -- Chema Garcia <chema@safetybits.net> (7/11/2011)
15 LICENSE
@@ -0,0 +1,15 @@
+Copyright (c) 2012, Chema Garcia
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ Neither the name of the SafetyBits nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
4 README
@@ -0,0 +1,4 @@
+wforensic
+=========
+
+User-friendly DJango project to data interpretation and chart of messages activity from WhatsApp records.
@@ -0,0 +1,98 @@
+#
+#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+# Copyright (c) 2012, Chema Garcia
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# Neither the name of the SafetyBits nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+# OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+#
+# Written by Chema Garcia
+# http://safetybits.net
+# http://twitter.com/sch3m4
+#
+# Thanks to Alejandro Ramos
+# www.securitybydefault.com
+# http://twitter.com/aramosf
+#
+
+try:
+ from Crypto.Cipher import AES
+ import sys
+except ImportError,e:
+ print "[f] Required module missing. %s" % e.args[0]
+ sys.exit(-1)
+
+key = "\x34\x6a\x23\x65\x2a\x46\x39\x2b\x4d\x73\x25\x7c\x67\x31\x7e\x35\x2e\x33\x72\x48\x21\x77\x65\x2c"
+
+def main():
+ print """
+ #######################################
+ # WhatsApp Forensic Tool #
+ #-------------------------------------#
+ # Decrypts encrypted msgstore files #
+ # This tool is part of WForensic #
+ # https://github.com/sch3m4/wforensic #
+ #######################################
+ """
+
+ if not len(sys.argv) is 3:
+ print "[i] Usage: %s <encrypted_file> <output_file>" % sys.argv[0]
+ print "\nExample: %s msgstore-2012-05-07.1.db.crypt msgstore-2012-05-07.1.db\n" % sys.argv[0]
+ sys.exit(0)
+
+ # shoulds never fail
+ print "[i] Setting AES key......." ,
+ try:
+ aes = AES.new(key,AES.MODE_ECB)
+ print "OK"
+ except Exception,e:
+ print "ERROR: %s" % e.msg
+ sys.exit(-2)
+
+ # open input file
+ print "[i] Opening input file...." ,
+ try:
+ ctext = open("/tmp/msgstore-2012-05-07.1.db.crypt",'rb')
+ print "OK"
+ except Exception , e:
+ print "ERROR: %s" % e.msg
+ sys.exit(-3)
+
+ # open output file
+ print "[i] Opening output file..." ,
+ try:
+ ptext = open("/tmp/salida.db","wb")
+ print "OK"
+ except Exception,e:
+ print "ERROR: %s" % e.msg
+ ctext.close()
+ sys.exit(-4)
+
+ # read input file and outputs decrypted block to output file
+ print "[i] Decrypting............" ,
+ cbytes = 0
+ for block in iter(lambda: ctext.read(AES.block_size), ''):
+ ptext.write(aes.decrypt(block))
+ cbytes += AES.block_size
+
+ ctext.close()
+ ptext.close()
+
+ print "OK (%d bytes)\n" % cbytes
+
+if __name__ == "__main__":
+ main()
+ sys.exit(0)
+
No changes.
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+from django.core.management import execute_manager
+import imp
+
+try:
+ imp.find_module('settings') # Assumed to be in the same directory.
+except ImportError:
+ import sys
+ sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
+ sys.exit(1)
+
+import settings
+
+if __name__ == "__main__":
+ execute_manager(settings)
@@ -0,0 +1,157 @@
+# Django settings for wforensic project.
+import os
+from os.path import dirname
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
+
+CONTACTS_PER_PAGE = 15
+CHATS_PER_PAGE = 15
+MESSAGES_PER_PAGE = 20
+LATEST_PEERS = 10
+TOP_PEERS = 10
+
+ADMINS = (
+ ('Chema Garcia', 'chema@safetybits.net'),
+)
+
+MANAGERS = ADMINS
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': dirname(SITE_ROOT) + '/wa.db',
+ },
+ 'msgstore': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': dirname(SITE_ROOT) + '/msgstore.db',
+ }
+}
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# On Unix systems, a value of None will cause Django to use the same
+# timezone as the operating system.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'Europe/Madrid'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/home/media/media.lawrence.com/media/"
+MEDIA_ROOT = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash.
+# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
+MEDIA_URL = ''
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/home/media/media.lawrence.com/static/"
+STATIC_ROOT = ''
+
+# URL prefix for static files.
+# Example: "http://media.lawrence.com/static/"
+STATIC_URL = '/static/'
+
+THUMBS_ROOT = SITE_ROOT + STATIC_URL + 'thumbs/'
+THUMBS_URL = STATIC_URL + 'thumbs/'
+
+# URL prefix for admin static files -- CSS, JavaScript and images.
+# Make sure to use a trailing slash.
+# Examples: "http://foo.com/static/admin/", "/static/admin/".
+ADMIN_MEDIA_PREFIX = '/static/admin/'
+
+# Additional locations of static files
+STATICFILES_DIRS = (
+ # Put strings here, like "/home/html/static" or "C:/www/django/static".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+ os.path.join(SITE_ROOT, 'static/'),
+)
+
+# List of finder classes that know how to find static files in
+# various locations.
+STATICFILES_FINDERS = (
+ 'django.contrib.staticfiles.finders.FileSystemFinder',
+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
+)
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = '6ze9q@e!m27##sahkt)9nxit56ihf+10igw^wi04-@h)(wh3mf'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+# 'django.template.loaders.eggs.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+ROOT_URLCONF = 'wforensic.urls'
+
+TEMPLATE_DIRS = (
+ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+ os.path.join(SITE_ROOT, 'templates'),
+)
+
+INSTALLED_APPS = (
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.staticfiles',
+ # Uncomment the next line to enable the admin:
+ # 'django.contrib.admin',
+ # Uncomment the next line to enable admin documentation:
+ # 'django.contrib.admindocs',
+ 'whatsapp',
+)
+
+# A sample logging configuration. The only tangible logging
+# performed by this configuration is to send an email to
+# the site admins on every HTTP 500 error.
+# See http://docs.djangoproject.com/en/dev/topics/logging for
+# more details on how to customize your logging configuration.
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
+ 'handlers': {
+ 'mail_admins': {
+ 'level': 'ERROR',
+ 'class': 'django.utils.log.AdminEmailHandler'
+ }
+ },
+ 'loggers': {
+ 'django.request': {
+ 'handlers': ['mail_admins'],
+ 'level': 'ERROR',
+ 'propagate': True,
+ },
+ }
+}

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 29f46f1

Please sign in to comment.