Affichage des articles dont le libellé est Python. Afficher tous les articles
Affichage des articles dont le libellé est Python. Afficher tous les articles

PytheM - Python penetration testing framework

PytheM is a python penetration testing framework. It has been developed in the hope that it will be useful and I don't take responsibility for any misapplication of it. Only runs on GNU/Linux OS.


Installation


  • $sudo apt-get update
  • $sudo apt-get install libasound-dev libjack-jackd2-dev portaudio19-dev python-pyaudio build-essential python-dev libnetfilter-queue-dev libespeak1 libffi-dev libssl-dev
  • $sudo git clone https://github.com/m4n3dw0lf/PytheM/
  • $cd PytheM
  • $sudo pip install -r requirements.txt
  • Now you are ready to rock:
  • $sudo ./pythem

Examples

ARP spoofing - Man-in-the-middle HTTP

  pythem> set interface
[+] Enter the interface: wlan0
pythem> set gateway
[+] Enter the gateway: 192.168.1.1
pythem> arpspoof start
[+] Setting the packet forwarding.
[+] Iptables redefined.
[+] ARP spoofing initialized.
pythem> sniff
[+] Enter the filter: http

Overthrow the DNS of LAN range/IP address

It can be quite useful overthrow the DNS to force the administrator to connect with his credentials to the HTTP server of the router to check what's happening while the sniffer 80 is running kk.
pythem> set interface wlan0
pythem> set gateway 192.168.1.1
pythem> arpspoof start
[*] Iptables redefined
[*] Setting the packet forwarding.
[+] ARP spoofing initialized.
pythem> dos mitmdrop
[+] Man-in-the-middle DNS drop initialized.
pythem> sniff http
Download and read more at:

~ samedi 30 juillet 2016 0 commentaires

Commix: Command Injection Exploiter

Commix a short form for Command Injection Exploiter is an environment that web developers, penetration testers and even security researchers can use to test web applications in order to find bugs or vulnerabilities.

Commix is written in python programming language. That helps to find vulnerabilities related to command injection attacks. In Command injection attack the goal is to execute arbitrary commands on the host operating system via a vulnerable application. These attacks are possible when an application passes unsafe user supplied data (forms, cookies, HTTP headers etc.) to a system shell.



The arbitrary commands will be executed on successful command injection attack through vulnerable application. The features available in Commix include a set of options for specifying which parameters should be injected and to append the injection payloads. User can also define data in POST request as well as employ injection payload suffix and prefix string to exploit the target.

Moreover, it supports base64 encoding for multiple injection techniques (eval-based, time based or file based).

Requirements 

Python version 2.6.x or 2.7.x is required for running this program.

Supported Platform

Linux
Mac OS X
Windows (Experimental)

Installation 

Download commix by cloning the Git repository:

git clone https://github.com/stasinopoulos/commix.git commix

Commix comes packaged on the official repositories of the following Linux distributions:

ArchAssault
BlackArch
Kali Linux
BackBox
Weakerthan

Commix also comes pre-installed, on the following penetration testing frameworks:

The Penetration Testers Framework (PTF)
CTF-Tools
PentestBox
PenBox
Katoolin

Usage

To get a list of all options and switches use:

python commix.py -h

So, do you want to get some ideas on how to use commix? Have a quick look of all available options and switches here.




~ lundi 18 juillet 2016 0 commentaires

Become a PRO Hacker – Python for Hackers

Python, the known scripting language has already changed the cyber landscape. Hackers are using Python as a weapon to hack into the servers and other electronic devices. To fight against the black hat hackers, the good guys have to take this weapon as well. Infosec professionals are now using python during the pentesting process, it is an effective way to test the overall security of a network / web application.

The simple phenomena say, writing your own scripts is more effective than using the standard expensive hacking tools. The bundle course introduces by EH Academy teaches the same, it says “Hack Like a PRO using Python”. This training program is a bundle of two known trainings:
  •          Android hacking using Python
  •          Python for Offensive penetration testing

And, luckily the academy has announced discount for the new users. The enrollment can be taken place by just paying $39 (original price is $139).

