Coder Social home page Coder Social logo

ptf's Introduction

The PenTesters Framework (PTF)

A TrustedSec Project - Copyright 2022

Written by: David Kennedy (@HackingDave)

https://www.trustedsec.com

Twitter: @TrustedSec, @HackingDave

The PenTesters Framework (PTF) is a Python script designed for Debian/Ubuntu/ArchLinux 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 toolsets 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.

Installation

PTF requires python-pexpect in order to work appropriately.

Run the following command below:

pip install -r requirements.txt
./ptf

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 Metasploitesque type shell which has a similar look and feel for consistency. Show modules, use <modules>, etc. are all accepted commands. First things first, always type help or ? to see a full list of commands.

For a video tutorial on how to use PTF, check out our Vimeo page here: https://vimeo.com/137133837

Update EVERYTHING!

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

./ptf
use modules/install_update_all
yes

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 individually install each module, then use the use modules/update_installed which will only update what you've previously installed.

For example:

./ptf
use modules/update_installed

This will only update previous ones you've installed.

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

If you only want to install only for example exploitation tools, you can run:

./ptf
use modules/exploitation/install_update_all

This will only install the exploitation modules. You can do this for any module category.

Customize your own installed tools

You can install only the tools you want to by going to the modules/custom_list/list.txt section. Modify the list.txt file and add the tools you only want to install or update.

Example list.txt file:

modules/exploitation/metasploit modules/post-exploitation/unicorn

Then when in PTF:

./ptf
use modules/custom_list/list
yes

This allows you to carry your module configuration over and only install the tools that you want and keep them updated.

You can also simply specify a module without using the category:

./ptf
use trevorc2
yes

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"

X64_LOCATION="https://github.com/something_thats_x64_instead_of_x86

INSTALL_LOCATION="beef"

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

ARCHLINUX = "arch-module,etc"

BYPASS_UPDATE="NO"

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

LAUNCHER="beef"

TOOL_DEPEND="modules/exploitation/metasploit"

Module Development:

All of the fields are pretty easy, on the repository locations, you can use GIT, SVN FILE, OR TAGS. 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/PTES_PHASE/TOOL_FOLDER

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.

You can also specify {PTF_LOCATION} which will pull the base path for your PTF installation.

You also have the ability for repository locations to specify both a 32 bit and 64 bit location. Repository location should always be the x86 download path. To add a 64 bit path for a tool, specify X64_LOCATION and give it a URL. When PTF launches it will automatically detect the architecture and attempt to use the x64 link instead of the x86.

Note that ArchLinux packages are also supported, it needs to be specified for both DEBIAN and ARCH in order for it to be properly installed on either platform in the module

When using the TAGS mode, this will allow you to use a github project that utilizes tags to pull the latest version (usually compiled applications) and automatically download. In order to use the TAGS method, take a look at the structure under modules/intelligence-gathering/teamfiltration.py. In this example, there is no need for a repository_location, but you will need to know the project owner, project name/repo, and the filename to download. In the example of TeamFiltration, it is located at: https://github.com/Flangvik/TeamFiltration. The owner would be Flangvik, the project/tool would be TeamFiltration. If you navigate to releases: https://github.com/Flangvik/TeamFiltration/releases/, we can see here that the name of the file we want to download is "TeamFiltration_Linux". These are under the OWNER, REPOHOME, and FILENAME. Specifying these, PTF will automatically detect the latest release of the tool and install them.

GITLAB Support

You can create your own modules and PTF also supports gitlab access. Instead of specifying git, wget, etc., simply specify gitlab and point to your own internal gitlab tools for modules.

BYPASS UPDATES:

When using traditional git or svn as a main method, what will happen after a module is installed is it will just go and grab the latest version of the tool. With after commands, normally when installing, you may need to run the after commands after each time you update. If you specify bypass updates to YES (BYPASS_UPDATE="YES"), each time the tool is run, it will check out the latest version and still run after commands. If this is marked to no, it will only git pull the latest version of the system. For FILE options, it is recommended to always use BYPASS_UPDATE="YES" so that it will overwrite the files each time.

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).

Automatic Launchers

