Commit 3c49110a authored by Devon Kearns's avatar Devon Kearns

Imported Upstream version 1.3a

parents
James Greig
James@mor-pah.net
http://www.mor-pah.net
This diff is collapsed.
=========================================================================
Document Purpose
=========================================================================
This Document describes how-to build and install DMitry on a system.
=========================================================================
Typographical conventions
=========================================================================
Command lines written as
# command
should be executed as the superuser.
Command lines written as
% command
should be executed as an unpriveleged user.
=========================================================================
Build Requirements
=========================================================================
o ANSI/ISO C89/C90 C compiler, e.g GNU gcc
o ANSI C
o Disk space: 638k to unpack, 928k to build, 57k to install
=========================================================================
Installing
=========================================================================
1. Configure DMitry
Run ./configure from the top-level directory, this will configure
DMitry for your operating system. See ./configure --help for any
user/system specific options you may wish to set.
% ./configure
2. Compile DMitry
Run 'make' from the top-level directory. With some systems you may
need to use 'gmake' or even 'gnumake' instead of the default system
make.
% make
The above procedure will suit an unpriveleged user to simply run
the application from their home directory (See Running below).
3. Test DMitry
To simply test that the software compiled correctly, the following
command is used.
% ./dmitry
The program should then run and display available options.
4. Install DMitry
If you are a system administrator and wish to allow yourself and
unpriveleged users to use DMitry, then the following instructions
can be used to achieve this.
Run 'make install' from the top-level directory. This will install the binary
'dmitry' into /usr/local/bin/.
# make install
=========================================================================
Running
=========================================================================
If you followed steps 1 through 3 DMitry is assumed to be installed
in /usr/local/bin. The client can now be run from the command line
simply by using the command dmitry.
# dmitry
To run dmitry with any available options simply specify them along with
the target domain you wish to gather relational information for, i.e.
# dmitry -iwnso somedomain.net
This will display information related to the domain "somedomain.net"
outputting the information to stdout and also save the output to a text
file named "somedomain.net.txt".
=========================================================================
Troubleshooting & Suggestions
=========================================================================
Currently there is no FAQ for the program, however, if you have any
suggestions or require any technical help or find a bug, please email me
at james@mor-pah.net.
James (kernel)
bin_PROGRAMS = dmitry
dmitry_SOURCES = src/output.c src/iwhois.c src/tcp_sock.c src/netcraft.c \
src/dmitry.c src/file.c src/nwhois.c src/portscan.c \
src/port_sock.c src/resolve.c src/subsearch.c src/mailsearch.c
man1_MANS = docs/dmitry.1
This diff is collapsed.
=========================================================================
Intro
=========================================================================
DMitry (Deepmagic Information Gathering Tool)
Conceptual design result of deepmagic brainstorimg session.
Coded by kernel.
Downloadable @ http://www.mor-pah.net
As featured in "Gray Hat Hacking : The Ethical Hacker's Handbook".
=========================================================================
Greetz
=========================================================================
Greetz to... phased, di0aD, wh1sky, high_towe, big dave,
mister pand0r, phool312, remedy, number5 and anyone
i've missed!
"There be some deep magic going on"
=========================================================================
Contents
=========================================================================
1. Version Information
2. What is DMitry?
3. Fixes
4. TO DO
5. Feature Status
6. Usage: Command Line Functionality
7. Contact
see INSTALL text file for installation help.
=========================================================================
1. VERSION
=========================================================================
DMitry
Version "1.3a"
=========================================================================
2. What is DMitry?
=========================================================================
DMitry (Deepmagic Information Gathering Tool) is a
UNIX/(GNU)Linux Command Line program coded purely in C
with the ability to gather as much information as possible
about a host.
DMitry has a base functionality with the ability to add
new functions. Basic functionality of DMitry allows for
information to be gathered about a target host from a sim-
ple whois lookup on the target to UpTime reports and TCP
portscans.
The application is considered a tool to assist in informa-
tion gathering when information is required quickly by
removing the need to enter multiple commands and the
timely process of searching through data from multiple
sources.
To get straight into DMitry without reading this document,
you can initially type "dmitry target", this will perform
the majority of functions on the target.
=========================================================================
3. Fixes
=========================================================================
Version 1.3a:
A Qucik release to address two malloc issues with mailsearch
and subsearch. Found that increasing the initalizing size to
two rows instead of one resolved this issue. Seems to only
appear in newer versions of *BSD. I.e FreeBSD 6.
Version 1.3:
Just a quick release to fix the netcraft function output
Also fixed the command line typo to include -e
Removed the dmitrybot, it will bo longer be available
Version 1.2a:
Remodeled the InetWhois function entirely:
Now much more reliable and reports errors correctly where possible
Remodeled the InicWhois function entirely:
This now allows for most TopLevelDomains from .fr to .uk, .us etc.
Output is now sent directly to stdout for the two whois functions
There is no longer output concerning DMitry jumping from one
server to another. Instead DMitry will use just one server unless there
is a referral whois server. This function now no longer uses fpurge() or
__fpurge().
Remodeled the Sub Domain Search function, there are no longer any *alloc()
problems.
Remodeled the host resolve function, and fixed a bug which caused a dump
when an IP address was entered that wouldn't resolve to a hostname.
Version 1.2:
The portscan feature of DMitry isn't so great, gave it a bit of a revamp.
Fixed the command line problems with optarg[] the ttl option now works.
Added whois.opensrs.net to the whois list.
Ability to continue if the resolve fails at the start.
Portscan showing filtered ports is no longer a default.
Netcraft OS information is now less dependent on the netcraft output.
Version 1.1:
DMitry is now fully portable to most common GNU/LINUX distributions and
to all BSD distributions.
Re-made the Subdomain Search module fixing quite a few search string bugs
along with fixing a malloc() problem with some linux distros.
Added a quick feature to allow for a search of www.host if host alone fails
(will add an option to skip resolve in a later release)
Modified google.com query string from %22host%22 ("host") to %2Bhost (+host)
Modified google.com format string to locate bold <b> strings also
Fixed .uk whois bug => reg.nic.uk => whois.nic.uk
=========================================================================
4. TO DO:
=========================================================================
---
Add more functionality
---
---
Add ability to easily add custom made functions
---
---
Ensure stability
---
---
Bug check entire program
---
=========================================================================
5. Feature Status
=========================================================================
Fully Working Functions:
-o Save output to %host.txt or to file specified by -o file
-i Perform a whois lookup on the IP address of a host
-w Perform a whois lookup on the domain name of a host
-n Retrieve Netcraft.com information on a host
-s Perform a search for possible subdomains
-e Perform a search for possible email addresses
-p Perform a TCP port scan on a host
* -f Perform a TCP port scan on a host showing output reporting filtered ports
* -b Read in the banner received from the scanned port
* -t 0-9 Set the TTL in seconds when scanning a TCP port ( Default 2 )
Example: dmitry -iwnp -t 7 host.net
Functions:
get_host()
get_netcraft()
get_nwhois()
get_iwhois()
get_subdomains()
get_emails()
portscan()
=========================================================================
6. Usage: Command Line Functionality
=========================================================================
Check the man page for dmitry for an indepth manual on using DMitry
and its functionality. (This requires DMitry to be installed, make install).
% man dmitry
Once fully installed or localy installed the program can simply be
executed by the following:
% ./dmitry
The command above alone will list all the possible options that can be
passed to it along with a brief explanation.
To execute the program with the default functionality you can simply
pass just the hostname to the program as below:
% ./dmitry example-host.com
This will run all the functions with their default settings and will print
to the standard output aswell as saving the results to "./example-host.com.txt"
=========================================================================
7. Contact
=========================================================================
Please contact me with any thoughts or suggestions, Bugs and queries etc.
James@mor-pah.net
James Greig (kernel)
url:http://www.mor-pah.net
kernel-- on undernet.org
This diff is collapsed.
aclocal \
&& automake --add-missing --copy \
&& autoconf
rm -rf .deps
rm -rf Makefile
rm -rf config.status
rm -rf config.log
rm -rf autom4te.cache
rm -rf config.h
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2004-10-12.08
# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# 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 2, 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit 0
;;
-v | --v*)
echo "compile $scriptversion"
exit 0
;;
esac
ofile=
cfile=
eat=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
This diff is collapsed.
AC_PREREQ(2.59)
VERSION="1.2a"
PACKAGE=DMitry
ADDRESS=james@mor-pah.net
AC_INIT
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AM_SANITY_CHECK
AC_CONFIG_SRCDIR([src/includes/tcp_sock.h])
AC_CONFIG_HEADER([src/includes/config.h])
AC_PROG_CC
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
AC_HEADER_TIME
AC_STRUCT_TM
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([alarm gethostbyaddr gethostbyname memset socket strstr])
AC_CHECK_HEADER([getopt.h], [AC_DEFINE([HAVE_GETOPT_H], 1, [Description])])
AC_CHECK_FUNC([sigsetjmp], [AC_DEFINE([HAVE_SIGSETJMP_F], 1, [Description])])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
This diff is collapsed.
This diff is collapsed.
.TH DMitry 1 "March 2006" "1.3a"
.SH NAME
DMitry - Deepmagic Information Gathering Tool
.SH SYNOPSIS
.B dmitry
[Options] host
.br
.SH DESCRIPTION
DMitry (Deepmagic Information Gathering Tool) is a UNIX/(GNU)Linux Command
Line program coded purely in C with the ability to gather as much information
as possible about a host.
DMitry has a base functionality with the ability to add new functions.
Basic functionality of DMitry allows for information to be gathered about a
target host from a simple whois lookup on the target to UpTime reports and TCP portscans.
The application is considered a tool to assist in information gathering when
information is required quickly by removing the need to enter multiple commands
and the timely process of searching through data from multiple sources.
To get straight into DMitry without reading this document, you can initially
type "dmitry target", this will perform the majority of functions on the target.
.SH OPTIONS
Options should be passed to DMitry in the form of '-option'.
Only options known by DMitry will be used and others will be ignored.
If options are not passed as a group block, the trailing options will be considered a host target.
.TP
.B -o filename
Create an ascii text output of the results to the "filename" specified. If no output filename is specified
then output will be saved to "target.txt". If this option is not specified in any form output will be sent to
the standard output (STDOUT) by default. This option MUST trail all other options, i.e. "./dmitry -winseo target".
.TP
.B -i
Perform an Internet Number whois lookup on the target. This requires that the target be in the form of a 4 part Internet Number
with each octal seperated using the `.' notation. For example, "./dmitry -i 255.255.255.255".
.TP
.B -w
Perform a whois lookup on the 'host' target. This requires that the target be in a named character format.
For example, "./dmitry -w target" will perform a standard named whois lookup.
.TP
.B -n
Retrieve netcraft.com data concerning the host, this includes Operating System, Web Server release and UpTime information
where available.
.TP
.B -s
Perform a SubDomain search on the specified target. This will use serveral search engines to attempt to locate sub-domains
in the form of sub.target. There is no set limit to the level of sub-domain that can be located, however, there is a maximum
string length of 40 characters (NCOL 40) to limit memory usage. Possible subdomains are then reversed to an IP address, if
this comes back positive then the resulting subdomain is listed. However, if the host uses an asterisk in their DNS records
all resolve subdomains will come back positive.
.TP
.B -e
Perform an EmailAddress search on the specified target. This modules works using the same concept as the SubDomain search by
attempting to locate possible e-mail addresses for a target host. The e-mail addresses may also be for possible sub-domains of
the target host. There is a limit to the length of the e-mail address set to 50 characters (NCOL 50) to limit memory usage.
.TP
.B -p
Perform a TCP Portscan on the host target. This is a pretty basic module at the moment, and we do advise users to use something
like nmap (www.insecure.org/nmap/) instead. This module will list open, closed and filtered ports within a specific range.
There will probably be little advancement upon this module, though there will be some alterations to make it a little more user
friendly. There are also other options for this module that can affect the scan and its relative output.
.TP
.B -f
This option will cause the TCP Portscan module to report/display output of filtered ports. These are usually ports that have been
filtered and/or closed by a firewall at the specified host/target. This option requires that the '-p' option be passed as a previous option.
For example, "./dmitry -pf target".
.TP
.B -b
This option will cause the TCP Portscan module to output Banners if they are received when scanning TCP Ports. This option requres
that the '-p' option be passed as a previous option. For example, "./dmitry -pb target".
.TP
.B -t
This sets the Time To Live (TTL) of the Portscan module when scanning individual ports. This is set to 2 seconds by default.
This is usually required when scanning a host that has a firewall and/or has filtered ports which can slow a scan down.
.SH EXAMPLES
This section presents some example queries that can be made using dmitry. The hosts and targets used in the examples
are merely used for demonstration.
.B dmitry -w example-host.com
This will perform a named whois (INIC-WHOIS) lookup on the target host, displaying results to the standard output (STDOUT).
.B dmitry -winsepo sometextfile.txt example-host.com
This will perform all the basic functions on the target host and store all the output into "sometextfile.txt".
.B dmitry -winsepo example-host.com
This will perform all the basic functions on the target host and store all the output into "example-host.com.txt".
.B dmitry -winsepfbo 127.0.0.1
This will perform all the basic functions on the target host and store all the output into "127.0.0.1.txt". This
will also display banners and show filtered ports.
.SH BUGS
Bugs? if you find any e-mail me at james@mor-pah.net with information your OS, what caused the problem, the error, suggestions etc.
Thanx
.SH DISTRIBUTION
DMitry, Deepmagic Information Gathering Tool is Copyright (C) 2001 - 2005 by James Greig.
Source code is provided with this software to allow users and developers to understand the software for security auditing purposes.
We allow users to view the source code so that they are able to port the software to different Operating Systems with the ability to locate bugs and so forth.
.SH AUTHOR
.B Programmer/Creator
.br
James Greig - James@mor-pah.net - http://www.mor-pah.net
.br
.br
.B Conceptual Design
.br
Phased - http://www.deepmagic.org.uk
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2004-10-22.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit 0;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;