Coupon code: HLPP39T


Learn python, learn to write your own scripts in the difficult situations because tools are designed / created to solve a particular situation that faces the known issues. But, hacking tools fail whenever it has to face a challenge. Some important things to learn that the discussed course teaches:

·         Coding reverse TCP shell on Python
·         Create Anti-virus free keylogger using python
·         Password phishing – DNS poisoning
·         Facrbook password phishing
·         Backdooring legitimate windows services
·         Bypassing IPS and hand-made XOR encryption
·         Bypass reputation filtering in next generation firewalls
·         Building a botnet
·         Decoding whatsapp messages (contacts, calls, phone logs and etc.)
·         Build a semi Android shell
·         Build reverse SSH tunnel
·         And many more….

Get the weapon of python in fighting the cyber war; it is not coming, but it is already here. Enhancing the skills and learning the new language always help to defend the computer system; it also helps to strengthen the overall security before the bad guys attack.


Get ready for the future.

~ mercredi 13 juillet 2016 0 commentaires

Python based Windows backdoor with Gmail as C&C

Gdog is a stealthy Python based Windows backdoor that uses Gmail as a command and control server

Requirements

  • Python 2.x
  • PyCrypto module
  • WMI module
  • Enum34 module
  • Netifaces module

Features

  • Encrypted transportation messages (AES) + SHA256 hashing
  • Generate computer unique id using system information/characteristics (SHA256 hash)
  • Job IDs are random SHA256 hashes
  • Retrieve system information
  • Retrieve Geolocation information (City, Country, lat, long, etc..)
  • Retrieve running processes/system services/system users/devices (hardware)
  • Retrieve list of clients
  • Execute system command
  • Download files from client
  • Upload files to client
  • Execute shellcode
  • Take screenshot
  • Lock client's screen
  • Keylogger
  • Lock remote computer's screen
  • Shutdown/Restart remote computer
  • Log off current user
  • Download file from the WEB
  • Visit website
  • Show message box to user

Setup

For this to work you need:
  • A Gmail account (Use a dedicated account! Do not use your personal one!)
  • Turn on "Allow less secure apps" under the security settings of the account.
  • You may also have to enable IMAP in the account settings.

Download/Installation

Contents

  • gdog.py a script that's used to enumerate and issue commands to available clients
  • client.py the actual backdoor to deploy

~ samedi 14 mai 2016 0 commentaires

PEinjector - MITM Portable Executable (PE) File Infector



PEinjector - MITM Portable Executable (PE) File Infector

The executable file format on the Windows platform is PE COFF. The peinjector provides different ways to infect these files with custom payloads without changing the original functionality. 

It creates patches, which are then applied seamlessly during file transfer. It is very performant, lightweight, modular and can be operated on embedded hardware.

Features


  • Full x86 and x64 PE file support.
  • Open Source
  • Fully working on Windows and Linux, including automated installation scripts.
  • Can be operated on embedded hardware, tested on a Rasperberry Pi 2.
  • On Linux, all servers will be automatically integrated as service, no manual configuration required.
  • Plain C, no external libraries required (peinjector).
  • MITM integration is available in C, Python and Java. A sample Python MITM implementation is included.
  • Foolproof, mobile-ready web interface. Anyone who can configure a home router can configure the injector server.
  • Easy to use integrated shellcode factory, including reverse shells, meterpreter, ... or own shellcode. Everything is available in 32 and 64 bit with optional automated encryption. Custom shellcode can be injected directly or as a new thread.


peinjector
Provides PE file patching as a service. Just send the raw header of your PE file and you’ll receive a custom-made patch for it. Can be remotely controlled via a command protocol.

peinjector-control
Web interface to configure and control a peinjector server. A small shellcode factory with some basic shellcodes, automatic encryptoin/obfuscation and thread generation is provided - alternatively, custom shellcode can be injected.

peinjector-interceptor
Sample MITM integration. Based on Python and libmproxy, supports SSL interception, can act as transparent Proxy, HTTP Proxy, ... . Provides seamless PE patching capabilities.