The flag LAUNCHER= in modules is optional. If you add LAUNCHER="setoolkit" for example, PTF will automatically create a launcher for the tool under /usr/local/bin/. In the setoolkit example, when run - PTF will automatically create a file under /usr/local/bin/setoolkit so you can launch SET from anywhere by simply typing setoolkit. All files will still be installed under the appropriate categories, for example /pentest/exploitation/setoolkit however an automatic launcher will be created.

You can have multiple launchers for an application. For example, for Metasploit you may want msfconsole, msfvenom, etc. In order to add multiple launchers, simply put a , between them. For example LAUNCHER="msfconsole,msfvenom". This would create launchers for both.

Automatic Command Line

You can also just run ./ptf --update-all and it will automatically update everything for you without having to go into the framework.

Running Unattended

If you're running ptf in an automatic build, you can use a heredoc so you don't have to interactively type the modules you wish to install. Example:

./ptf <<EOF
use modules/exploitation/metasploit
run
use modules/password-recovery/johntheripper
run
EOF

TOOL DEPENDS

Some tools such as Veil, SET, etc. require tools such as the Metasploit Framework. You can add in the module TOOL_DEPEND="modules/exploitation/metasploit,module/exploitation/set" and multiple other tools if there is a tool required to be installed prior to installing the tool. This will force PTF to install the required tool first, then install the module that requires it. Example:

TOOL_DEPEND="modules/exploitation/metasploit"

This will install Metasploit first or ensured its installed first prior to installing the application.

IGNORE Modules or Categories

