Giter Site home page Giter Site logo

m4n3dw0lf / pythem Goto Github PK

View Code? Open in Web Editor NEW
1.2K 84.0 326.0 23.42 MB

pentest framework

License: GNU General Public License v3.0

Python 99.88% Dockerfile 0.12%
pentest sniffer brute-force man-in-the-middle scanner xss proxy spoof denial-of-service exploit

pythem's Introduction

pythem - Penetration Testing Framework

pythem is a multi-purpose pentest framework written in Python. It has been developed to be used by security researchers and security professionals. The tool intended to be used only for acts within the law. I am not liable for any undue and unlawful act practiced by this tool, for more information, read the license.

Installation

Links:



Linux Installation

Dependencies Installation

NOTE: Tested only with Debian-based distros, feel free to try the dependencies installation with yum or zypper if you use Redhat-like or SUSE-like.

sudo apt-get update
sudo apt-get install -y build-essential python-dev python-pip tcpdump python-capstone \
libnetfilter-queue-dev libffi-dev libssl-dev

Installation

  • With pip:
sudo pip install pythem
  • With source:
git clone https://github.com/m4n3dw0lf/pythem
cd pythem
sudo python setup.py install
  • With source and pip:
git clone https://github.com/m4n3dw0lf/pythem
cd pythem
sudo python setup.py sdist
sudo pip install dist/*

Running

  • Call on a terminal (Requires root privileges):
$ sudo pythem



Running as Docker container

  • Requires Docker
docker run -it --net=host --rm --name pythem m4n3dw0lf/pythem



Usage

Examples

Developing

Commands Reference

Index

Core
Network, Man-in-the-middle and Denial of service (DOS)
Exploit development and Reverse Engineering
Brute Force
Utils

pythem's People

Contributors

aechiara avatar bifrozt avatar bradfora avatar m4n3dw0lf avatar ryd avatar torchhound avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pythem's Issues

POST INSTALLATION ERRORS

Traceback (most recent call last):
File "/usr/local/bin/pythem", line 24, in
from pythem.core.interface import Processor
File "/usr/local/lib/python2.7/dist-packages/pythem/core/interface.py", line 24, in
from scapy.all import *
File "/usr/local/lib/python2.7/dist-packages/scapy/all.py", line 10, in
from .config import *
File "/usr/local/lib/python2.7/dist-packages/scapy/config.py", line 11, in
from .data import *
File "/usr/local/lib/python2.7/dist-packages/scapy/data.py", line 184, in
TCP_SERVICES,UDP_SERVICES=load_services("/etc/services")
File "/usr/local/lib/python2.7/dist-packages/scapy/data.py", line 109, in load_services
f=open(filename, errors='ignore')
TypeError: 'errors' is an invalid keyword argument for this function

Https connection crushed

hello install application with your guide,i am using kali linux 2016 ,script working with http connections ,but with all https connections gives me an error about not secure connection so how to fix this?

Building wheel for NetfilterQueue (setup.py) ... error

python -V
Python 2.7.17rc1

Building wheel for NetfilterQueue (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lbWGaJ/NetfilterQueue/setup.py'"'"'; file='"'"'/tmp/pip-install-lbWGaJ/NetfilterQueue/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-Vjn5wN --python-tag cp27
cwd: /tmp/pip-install-lbWGaJ/NetfilterQueue/
Complete output (13 lines):
running bdist_wheel
running build
running build_ext
skipping 'netfilterqueue.c' Cython extension (up-to-date)
building 'netfilterqueue' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-YpCO3M/python2.7-2.7.17~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c netfilterqueue.c -o build/temp.linux-x86_64-2.7/netfilterqueue.o
netfilterqueue.c:437:10: fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
437 | #include "libnfnetlink/linux_nfnetlink.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

ERROR: Failed building wheel for NetfilterQueue
Running setup.py clean for NetfilterQueue
Building wheel for ropper (setup.py) ... done
Created wheel for ropper: filename=ropper-1.13.3-cp27-none-any.whl size=99384 sha256=115a2b474402228e348e083ae338b2e6e9e6fcaa81aa9e4cf1b4cc90405d0d15
Stored in directory: /root/.cache/pip/wheels/c4/dc/55/8cf3f62cb56823de5798cf3fa827764f0c12586c4f8dbc8633
Building wheel for filebytes (setup.py) ... done
Created wheel for filebytes: filename=filebytes-0.10.0-cp27-none-any.whl size=27505 sha256=ad709b5bb61caf54e670654b4504614c525c97adee2c34eaf008da1052b60fec
Stored in directory: /root/.cache/pip/wheels/a7/aa/71/902f311f6cbb297a66e3701f52ff7422c51eda6cd7152c26a9
Successfully built pythem ropper filebytes
Failed to build NetfilterQueue
Installing collected packages: NetfilterQueue, mechanize, filebytes, ropper, update-checker, pythem
Running setup.py install for NetfilterQueue ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lbWGaJ/NetfilterQueue/setup.py'"'"'; file='"'"'/tmp/pip-install-lbWGaJ/NetfilterQueue/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-1sxRFt/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-lbWGaJ/NetfilterQueue/
Complete output (13 lines):
running install
running build
running build_ext
skipping 'netfilterqueue.c' Cython extension (up-to-date)
building 'netfilterqueue' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-YpCO3M/python2.7-2.7.17~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c netfilterqueue.c -o build/temp.linux-x86_64-2.7/netfilterqueue.o
netfilterqueue.c:437:10: fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
437 | #include "libnfnetlink/linux_nfnetlink.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lbWGaJ/NetfilterQueue/setup.py'"'"'; file='"'"'/tmp/pip-install-lbWGaJ/NetfilterQueue/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-1sxRFt/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

how install to mac os x

how install to mac os x el capitan 10.11.6

build-essential
python-dev
libnetfilter-queue-dev
libffi-dev
libssl-dev
libpcap-dev

thanks

Docker build error

Can't build a docker container from master

Collecting update-checker>=0.11
  Downloading update_checker-0.18.0.tar.gz (6.7 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zjybW6/update-checker/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zjybW6/update-checker/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-zjybW6/update-checker/pip-egg-info
         cwd: /tmp/pip-install-zjybW6/update-checker/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-zjybW6/update-checker/setup.py", line 9
        with open(f"{MODULE_NAME}.py") as fp:
                                    ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
The command '/bin/sh -c pip install dist/*' returned a non-zero code: 1

HSTSBypass

With your hstsbypass module I can't get the hstsbypass module to work well, I sucessfuly setup everything and i get sslstriped on my phone(i was testing) but when i go to a login page, it doesn't get the POST requests, for example, in gmail login page it asks me for email, and when i put my email and click next nothing happens in the page, the page gets stuck, i can't insert my password :/

Tests for module imports

Simple initial tests and docs, example of run:
running: python setup.py test

example of output:

Success:

* Test: pythem/tests/test_module_imports.py
  ✔ Can import <x> class
  ✔ Can import <y> class

Error:

* Test: pythem/tests/test_module_imports.py
  ✔ Can import <x> class
  ✔ Can import <y> class
✖ Test: pythem/tests/test_module_imports.py failed, reason:
Traceback (most recent call last):

help me

" my English . very bad "
hsts by pass on kali linux rolling don't action .
target. not load
thanks a lot

./pythem: command not found

After installing I attempted to launch and received this error-->sudo: ./pythem: command not found.

Any ideas?

installation problem

got this :Rolling back uninstall of Pillow

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-PfICF0/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-bwyzv7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-PfICF0/Pillow/

arpspoof start doesnt't work

Hello,
when i run this command i get this error:
!] Exception caught: invalid syntax (zipp.py, line 217)

Can you help me? thanks

Refactor modules and interface

Need to improve the modules to include help messages and also be executed as a separeted script. One of the goals is to improve the interface and to simplify things, also creating tests for new modules.

Program not executing

root@kali:~/pythem# pythem
Traceback (most recent call last):
File "/usr/local/bin/pythem", line 4, in
import('pkg_resources').run_script('pythem==0.8.2', 'pythem')
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 3112, in
@_call_aside
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 3096, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 3125, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 578, in _build_master
ws.require(requires)
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 895, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 781, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'mechanize>=0.2.5' distribution was not found and is required by pythem

How target all client ?

Hello,
I begin to use pythem and i have a question about target,
I i set
set target 192.168.1.0/24
arpspoof start
I have an error :
Error: couldn't retrieve MAC adress from gateway, retrying...

My question is, how target all client connected on the network ?
Or, its possible to set manualy the MAC adresse ?

thanks,

Don't work to me

I don't know becouse don t work for me i try with facebook with hsts as on your tutorial change the ip with my ip and gateway ecc but doesn't work he don t show email and pass
pythem> set interface wlan0
pythem> set gateway 192.168.0.1
pythem> set target 192.168.0.8
pythem> arpspoof start
[+] Setting the packet forwarding.
[+] Iptables redefined.
[+] ARP spoofing initialized.
pythem> hstsbypass
[_] SSLstrip+ initialized
|by: LeonardoNve && M.Marlinspike
[
] DNS2Proxy initialized
|_by: LeonardoNve
pythem> sniff core
So i try with https://mail.tiscali.it/ but this time he show me just the email without password so now i don't know if i mistake or don't work really for protection .

how save to database

how save to database
ip: src、 desc、mac
http request all header and post data

Hstsbypass issue

Hi,

i'm running kali linux (4.9.0-kali1-686-pae),
i've just installed the PytheM framework on my kali machine, but when i run hstsbypass and sniff http, i get some errors.

I've used these commands:
set interface 'my interface'
set gateway 'my gateway'
set target 'my target'
arpspoof start
hstsbypass
sniff http

I get these errors by almost every package it intercepts:

Exception happened during processing of request from CLIENT: 192.168.1.183 ---> SERVER: 192.168.1.131
('::ffff:192.168.1.183'  FLAGS:PA SEQ:231337601 ACK:3448508470
, 54306
, 0, 0
Load:
)

Traceback (most recent call last):
GET / HTTP/1.1
Host: www.gogle.be
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: nl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Pragma: no-cache
Cache-Control: no-cache

  File "/usr/lib/python2.7/SocketServer.py", line 596, in process_request_thread

-------------------------------------------------------------------------

    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/root/PytheM/modules/sslkill.py", line 100, in __init__
    BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "/root/PytheM/modules/sslkill.py", line 146, in do_GET
    req_body_modified = self.request_handler(req, req_body)
  File "/root/PytheM/modules/sslkill.py", line 311, in request_handler
    proxy = re.findall(pxy_regex, h)
NameError: global name 'pxy_regex' is not defined

When i don't use the 'hstsbypass' module everything just works fine.

Do u have any suggestions?
I've also MIMTf installed on this kali machine which also uses an SSLstrip module, could that be the reason?

I've got all the dependecies & the requirements from the txt file installed.

Thanks in advance!

Command-Line Version For Future Script

Sup! So i'm working on a atomated MITM script and i was going for mitmf but its out-dated and not working so i found your script which is really good but can you do a command line version? Like:

python pythem --arp -i wlan0

You know what i mean so my script can use yours to do atomated attacks?

Lots of love

Exception caught

When trying a dns+arp spoofing attack I get the message "Exception caught: 'str' object has no attribute 'qname'". How do I fix this? I'm using backbox in virtualbox

Tab/Indentation Issue

Have went through the install process only to run $ sudo pythem and get the following error.

[kcseb@archTopBox pythem]$ sudo pythem
File "/usr/bin/pythem", line 33
sys.exit("[-] Only for roots kido! ")
^
TabError: inconsistent use of tabs and spaces in indentation

On Python 3.6.5

My PytheM Error

When i run ./pythem.py appears an error like this
Traceback (most recent call last):
File "./pythem.py", line 24, in
from core.interface import Processor
File "/root/PytheM/core/interface.py", line 24, in
from scapy.all import *
ImportError: No module named scapy.all

and i try to type this commands on PytheM folder
root@mrmoonz:~/PytheM# pip install -r requirements.txt
appears error like this :

Failed building wheel for cryptography
Running setup.py clean for cryptography
Failed to build cryptography
and this on last appears.
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-IFN1tJ/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-qjZPe7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-IFN1tJ/cryptography/

WHY ??? Help me please !!!

Suggest adding 3 new features

Hello. I'm interested in adding 3 new features to this software.

  • Whois lookup function,
  • Shodan,
  • SSL certification scanner

I think if have gathering information that it can be more convenient.
no need to find a web site for gathering information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.