~ lundi 21 septembre 2015 0 commentaires

PortDog: Port Scanning Tool In Python


PortDog: Port Scanning Tool In Python

PortDog is a network anomaly detector aimed to detect port scanning techniques. It is entirely written in python and has easy-to-use interface. 

It was tested on Ubuntu 15. Please note that, it is not working on Windows OS due to suffering from capturing RAW packets.I am working on to write this script to work both platforms. In future , I'm thinking about adding firewall options that could block malicious attempts. It is using Raw packets for analysis. For this reason, please ensure that you have run this script from privileged session.


Usage:

sudo python portdog.py -t time_for_sniff_in_minutes

For example, if you want to detect for 5 minutes use:

sudo python portdog.py -t 5

For infinite detection use:

sudo python portdog.py -t 0

If you want to get list of scanned ports , press CTRL+C to get port list at runtime (If scan was happened).



~ vendredi 14 août 2015 0 commentaires

Router Exploitation Toolkit - REXT


Router Exploitation Toolkit - REXT
Small toolkit for easy creation and usage of various python scripts that work with embedded devices.


  • core - contains most of toolkits basic functions
  • databases - contains databases, like default credentials etc.
  • interface - contains code that is being used for the creation and manipulation with interface
  • modules - contains structure of modules, that can be loaded, every module contains vendor specific sub-modules where scripts are stored.
  1. decryptors
  2. exploits
  3. harvesters
  4. misc
  5. scanners
  • output - output goes here
  • This is still heavy work-in progress


Requirements
Trying to keep the requirements minimal:

httplib2

License
This software is licensed under GNU GPL v3.

Download

~ mercredi 3 juin 2015 0 commentaires

The PenTesters Framework (PTF) Written In Python by TrustedSec






The PenTesters Framework (PTF) Written In Python by TrustedSec.

The PenTesters Framework (PTF) is a Python script designed for Debian/Ubuntu based distributions to create a similar and familiar distribution for Penetration Testing.

As pentesters, we've been accustom to the /pentest/ directories or our own tool sets that we want to keep up-to-date all of the time. We have those "go to" tools that we use on a regular basis, and using the latest and greatest is important.

PTF attempts to install all of your penetration testing tools (latest and greatest), compile them, build them, and make it so that you can install/update your distribution on any machine. Everything is organized in a fashion that is cohesive to the Penetration Testing Execution Standard (PTES) and eliminates a lot of things that are hardly used.

PTF simplifies installation and packaging and creates an entire pentest framework for you. Since this is a framework, you can configure and add as you see fit. We commonly see internally developed repos that you can use as well as part of this framework. It's all up to you.

The ultimate goal is for community support on this project. We want new tools added to the github repository. Submit your modules. It's super simple to configure and add them and only takes a few minute.

Instructions:
First check out the config/ptf.config file which contains the base location of where to install everything. By default this will install in the /pentest directory. Once you have that configured, move to running PTF by typing ./ptf (or python ptf).

This will put you in a Metasploitesk type shell which has a similar look and feel for consistency. Show modules, use , etc. are all accepted commands. First things first, always type help or ? to see a full list of commands.

Update EVERYTHING!

If you want to install and/or update everything, simply do the following:

./ptf

use modules/install_update_all

run

This will install all of the tools inside of PTF. If they are already installed, this will iterate through and update everything for you automatically.

You can also show options to change information about the modules.

Modules:
First, head over to the modules/ directory, inside of there are sub directories based on the Penetration Testing Execution Standard (PTES) phases. Go into those phases and look at the different modules. As soon as you add a new one, for example testing.py, it will automatically be imported next time you launch PTF. There are a few key components when looking at a module that must be completed.

Below is a sample module

AUTHOR="David Kennedy (ReL1K)"

DESCRIPTION="This module will install/update the Browser Exploitation Framework (BeEF)"

INSTALL_TYPE="GIT"

REPOSITORY_LOCATION="https://github.com/beefproject/beef"

INSTALL_LOCATION="beef"

DEBIAN="ruby1.9.3,sqlite3,ruby-sqlite3"

