Skip to content

Commit f7f4842

Browse files
committed
Added the beginnings of the changes needed for the setup.py to work.
Changed around the directory structure to have the files a part of the VHostScan package so it could be used for pkg_resources. Also changed the DEFAULT_WORDLIST_FILE to use pkg_resources instead of __file__. Also changed some of the imports so they are using relative imports instead of the full path. This appears to work with atleast the -t flag, however, more testing should be done and the tests that already exist should be able to run when running `python setup.py test`
1 parent e5e813f commit f7f4842

26 files changed

+51
-27
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
recursive-include VHostScan *.txt

VHostScan.py renamed to VHostScan/VHostScan.py

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
#!/usr/bin/python
22

3-
import os
43
import sys
54
import dns.resolver
65
from argparse import ArgumentParser
76
from socket import gethostbyaddr
8-
from lib.core.virtual_host_scanner import *
9-
from lib.helpers.output_helper import *
10-
from lib.helpers.file_helper import load_random_user_agents
11-
from lib.helpers.wordlist_helper import WordList
12-
from lib.core.__version__ import __version__
13-
from lib.input import cli_argument_parser
14-
15-
DEFAULT_WORDLIST_FILE = os.path.join(
16-
os.path.dirname(os.path.abspath(__file__)),
17-
'wordlists',
18-
'virtual-host-scanning.txt'
19-
)
7+
from pkg_resources import resource_filename
8+
from .lib.core.virtual_host_scanner import *
9+
from .lib.helpers.output_helper import *
10+
from .lib.helpers.file_helper import load_random_user_agents
11+
from .lib.helpers.wordlist_helper import WordList
12+
from .lib.core.__version__ import __version__
13+
from .lib.input import cli_argument_parser
14+
15+
DEFAULT_WORDLIST_FILE = resource_filename(
16+
'VHostScan', 'wordlists/virtual-host-scanning.txt')
2017

2118

2219
def print_banner():
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/core/virtual_host_scanner.py renamed to VHostScan/lib/core/virtual_host_scanner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import hashlib
66
import pandas as pd
77
import time
8-
from lib.core.discovered_host import *
8+
from .discovered_host import *
99

1010
import urllib3
1111
urllib3.disable_warnings()
File renamed without changes.
File renamed without changes.

lib/helpers/output_helper.py renamed to VHostScan/lib/helpers/output_helper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from lib.core.discovered_host import *
2-
from lib.helpers.file_helper import *
1+
from ..core.discovered_host import *
2+
from .file_helper import *
33
import time
44
from fuzzywuzzy import fuzz
55
import itertools

lib/helpers/wordlist_helper.py renamed to VHostScan/lib/helpers/wordlist_helper.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import sys
2-
import os
3-
from lib.helpers.file_helper import get_combined_word_lists
4-
5-
DEFAULT_WORDLIST_FILE = os.path.join(
6-
os.path.dirname(os.path.abspath(__file__)),
7-
'../..',
8-
'wordlists',
9-
'virtual-host-scanning.txt'
10-
)
2+
from .file_helper import get_combined_word_lists
3+
from pkg_resources import resource_filename
4+
5+
6+
DEFAULT_WORDLIST_FILE = resource_filename(
7+
'VHostScan', 'wordlists/virtual-host-scanning.txt')
118

129

1310
class WordList:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

VHostScan/tests/helpers/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

setup.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from setuptools import find_packages, setup
2+
from VHostScan.lib.core.__version__ import __version__
3+
4+
5+
def dependencies(file):
6+
with open(file) as f:
7+
return f.read().splitlines()
8+
9+
10+
with open("README.md") as f:
11+
setup(
12+
name="VHostScan",
13+
license="GPLv3",
14+
description="A virtual host scanner that performs reverse lookups, "
15+
"can be used with pivot tools, detect catch-all"
16+
"scenarios, aliases and dynamic default pages.",
17+
long_description=f.read(),
18+
author="codingo",
19+
version=__version__,
20+
author_email="[email protected]",
21+
url="http://github.com/codingo/VHostScan",
22+
packages=find_packages(exclude=('tests')),
23+
package_data={'VHostScan': ['*.txt']},
24+
entry_points={
25+
'console_scripts': [
26+
'vhostscan = VHostScan.VHostScan:main'
27+
]
28+
},
29+
install_requires=dependencies('requirements.txt'),
30+
tests_require=dependencies('test-requirements.txt'),
31+
include_package_data=True)

test-requirements.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
-r requirements.txt
2-
31
pytest==3.2.3
42
pytest-mock==1.6.3
53
pep8==1.7.0

0 commit comments

Comments
 (0)