Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
123 changes: 123 additions & 0 deletions datasploit/datasploit/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
"""
Django settings for datasploit project.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
#BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'qkcs#c=&q0+=w-i+%mq)9h0hc7v=ntsiaxj)5vu2t6551@-q6i'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'djangotoolbox',
'facebook',
'homepage',
'domain'
)


MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware'
)

ROOT_URLCONF = 'datasploit.urls'

WSGI_APPLICATION = 'datasploit.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
'default' : {
'ENGINE' : 'django_mongodb_engine',
'NAME' : 'datasploit'
}
}


TEMPLATE_DIRS = (
os.path.join(BASE_DIR , 'templates/' ),
)


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
},
]

TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
"django.core.context_processors.request",
)

# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/


STATIC_ROOT = os.path.join(BASE_DIR ,'static','static_root')

STATIC_URL = '/static/'

STATICFILES_DIRS = [
os.path.join(BASE_DIR ,'static','static_dirs'),
]

MEDIA_ROOT = '/media/'

MEDIA_URL = os.path.join(BASE_DIR ,'static','media/')

# MongoDB Server Details
MONGODB_HOST = "localhost"
MONGODB_PORT = 27017
MONGODB_DATABASE = "datasploit"
13 changes: 13 additions & 0 deletions datasploit/datasploit/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from django.conf.urls import patterns, include, url
from django.contrib import admin

urlpatterns = patterns('',
# Examples:
# url(r'^$', 'datasploit.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),

url(r'^admin/', include(admin.site.urls)),
url(r'^',include('homepage.urls', namespace="homepage")),
url(r'^facebook/',include('facebook.urls', namespace="facebook")),
url(r'^domain/',include('domain.urls', namespace="domain")),
)
14 changes: 14 additions & 0 deletions datasploit/datasploit/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
WSGI config for datasploit project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "datasploit.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Empty file added datasploit/domain/__init__.py
Empty file.
Empty file.
7 changes: 7 additions & 0 deletions datasploit/domain/library/getstats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import sys
import whois

def whoisnew(domain):
whoisdict = {}
w = whois.query(domain)
return w
3 changes: 3 additions & 0 deletions datasploit/domain/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
20 changes: 20 additions & 0 deletions datasploit/domain/templates/domain.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "base.html" %}

{% block content %}
<br>
<div class="row">
<div class="col s12">
<form action="{% url 'domain:search' %}" method="post">
<div class="input-field">
{% csrf_token %}
<input id="search" name="search" type="search" class="form-control">
<label for="search">Search Domain</label>
</div>
</form>
</div>
</div>

{% if request.session.search_activated == "yes" %}
who is info is : {{ whois }}
{% endif %}
{% endblock %}
16 changes: 16 additions & 0 deletions datasploit/domain/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""

from django.test import TestCase


class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
8 changes: 8 additions & 0 deletions datasploit/domain/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
# Examples:
url(r'^$', 'domain.views.module_page' , name='home'),
url(r'^search/', 'domain.views.search' , name='search'),
]
19 changes: 19 additions & 0 deletions datasploit/domain/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from django.shortcuts import render_to_response ,HttpResponse
from django.template import RequestContext
from django.core.context_processors import csrf
import library.getstats as data_import

def module_page(request):
c = {}
c.update(csrf(request))
request.session['search_activated'] = "no"
return render_to_response('domain.html', c ,context_instance=RequestContext(request))

def search(request):
request.session['search_activated'] = "yes"
ip = request.POST.get('search').strip(" ")
whois = data_import.whoisnew(ip)
c = {}
c.update(csrf(request))
c['whois']= whois
return render_to_response('domain.html', c ,context_instance=RequestContext(request))
Empty file added datasploit/facebook/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions datasploit/facebook/library/get_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import requests
import sys
import config as cfg
import clearbit
import json
import time
import hashlib
from bs4 import BeautifulSoup

def facebook_username_osint(username):
req = requests.post('https://api.pipl.com/search/v5/?username=%s&key=sample_key' % (username))
return json.loads(req.content)
3 changes: 3 additions & 0 deletions datasploit/facebook/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
7 changes: 7 additions & 0 deletions datasploit/facebook/templates/facebook.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "base.html" %}

{% block content %}

<br>
<h2> Pending setup</h2>
{% endblock %}
16 changes: 16 additions & 0 deletions datasploit/facebook/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""

from django.test import TestCase


class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
7 changes: 7 additions & 0 deletions datasploit/facebook/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
# Examples:
url(r'^$', 'facebook.views.module_page' , name='home'),
]
8 changes: 8 additions & 0 deletions datasploit/facebook/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.shortcuts import render_to_response ,HttpResponse
from django.template import RequestContext
from django.core.context_processors import csrf

def module_page(request):
c = {}
c.update(csrf(request))
return render_to_response('facebook.html', c ,context_instance=RequestContext(request))
Empty file added datasploit/homepage/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions datasploit/homepage/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
51 changes: 51 additions & 0 deletions datasploit/homepage/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
{% load staticfiles %}
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="padmakar ojha">
<link rel="icon" href="{% static 'images/favicon.ico' %}">
<title>datasploit</title>
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="{% static 'css/materialize.css' %}" media="screen,projection"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/highlight.js/8.6/styles/default.min.css">
<script src="//cdn.jsdelivr.net/highlight.js/8.6/highlight.min.js"></script>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
{% block customjs %}
{% endblock %}

</head>

<body>
<div>
{% block navibar %}
<nav>
<div class="blue-grey darken-3 nav-wrapper">
<a href="/" class="brand-logo right">datasploit</a>
<ul id="nav-mobile" class="left hide-on-med-and-down">
<!-- <li><a href="/">dashboard</a></li> -->
<li><a href="{% url 'domain:home' %}">domain</a></li>
<li><a href="{% url 'facebook:home' %}">facebook</a></li>
</ul>
</div>
</nav>
{% endblock %}
<div id="content">
{% block content %} {% endblock %}
</div>
</div>

<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="{% static 'js/jquery-2.1.1.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/materialize.min.js' %}"></script>
{% block script %} {% endblock %}

</body>
</html>
17 changes: 17 additions & 0 deletions datasploit/homepage/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "base.html" %}

{% block content %}

<br>
<div class="row">
<div class="col s12">
<form action="" method="post">
<div class="input-field">
{% csrf_token %}
<input id="search" name="search" type="search" class="form-control">
<label for="search">search</label>
</div>
</form>
</div>
</div>
{% endblock %}
16 changes: 16 additions & 0 deletions datasploit/homepage/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""

from django.test import TestCase


class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
10 changes: 10 additions & 0 deletions datasploit/homepage/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.conf.urls import patterns, include, url
from django.contrib import admin

urlpatterns = patterns('',
# Examples:
# url(r'^$', 'datasploit.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),

url(r'^$', 'homepage.views.home', name='home'),
)
Loading