File: setup.py

package info (click to toggle)
sslstrip 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 180 kB
  • ctags: 115
  • sloc: python: 560; makefile: 9
file content (53 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import sys, os, shutil
from distutils.core import setup, Extension


setup  (name        = 'sslstrip',
        version     = '0.9',
        description = 'A MITM tool that implements Moxie Marlinspike\'s HTTPS stripping attacks.',
        author = 'Moxie Marlinspike',
        author_email = 'moxie@thoughtcrime.org',
        url = 'http://www.thoughtcrime.org/software/sslstrip/',
        license = 'GPL',
        packages  = ["sslstrip"],
        package_dir = {'sslstrip' : 'sslstrip/'},
        scripts = ['sslstrip.py'],
        data_files = [('share/sslstrip', ['README', 'COPYING', 'lock.ico'])],
       )

print "Cleaning up..."
try:
    removeall("build/")
    os.rmdir("build/")
except:
    pass

try:
    os.remove("sslstrip/sslstrip")
except:
    pass

def capture(cmd):
    return os.popen(cmd).read().strip()

def removeall(path):
	if not os.path.isdir(path):
		return

	files=os.listdir(path)

	for x in files:
		fullpath=os.path.join(path, x)
		if os.path.isfile(fullpath):
			f=os.remove
			rmgeneric(fullpath, f)
		elif os.path.isdir(fullpath):
			removeall(fullpath)
			f=os.rmdir
			rmgeneric(fullpath, f)

def rmgeneric(path, __func__):
	try:
		__func__(path)
	except OSError, (errno, strerror):
		pass