The IGNORE_THESE_MODULES= config option can be found under config/ptf.config in the PTF root directory. This will ignore modules and not install them - everything is comma separated and based on name - example: modules/exploitation/metasploit,modules/exploitation/set or entire module categories, like /modules/code-audit/*,/modules/reporting/*

IGNORE Modules from Update/Install All

The IGNORE_UPDATE_ALL_MODULES= config option can be found under config/ptf.config in the PTF root directory. This will ignore modules only when doing install_update_all which are used when you want to install all tools. This could be for large applications that take substantial time, ones that require user interaction, or open up a number of ports and protocols on the system. This works very similar in the IGNORE_THESE_MODULES, except that they can be manually installed and updated through the modules/update_installed. These are comma deliminated, so for example modules/exploitation/tool1,modules/exploitation/tool2, when running install_update_all, this would not install the tools unless you went to use modules/exploitation/tool1 and installed via that method.

INCLUDE_ONLY_THESE_MODULES

The INCLUDE_ONLY_THESE_MODULES in the config option under config/ptf.config will only install and include specific modules that are specified here. This is good for baselining the tools that you want and install only them.

LAUNCH PTF WITH NO BANNER

You can launch PTF with no banner message if you want. Simply specify:

./ptf --no-banner

or 

./ptf -nb

CHECK FOR INSTALLED PROGRAMS THROUGH PTF

You can check to see what applications you've already installed through PTF by typing the following:

ptf>show installed

ptf's People

Contributors

0xsalt avatar 4ndr3w6 avatar bandrel avatar bendrysdale avatar bustedsec avatar cclauss avatar citizenhax avatar firebitsbr avatar gazcbm avatar hackingdave avatar jdogherman avatar jeffmcjunkin avatar kryptonsecurity avatar l0stkn0wledge avatar meldridge avatar mikedawg avatar ninewires avatar nmrdyer avatar onslaught avatar shadawck avatar sidahmed-malaoui avatar skapunker avatar spoonman1091 avatar stasinopoulos avatar su1ph3r avatar th3joker3000 avatar usezfsyo avatar vdbaan avatar ypcrts avatar zawadidone 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ptf's Issues

wpscan install fails - Ubuntu 15.04

ptf:(modules/vulnerability-analysis/wpscan)>install

Module Author: Mauro Risonho de Paula Assumpcao (firebits)

Module Description: This module will install/update wpscan - a black box WP scanner

INSTALL_TYPE: GIT
REPOSITORY_LOCATION: https://github.com/wpscanteam/wpscan/

INSTALL_LOCATION: /pentest/vulnerability-analysis/wpscan/

[] Preparing dependencies for module: modules/vulnerability-analysis/wpscan
Reading package lists... Done
Building dependency tree
....[
] Sending after command: ruby wpscan.rb --update


    __          _______   _____                  
    \ \        / /  __ \ / ____|                 
     \ \  /\  / /| |__) | (___   ___  __ _ _ __  
      \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \ 
       \  /\  /  | |     ____) | (__| (_| | | | |
        \/  \/   |_|    |_____/ \___|\__,_|_| |_|

    WordPress Security Scanner by the WPScan Team 
                   Version 2.8
      Sponsored by Sucuri - https://sucuri.net

@WPScan, @ethicalhack3r, @erwan_lr, pvdl, @FireFart


[i] Updating the Database ...
[i] Update completed.
[*] Completed running after commands routine..
[!] Warning, module modules/vulnerability-analysis/wpscan was found but contains no LAUNCHER field.
[!] Check the module again for errors and try again.
[!] Module has been removed from the list.
[!] DANGER WILL ROBINSON. DANGER WILL ROBINSON. Error has occured.
[!] It's not possible its due to my coding skillz, it must be you? :-)
[!] Printing that error. Get that error. You get it: argument of type 'NoneType' is not iterable
root@localhost:~/ptf# wpscan
No command 'wpscan' found, did you mean:

Issue with ignore modules

Hello

I was testing this tool on a kali machine this ended up breaking metasploit and armitage so I've tried to to ignore modules in the config how ever it installs them anyway.

Here is the code I put in the config file.

IGNORE_THESE_MODULES="modules/explotation/metasploit,modules/exploitation/malingo,modules/exploitation/owasp-zsc,modlules/vulnerability-analysis/nikto,modlules/vulnerability-analysis/nmap,modlules/vulnerability-analysis/openvas"

How ever it installs all of the above anyway .

I know most of these tools are already in Kali Just wanted to test it using the lab machine we have.

Apologies if I've made a mistake

issue when trying to install

i get the following issue when i try to install (screenshot). i got most of the way through it, and believe it is something i run into sometimes where i have to manually select the directory. it is possible that it stems from a cup of coffee on the motherboard, as it will not install an os either, but the fix is generally me hardcoding the directory into the script or whatever. i juat cannot seem to locate this one. if you could point me to the correct file, i can fix it. thanx so much and i look foward to trying the tool out.
ptf_error

Error when starting Firefox from the command line.

I believe this is an upstream issue.

root@ptf:# firefox &
[1] 31503
root@ptf:
#
(process:31503): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Gtk-Message: Failed to load module "canberra-gtk-module"
console.error:
[CustomizableUI]
Custom widget with id loop-button does not return a valid node
console.error:
[CustomizableUI]
Custom widget with id loop-button does not return a valid node

List of tools/modules in the readme

Is it possible to list the 109(+) modules in the readme, or somewhere else in a flat way? Seems like the only way to see everything now is to go into each directory and check them out. Would be cool to just see what all is included.

THANKS!

Great project.

No such file or directory: 'HconSTF'

cp: cannot stat ‘download’: No such file or directory
[] Sending after command: bzip2 -d download.tar.bz2
bzip2: Can't open input file download.tar.bz2: No such file or directory.
[
] Sending after command: tar -xf download.tar
tar: download.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
[*] Sending after command: cd HconSTF
[!] DANGER WILL ROBINSON. DANGER WILL ROBINSON. Error has occured.
[!] It's not possible its due to my coding skillz, it must be you? :-)
[!] Printing that error. Get that error. You get it: [Errno 2] No such file or directory: 'HconSTF'

Prereqs for dotdotpwn don't seem to be installed

When running dotdotpwn in Ubuntu I get the following:

Can't locate Switch.pm in @inc (you may need to install the Switch module) (@inc contains: . /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl) at DotDotPwn/TraversalEngine.pm line 30.
BEGIN failed--compilation aborted at DotDotPwn/TraversalEngine.pm line 30.
Compilation failed in require at ./dotdotpwn.pl line 56.
BEGIN failed--compilation aborted at ./dotdotpwn.pl line 56.

I can work on this tomorrow, but the issue should be raised.

WPScan update/install databases

Awesome to see WPScan is supported! :)

From looking at this script - https://github.com/trustedsec/ptf/blob/master/modules/vulnerability-analysis/wpscan.py - it seems as though the WPScan databases (from wpvulndb.com) are not installed.

I'm not sure if this is deliberate or not? If not, I would recommend running ./wpscan.rb --update to install them, this will save the user having to download them.

See output below:

Ryans-MacBook-Pro:tmp ryan$ git clone https://github.com/wpscanteam/wpscan.git
Cloning into 'wpscan'...
remote: Counting objects: 14679, done.
remote: Total 14679 (delta 0), reused 0 (delta 0), pack-reused 14679
Receiving objects: 100% (14679/14679), 11.83 MiB | 549.00 KiB/s, done.
Resolving deltas: 100% (8666/8666), done.
Checking connectivity... done.
Ryans-MacBook-Pro:tmp ryan$ cd wpscan/
Ryans-MacBook-Pro:wpscan ryan$ ./wpscan.rb -u www.example.com
_______________________________________________________________
        __          _______   _____                  
        \ \        / /  __ \ / ____|                 
         \ \  /\  / /| |__) | (___   ___  __ _ _ __  
          \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \ 
           \  /\  /  | |     ____) | (__| (_| | | | |
            \/  \/   |_|    |_____/ \___|\__,_|_| |_|

        WordPress Security Scanner by the WPScan Team 
                       Version 2.8
          Sponsored by Sucuri - https://sucuri.net
   @_WPScan_, @ethicalhack3r, @erwan_lr, pvdl, @_FireFart_
_______________________________________________________________

[i] It seems like you have not updated the database for some time.
[?] Do you want to update now? [Y]es [N]o [A]bort, default:

Fedora no longer working

Hi,

I saw that a fedora piece was added, to have support for Fedora.

Tried running it today, and it failed:

ptf> use modules/exploitation/install_update_all
[] You are about to install/update everything. Proceed? [yes/no]:yes
[
] Auto updating is turned to on, this will install normal package updates for you...
[] If you want to turn this off, go to the PTF directory and go to config and change AUTO_UPDATE
sudo: apt-get: command not found
[
] Finished with normal package updates, moving on to the tools section..
[] We are going to first install all prereqs using apt before installing..
[
] Cycling through modules and grabbing requirements...
[!] DANGER WILL ROBINSON. DANGER WILL ROBINSON. Error has occured.
[!] It's not possible its due to my coding skillz, it must be you? :-)
[!] Printing that error. Get that error. You get it: name 'fedora_modules' is not defined

removing a tool

Hi. Thanks for the useful framework great work. However, there is any no option for removing a tool. Or how can I remove an installed tool. Thanks.

Writing a Logfile

If using modules/install_update_all it would be nice if a logfile would be written (with the date attached to the name) each time this module is run so that you can enumerate what has when been updated, even after days or weeks.
For me it would be important to check which tools have been updated and which packages have been installed/modified (since some packages break other packages!).

wpscan requires ruby >= 2.1.9

wpscan is not possible to install via ptf:

[*] Sending after command: ruby wpscan.rb --update
Ruby >= 2.1.9 required to run wpscan (You have 2.1.5)

Tried on Kali and Ubuntu. Their repositories contain ruby 2.1.5.

Error with recon-ng.

root@ptf:~# recon-ng
[!] Module 'recon/domains-contacts/metacrawler' disabled. Dependency required: 'PyPDF2'.
[!] Module 'recon/domains-credentials/pwnedlist/account_creds' disabled. Dependency required: 'aes'.
[!] Module 'recon/domains-credentials/pwnedlist/domain_creds' disabled. Dependency required: 'aes'.

_/_/_/    _/_/_/_/    _/_/_/    _/_/_/    _/      _/            _/      _/    _/_/_/

_/ _/ _/ _/ _/ _/ // _/ // / /
//
/ //
/ _/ _/ _/ _/ / / //// _/ _/ _/ / ///
_/ _/ _/ _/ _/ _/ _/ // _/ // / /
/ / //// //
/ //
/ _/ _/ _/ / ///

                                      /\
                                     / \\ /\
    Sponsored by...           /\  /\/  \\V  \/\
                             / \\/ // \\\\\ \\ \/\
                            // // BLACK HILLS \/ \\
                           www.blackhillsinfosec.com

                  [recon-ng v4.7.1, Tim Tomes (@LaNMaSteR53)]                       

[72] Recon modules
[7] Reporting modules
[3] Disabled modules
[2] Import modules
[2] Exploitation modules
[2] Discovery modules

Fierce AFTER_COMMANDS problem

Hi, me again (Fedora user),

I found a problem with the modules / intelligence-gathering / Fierce AFTER_COMMANDS.

It appears that this module is attempting to install perl 5.22.0 (from CPAN) when it runs the AFTER_COMMANDS

Perl 5.22.0 is already installed via dnf.

Doing some troubleshooting now, to see if I can figure out why this is happening.

local variable 'counter' referenced before assignment

Good evening,
I am currently runnian Debian Stretch (fully updated) and Python 2.7.11+ and I have been using PTF for months and love it. I just went to update PTF tonight, and am receiving the error:
local variable 'counter' referenced before assignment
When I run sudo ptf --update-all on zaproxy. I moved this module out of PTF, and now receive the message on maligno.

I then decided to try updating each type of module individually (i.e. use modules/post-exploitation/install_update_all.

Everything works with the exception of:
exploitation (fails on zaproxy, maligno)
vulnerability analysis (fails on lbd)

Lastly, it appears that install_update_all is missing from password-recovery.

As a side note, last night I ran pdf --update-all and everything went as expected.

module import error

hey there,
when i run the framework.py it says

Traceback (most recent call last):
  File "framework.py", line 7, in <module>
    from src.core import *
ImportError: No module named src.core

instead using from src.core import * why don't you just use from core import * ?
after change the import section into from core import * it's runs like what i thought

do NOT automatically install external dependencies system-wide

Currently, whenever a tool has dependencies defined in a requirements.txt/Gemfile, these are installed system-wide, no matter if these are available using the distro's package manager, and no matter if these are already installed using the distro's package manager, without even warning the user about it.

This might (and, at some point, will) break things on the system, as this would overwrite files already installed by the package manager with a possibly different version, and other system applications may not be compatible with the newly installed version. This has just overwritten a bunch of packages that I already had installed using apt, and now I'm just waiting to discover what this might have broken on my system... 😡

Installing these dependencies should not be done system-wide, but inside a virtual environment (using virtualenv/rvm/whatever), be it on a per-tool basis, or globally for all the tools handled by ptf (a per-tool environment might be cleaner as all the tools may not depend on the same versions of packages), or the user should be notified before such a thing occurs, so he has a chance to stop the installation process.

sqlmap not passing parameters

First of all, gotta say I really like the framework you've created. Really like the idea of all the options for keeping the tools up to date and launching them. I did find something though with sqlmap

When running sqlmap no parameters are passed, regardless if run under sudo or not.

ptf@ubuntu:/pentest/ptf$ sqlmap -h
chmod: changing permissions of ‘sqlmap.py’: Operation not permitted
Usage: python sqlmap.py [options]

sqlmap.py: error: missing a mandatory option (-d, -u, -l, -m, -r, -g, -c, -x, --wizard, --update, --purge-output or --dependencies), use -h for basic or -hh for advanced help
ptf@ubuntu:/pentest/ptf$ sudo sqlmap -h
Usage: python sqlmap.py [options]

sqlmap.py: error: missing a mandatory option (-d, -u, -l, -m, -r, -g, -c, -x, --wizard, --update, --purge-output or --dependencies), use -h for basic or -hh for advanced help

I replaced /usr/local/bin/sqlmap with a sym link to /pentest/exploitation/sqlmap/sqlmap.py

root@ubuntu:/usr/local/bin# ln -s /pentest/exploitation/sqlmap/sqlmap.py sqlmap
root@ubuntu:/usr/local/bin# ls -al sqlmap
lrwxrwxrwx 1 root root 38 Aug 25 13:21 sqlmap -> /pentest/exploitation/sqlmap/sqlmap.py

Now it works, but probably doesn't align with how the framework manages/updates it, or will eventually overwrite it, so I'm guessing the original sqlmap script in /usr/local/bin should include the passed parameters when launching /pentest/exploitation/sqlmap/sqlmap.py. Maybe passing $* which also seems to work for me.

!/bin/sh

cd /pentest/exploitation/sqlmap/
chmod +x sqlmap.py
./sqlmap.py $*

ptf@ubuntu:~$ sudo sqlmap --version
1.0-dev-1f5e660

Issue with DradisFraimwork

While installing PTF on a fresh Ubuntu 15.10 i am getting an error trying to install the dradisframework.

I have included a screen shot of the issue

screenshot from 2016-04-04 09-22-09

msfconsole commands

-x option to execute string as a console command is not working. msf is only processing the first portion of the string with a usage response once within msf.

Minimal Ubuntu install issues (docker related?)

I believe this is due to minimal ubuntu, but important point is that I am also running this in Docker.
(Docker, because I don't like my host system to have a million extra dependencies 😄 )

Minimal ubuntu is from Docker's official hub, ubuntu:14.04 - x64

Some fails:

  1. dradisframework requires libsqlite-dev (dradis-nessus -> bundle install sqlite specifically)
    • Fixed with apt-get install libsqlite-dev
  2. Wine package is only available as wine1.6-i386, so you must add
    • Fixed with sudo dpkg --add-architecture i386
  3. Need to update X64_LOCATION, otherwise the cp/untar filename is wrong
    • Fixed by appending /download like so: X64_LOCATION=....HconSTF_v0.5_Prime_Linux_x64.tar.bz2/download

Things that could use more automation:

  • Kerberos service
  • CPAN mirror
  • openvas SVN cert
  • backdoorfactory does an apt-get intsall and prompts to continue
  • empire also require apt-get installs and then wants a server password

Will update with any other failures.

Installing modules fails on ArchLinux if dependencies are not defined

It seems that only modules/vulnerability-analysis/ftpmap is installable on ArchLinux, as it's the only one who has ArchLinux dependencies defined (i.e. the ARCHLINUX variable), trying to install any other module on ArchLinux makes ptf crash.

Any attempt to install a module on ArchLinux results in the following error:

ptf> use modules/exploitation/beef
ptf:(modules/exploitation/beef)>install

Module Author:         David Kennedy (ReL1K)
Module Description:    This module will install/update the Browser Exploitation Framework (BeEF)
-------------------------------------------------------------------------------------
INSTALL_TYPE:           GIT
REPOSITORY_LOCATION:    https://github.com/beefproject/beef
INSTALL_LOCATION:       /pentest/exploitation/beef/
-------------------------------------------------------------------------------------
[*] Preparing dependencies for module: modules/exploitation/beef
[!] Warning, module modules/exploitation/beef was found but contains no ARCHLINUX field.
[!] Check the module again for errors and try again.
[!] Module has been removed from the list.
Traceback (most recent call last):
  File "ptf", line 63, in <module>
    import src.framework
  File "/data/Tools/ptf/src/framework.py", line 454, in <module>
    use_module(prompt[1], "0")
  File "/data/Tools/ptf/src/framework.py", line 242, in use_module
    base_install_modules(arch_modules) 
  File "/data/Tools/ptf/src/platforms/archlinux.py", line 12, in base_install_modules
    modules = module_name.replace(",", " ")
AttributeError: 'NoneType' object has no attribute 'replace'

I know maintaining dependencies lists for every existing distro on earth isn't possible, but at least install shouldn't crash like this. An option when the ARCHLINUX variable is missing might be to notify the user and display the Debian dependencies list, so the user can find the corresponding packets in ArchLinux and install them by himself. Something like this for example:

[*] Preparing dependencies for module: modules/exploitation/beef
[!] Warning, module modules/exploitation/beef was found but contains no ARCHLINUX field.
[!] Warning, unable to automatically install dependencies.
[*] Dependencies for Debian are: foo, bar, baz
[*] install their ArchLinux equivalent and press <Enter> to resume installation

If you think this alternative would be ok for you, I might implement it by myself and make a pull-request, just tell me. Because in its current state, ptf is just not usable on ArchLinux 😞 .

john - need .conf files, and pretty much everything in ./run

Trying to figure out the best way to approach john. The biggest problem, is a lot of the files in ./run are needed by john, specifically the various *.conf files.

Curious as to what you think the best approach to this would be, do you think there are run time configuration options should be put into the ./configure line, or do you think post-install (aka AFTER_COMMANDS) should include a cp run/* ./

Didn't discover issues until I tried cracking a pkzip file, and john didn't know what to do, mostly because of a missing john.conf file.

How do you want to approach this? I can create a pull request for anything you want to do. Also, I'm not sure I understand the reason behind having/creating a john.sh file.

Metasploit install broken

Hi!
I have tested ptf on a virtual Ubuntu 14.04.3 amd64 desktop.
This is a newly installed Ubuntu VM with no other programs (except what is default) installed.
I choose to install all modules, unfortunatelly the one I am most interested in, Metasploit, won't work.

If I run "use modules/install_update_all" I get this error when it comes to Metasploit:

"Installing metasploit-concern 1.0.0

Gem::InstallError: metasploit-concern requires Ruby version >= 2.1.
An error occurred while installing metasploit-concern (1.0.0), and Bundler cannot continue.
Make sure that gem install metasploit-concern -v '1.0.0' succeeds before bundling.
[] Killing ruby gem launchers as this breaks launchers...
rm: cannot remove ‘/usr/local/rvm/gems/ruby-2.
/bin/msf_’: No such file or directory
[_] Finished updating Metasploit.... Enjoy!"

If I then try to run metasploit I get this error:

janne@ubuntu:~$ msfconsole
chmod: changing permissions of ‘msfconsole’: Operation not permitted
[*] Metasploit requires the Bundler gem to be installed
$ gem install bundler

janne@ubuntu:~$ sudo msfconsole
[sudo] password for janne:
Could not find metasploit-concern-1.0.0 in any of the sources
Run bundle install to install missing gems.

janne@ubuntu:$ bundle install
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find bundler (>= 0) amongst [bundler-unload-1.0.2, executable-hooks-1.3.2, gem-wrappers-1.2.7, rubygems-bundler-1.4.4, rvm-1.11.3.9] (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:into_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in gem' from /usr/local/bin/bundle:22:in

'
janne@ubuntu:$

Do you know why this happens and how it can be resolved?

Tools not installing

A lot of tools are not installing when I run the update all command. When I go into /pentest, the directories of the folders are there, but the actual tools are not. They fail to install during the script. Any suggestions?

quiet install not functioning

https://github.com/trustedsec/ptf/blob/master/modules/vulnerability-analysis/dotdotpwn.py#L29

While export PERL_MM_USE_DEFAULT=1 is set, during install user is still prompted to enter yes multiple times:

OUTPUT FROM SCRIPT:

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes] yes

Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] yes

ALSO:

[] Pre-reqs for modules/vulnerability-analysis/openvas have been installed.
[
] Making the appropriate directory structure first
[*] SVN was the selected method for installation... Using SVN to install.
Error validating server certificate for 'https://scm.wald.intevation.org:443':

  • The certificate is not issued by a trusted authority. Use the
    fingerprint to validate the certificate manually!
    Certificate information:
  • Hostname: wald.intevation.org
  • Valid: from Apr 9 18:16:41 2014 GMT until Apr 8 18:16:41 2016 GMT
  • Issuer: Intevation GmbH, DE
  • Fingerprint: 3B:AD:99:29:43:44:D4:97:15:2E:FB:EE:1C:5A:7E:A1:C4:BE:07:C8
    (R)eject, accept (t)emporarily or accept (p)ermanently? p

Hydra.py possible issue with hydra not running

Currently, when installed you can call hydra by typing hydra-wizard.sh, but when you get done entering in all of the values it errors out. In the python code, if I'm reading it correctly, hydra is supposed to be called with just 'hydra'

The issue may lie, again, if I'm reading the python code correctly, with 4th line from the bottom, at the end of the line "cd ../../,./configure,make,make install" am I right to assume that the comma in the ,./ could be messing it up?

Running Metasploit after installing with PTF

Hi All,

I have an issue where I cannot run Metasploit at all.

I have the following error.

Gem::InstallError: metasploit-concern requires Ruby version >= 2.1.

I am using Linux Mint 17.2

For some reason an older version of Ruby is installed but it looks as if PTF does install the latest version.

Output from PTF

rvm 1.26.11 (master) by Wayne E. Seguin [email protected], Michal Papis [email protected] [https://rvm.io/]
Already installed ruby-2.2.3.
To reinstall use:

rvm reinstall ruby-2.2.3

Creating alias default for ruby-2.2.3....


But ruby -v says different?
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

Only post.php in /var/www after site cloning or site template (credential harvester)

I'm on Kali Rolling release. When I updated apt-get upgrade set, it said it was unpacking 7.2.3 but when running the version was listed as 7.2.2. I tried apt-get purge set and reinstalled but still reported 7.2.2. The first time I tried cloning a site it worked but when I typed in a fake username and password the post failed with 192.168.0.10/post.php (nginx 405 error). I deleted the files out of /var/www and tried again but the only file created was post.php. I then used git to clone, ran set/settoolkit from the 7.2.3 git clone and still no files are created expect for post.php.

Log file not being created

It's probably an oversight on my part, because I don't think I had an issue when I had ran the script on Ubuntu 14.04, but running it on 16.04, updated, I'm not getting a ptf.log file in src/logs/ when using modules/install_update_all

|| Unable to complete the Installation ||

Dear DDos,
Was performing full install of all the tools but was getting stucked up at a particular module of

modules/intellegence-gathering/seclist

as when it comes to installing this module nothing happens and does not go forward your help is appreicated ...

Fresh arch install ptf will not execute

$ sudo ./ptf
[] You can always type ./ptf --no-network-connection to skip the Internet check..
[
] Checking for an Internet connection...
[*] Trying to update myself first.. Then starting framework.
Already up-to-date.
[!] DANGER WILL ROBINSON. DANGER WILL ROBINSON. Error has occured.
[!] It's not possible its due to my coding skillz, it must be you? :-)
[!] Printing that error. Get that error. You get it: name 'file' is not defined

Updating ' . ' :

When updating all the tools, I see the following four times:
Updating ' . ' :

More errors in Fedora

Hi, saw you made the update to issue #98. Running into new issue:

ptf> use modules/install_update_all
[] You are about to install/update everything. Proceed? [yes/no]:yes
[
] Auto updating is turned to on, this will install normal package updates for you...
[] If you want to turn this off, go to the PTF directory and go to config and change AUTO_UPDATE
[
] Finished with normal package updates, moving on to the tools section..
[] We are going to first install all prereqs using apt before installing..
[
] Cycling through modules and grabbing requirements...
[!] Warning, module modules/intelligence-gathering/eyewitness was found but contains no FEDORA field.
[!] Check the module again for errors and try again.
[!] Module has been removed from the list.
[!] DANGER WILL ROBINSON. DANGER WILL ROBINSON. Error has occured.
[!] It's not possible its due to my coding skillz, it must be you? :-)
[!] Printing that error. Get that error. You get it: cannot concatenate 'str' and 'NoneType' objects

ftpmap prerequisites not installed

ftpmap wasn't working on my install, so I ran the install steps manually, and discovered:

sempf@sempf-Aspire-S7-391:/pentest/vulnerability-analysis/ftpmap$ sudo make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /pentest/vulnerability-analysis/ftpmap/missing aclocal-1.15
/pentest/vulnerability-analysis/ftpmap/missing: line 81: aclocal-1.15: command not found
WARNING: 'aclocal-1.15' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
http://www.gnu.org/software/automake
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
http://www.gnu.org/software/autoconf
http://www.gnu.org/software/m4/
http://www.perl.org/
make: *** [aclocal.m4] Error 127

I can look at these tomorrow and put in a pull but the issue should be reported.

S

No support for OWASP ZAP

Not that I could see anyway :(
Should be easy to include - it just needs Java7 +
Let me know if you need any help including it.

nmap.py doesn't properly build itself or ncat

Expected behavior: nmap and ncap will properly build and install when running
ptf> use modules/vulnerability-analysis/nmap
ptf:(modules/vulnerability-analysis/nmap)>install

Actual behavior:
repository is checked out but nothing is built.

Also adds dependencies to work properly on Ubuntu 14.04-LTS Server

Fixed in github.com/0xsalt/ptf/. Attempting to submit a pull request now ..

/etc/apt/sources.list does not exist in whonix

Checking for the presence of /etc/apt/sources.list might not make sense for Debian based distros. I understand the script is trying to identify if it can use apt-get so perhaps change the following:

if os.path.isfile("/etc/apt/sources.list"):
to
if os.path.isfile("/usr/bin/apt-get"):

Further to this, Arch linux and Fedora would be better if the search for pacman and dnf is done rather than release.

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.