AFTER_COMMANDS="cd {INSTALL_LOCATION},ruby install-beef,exit"


Module Development:

All of the fields are pretty easy, on the repository locations, right now all thats supported is GIT. The plan in the next release is to expand to file downloader. This can still be accomplished through after commands (explained later). Fill in the depends, and where you want the install location to be. PTF will take where the python file is located (for example exploitation) and move it to what you specify in the PTF config (located under config). By default it installs all your tools to /pentest//

Note in modules, you can specify after commands {INSTALL_LOCATION}. This will append where you want the install location to go when using after commands.

After Commands:

After commands are commands that you can insert after an installation. This could be switching to a directory and kicking off additional commands to finish the installation. For example in the BEEF scenario, you need to run ruby install-beef afterwards. Below is an example of after commands using the {INSTALL_LOCATION} flag.

AFTER_COMMANDS="cp config/dict/rockyou.txt {INSTALL_LOCATION}"

For AFTER_COMMANDS that do self install (don't need user interaction) - place an exit after your commands so it exits the shell.

TODO:
Add ability to support SVN, and FILE download.
Support other operating systems aside from Kali, Ubuntu, Debian

A TrustedSec Project - Copyright 2015

Written by: David Kennedy (@HackingDave)

Website: https://www.trustedsec.com

Download

~ jeudi 28 mai 2015 0 commentaires

[GUIDE] How to fix "Importerror : no module named pexpect"


How to fix?

     1.Simple! Just go to the Official download site
     2.Download and extract
     3.Open your command prompt
     4.cd into the extracted folder
     5.Type in, 
python setup.py install
     or
C:\python27\python.exe setup.py install
     6. Wait for it's process, and there you go! :)

~ dimanche 2 novembre 2014 0 commentaires

[GUIDE] How to install Weevely on Windows


Weevely v1.1
Weevely is a stealth PHP web shell that provides a telnet or netcat type console and let you execute command remotely. It is an essential tool for web application post exploitation, and can be used as stealth backdoor or as a web shell to manage legit web accounts, even free hosted ones. It is a built-in tool in backtrack 5 and easy to install and use in linux but in this tutorial i will show you how to use this tool on Windows Platform.

 How to install?
1- Download python interpreter tool which will make your computer capable of running Python script.I m using python2.7.5 on machine, so i would recommend you to use python2.7.5 too.If you have other version then its fine too. Download python windows installer from following url and install it on your windows machine. Download

2- Download weevely from following url.Extract it and enter in its folder through cmd and try to execute this by writing "weevely.py" on command prompt, you will get an error.So lets fix this error and make this work on windows. Download

3- Now download python setuptools from following url and extract it. Download
4- Now press "WINDOWS Button + R" , it will open windows run box for you.There type cmd and press enter.Windows cmd will open before you.
5- Now use cd command to enter to your setup-tools directory i.e.
cd setuptools-0.9.8

6- Now run this command:
setup.py install
Note: sometimes after python interpreter installation, windows do not integrate your .py files with python interpreter.So in such scenario, you can give path of python interpreter to execute setup.py file and upper command will be modified like this

C:\Python27\python.exe setup.py install 
7-  It will install python setup-tools for and a directory named "Script" will be created in your python installation directory.For default installation path, this is newly created directory C:\Python27\Scripts.

8-  Now enter in "C:\Python27\Scripts" directory and run easy_install.exe to install pip.As i did below.
cd C:\Python27\Scripts
easy_install.exe pip
 9- Now inside the same directory, install these two pyreadline and pyyaml libraries with pip
pip install pyreadline pyyaml
 10- Now everything is ready, just enter in weevely directory and execute it
weevely.py

SOURCE:  exploiterz.blogspot.com

~ jeudi 23 octobre 2014 0 commentaires

ANSI Color Codes


There are 16 ANSI Colors, which are actually 8 colors, each having "normal" and "bright" intensity variants. The colors are black, red, green, yellow, blue, magenta, cyan, and white. In certain circumstances bright intensity could be actually brighter, or, in the case of an xterm, it could be bold.



~ mardi 25 février 2014 0 commentaires