Commit e29af5a7 authored by Lorenzo Faletra's avatar Lorenzo Faletra

add metasploit executables

parent d89ce39a
#!/bin/bash
echo -e " ____ _ ____
| _ \ __ _ _ __ _ __ ___ | |_/ ___| ___ ___
| |_) / _\` | '__| '__/ _ \| __\___ \ / _ \/ __|
| __/ (_| | | | | | (_) | |_ ___) | __/ (__
|_| \__,_|_| |_| \___/ \__|____/ \___|\___|
"
echo "executing \"$*\""
echo ""
sudo $*
sudo -s
#!/bin/bash
gksu "$*"
#!/bin/bash
service postgresql start
msfdb init
msfdb start
msfd
msfconsole
#!/bin/bash
service postgresql start
msfdb init
msfdb start
msfd
#!/bin/bash
service postgresql start
msfdb init
msfdb start
msfd
armitage
#!/bin/bash
service postgresql stop
msfdb stop
#!/usr/bin/perl
use warnings;
use strict;
use Dpkg::ErrorHandling;
use Dpkg::IPC;
use File::FcntlLock;
use File::Copy;
use File::Path qw(make_path);
use constant {
INCOMING_APPDIR => "/usr/share/parrot-menu/applications",
OUTGOING_APPDIR => "/usr/share/applications",
DPKG_LOCKFILE => "/var/lib/dpkg/lock",
PARROT_MENU_LOCKFILE => "/var/lock/parrot-menu",
};
our %pkg2desktop;
our %desktop2pkg;
our %installed;
make_path(OUTGOING_APPDIR, { mode => 0755 });
my $lock = get_lock(); # Can stop here if another instance is already running
parse_parrot_desktop_files();
my $arg = shift @ARGV || "";
wait_dpkg() if (defined $ENV{'DPKG_RUNNING_VERSION'} or $arg eq "wait_dpkg");
# Scan installed packages to identify desktop files to install
foreach my $pkg (list_installed_packages()) {
$installed{$pkg} = 1;
next unless exists $pkg2desktop{$pkg};
foreach my $desktop (@{$pkg2desktop{$pkg}}) {
my $target = OUTGOING_APPDIR . "/$desktop";
my $source = INCOMING_APPDIR . "/$desktop";
take_control_of($target);
copy($source, $target);
}
}
# Scan installed desktop files to remove the entries that are no longer
# relevant
FILE: foreach my $desktop (list_installed_desktop_files()) {
my $ref_file = INCOMING_APPDIR . "/$desktop";
my $out_file = OUTGOING_APPDIR . "/$desktop";
next unless is_managed($out_file);
# Drop unknown files
unless (-e $ref_file and exists $desktop2pkg{$desktop}) {
release_desktop_file($out_file);
next;
}
# Ensure the corresponding package is still installed
foreach my $pkg (@{$desktop2pkg{$desktop}}) {
next FILE if $installed{$pkg};
}
release_desktop_file($out_file);
}
close($lock);
### HELPER FUNCTIONS
sub release_desktop_file {
my ($file) = @_;
my $infos = get_dpkg_infos($file);
unlink($file) or syserr("can't remove %s", $file);
remove_diversion($file) if $infos->{'diverted'};
}
sub take_control_of {
my ($target) = @_;
return if not -e $target; # No conflicting file, go ahead
return if is_managed($target); # Already managed, nothing else to do
my $infos = get_dpkg_infos($target);
if ($infos->{'known'} and not $infos->{'diverted'}) {
divert($target);
}
}
sub get_dpkg_infos {
my ($target) = @_;
my $pipe;
my $pid = spawn(exec => [ 'dpkg-query', '-S', $target ],
to_pipe => \$pipe, error_to_file => "/dev/null",
env => { LC_ALL => 'C' });
my $res = {
diverted => 0,
known => 0,
};
while (<$pipe>) {
if (/^(diversion by|local diversion)/) {
$res->{'diverted'} = 1;
next;
}
$res->{'known'} = 1 if /: \Q$target\E/;
}
wait_child($pid, cmdline => "dpkg-query -S $target", nocheck => 1);
return $res;
}
sub divert {
my ($target) = @_;
spawn(exec => [ "dpkg-divert", "--local", "--rename", "--divert",
"$target.disabled-by-parrot-menu", "--add", $target ],
wait_child => 1, to_file => "/dev/null");
}
sub remove_diversion {
my ($target) = @_;
spawn(exec => [ "dpkg-divert", "--local", "--rename", "--divert",
"$target.disabled-by-parrot-menu", "--remove", $target ],
wait_child => 1, to_file => "/dev/null");
}
sub is_managed {
my ($target) = @_;
my $res = 0;
open(my $fh, "<", $target) or syserr("can't open %s", $target);
if (grep { /^X-Parrot-Package=/i } <$fh>) {
$res = 1;
}
close($fh);
return $res;
}
sub list_installed_packages {
my (@list, $pipe);
my $pid = spawn(exec => [ 'dpkg-query', '-f', '${Package} ${Status}\n', '-W' ],
to_pipe => \$pipe);
while (<$pipe>) {
my ($pkg, $want, $ok, $status) = split;
if ($status ne "not-installed" and $status ne "config-files") {
push @list, $pkg;
}
}
wait_child($pid, cmdline => "dpkg-query");
return @list;
}
sub list_installed_desktop_files {
opendir(my $dh, OUTGOING_APPDIR) or syserr("can't opendir %s", OUTGOING_APPDIR);
my @files = grep(/\.desktop$/, readdir($dh));
closedir($dh);
return @files;
}
sub parse_parrot_desktop_files {
opendir(my $dh, INCOMING_APPDIR) or syserr("can't opendir %s", INCOMING_APPDIR);
foreach my $file (readdir $dh) {
next unless ($file =~ /\.desktop$/);
my $path = INCOMING_APPDIR . "/$file";
open(my $fh, "<", $path) or syserr("can't open %s", $path);
my $found = 0;
while (<$fh>) {
if (/X-Parrot-Package=\s*(.*)$/i) {
$found = 1;
foreach my $pkg (split(/\s+|\s*,\s*/, $1)) {
$pkg2desktop{$pkg} = [] unless exists $pkg2desktop{$pkg};
$desktop2pkg{$file} = [] unless exists $desktop2pkg{$file};
push @{$pkg2desktop{$pkg}}, $file;
push @{$desktop2pkg{$file}}, $pkg;
}
}
}
close($fh);
unless ($found) {
warning("%s is missing the X-Parrot-Package header", $path);
}
}
closedir($dh);
}
sub get_lock {
my $lockfile = PARROT_MENU_LOCKFILE;
system("mkdir -p /run/lock /var/lock; touch $lockfile") unless -e $lockfile;
open my $fh, '>>', $lockfile or syserr("Can't open %s", $lockfile);
my $fs = new File::FcntlLock l_type => F_WRLCK;
if (not $fs->lock($fh, F_SETLK)) {
exit 0; # Failed to lock, another instance is already running
}
return $fh;
}
sub wait_dpkg {
return unless -e DPKG_LOCKFILE;
open my $fh, '<', DPKG_LOCKFILE or syserr("Can't open %s", DPKG_LOCKFILE);
my $fs = new File::FcntlLock l_type => F_WRLCK;
# Wait until dpkg releases the lock and doesn't grab it back in the
# next 5 seconds
my $count = 0;
while ($count < 2) {
if (can_lock($fh, $fs)) {
$count++;
} else {
$count = 0;
}
sleep(5);
}
close $fh;
}
sub can_lock {
my ($fh, $fs) = @_;
$fs->l_type(F_WRLCK);
if (not $fs->lock($fh, F_GETLK)) {
error("Failed to analyze lock on %s: %s", DPKG_LOCKFILE, $fs->error());
}
return $fs->l_type == F_UNLCK;
}
parrot-menu (2016.7.24.2) testing; urgency=medium
* Add metasploit start binaries
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Sun, 24 Jul 2016 15:29:30 +0200
parrot-menu (2016.7.24.1) testing; urgency=medium
* Prevent conflicts with mate-menus
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Sun, 24 Jul 2016 09:19:28 +0200
parrot-menu (2016.7.24) testing; urgency=medium
* Debianize source code and update launchers
......
......@@ -9,6 +9,7 @@ Package: parrot-menu
Architecture: all
Depends: ${misc:Depends}, ${perl:Depends}, libdpkg-perl, libfile-fcntllock-perl, xdg-utils
Breaks: dradis (<< 3.1.0~rc2)
Replaces: mate-menus
Description: Parrot GNU/Linux custom menu
This package provides a custom menu for Parrot GNU/Linux.
.
......
menus/parrot-applications.menu etc/xdg/menus/applications-merged/
menus/anon-surf.menu etc/xdg/menus/applications-merged/
menus/mate-applications.menu etc/xdg/menus/
bin/* usr/bin/
desktop-directories/*.directory usr/share/desktop-directories/
desktop-files/*.desktop usr/share/parrot-menu/applications/
apt.conf.d/99parrot-menu etc/apt/apt.conf.d/
......
......@@ -2,15 +2,15 @@ Format: 3.0 (native)
Source: parrot-menu
Binary: parrot-menu
Architecture: all
Version: 2016.7.24
Version: 2016.7.24.2
Maintainer: Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org>
Standards-Version: 3.8.4
Build-Depends: debhelper
Package-List:
parrot-menu deb parrot optional arch=all
Checksums-Sha1:
4e3c0dcf5fbda2b0bab3c27fca1a3bfb0fa417e0 4306828 parrot-menu_2016.7.24.tar.xz
ea802676892d62f134cf80fd840254a31f14aa09 4307244 parrot-menu_2016.7.24.2.tar.xz
Checksums-Sha256:
32abf0ed2dad37a507fb0e5adb23b2115a08a7a4aa234de1a834e450f67f407d 4306828 parrot-menu_2016.7.24.tar.xz
ed73d53159142a49f234bd094c830affd28959680cda0aea3c2f2e061ce1122b 4307244 parrot-menu_2016.7.24.2.tar.xz
Files:
27bcbf4185efe9a95502fcb02f9b4b2a 4306828 parrot-menu_2016.7.24.tar.xz
cc20e3049ad9393dcf89ae61bc9f601c 4307244 parrot-menu_2016.7.24.2.tar.xz
dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: info: source package parrot-menu
dpkg-buildpackage: info: source version 2016.7.24
dpkg-buildpackage: info: source distribution testing
dpkg-buildpackage: info: source changed by Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org>
dpkg-source --before-build parrot-menu
dpkg-buildpackage: info: host architecture amd64
fakeroot debian/rules clean
dh clean
dh_testdir
dh_auto_clean
dh_clean
dpkg-source -b parrot-menu
dpkg-source: info: using source format '3.0 (native)'
dpkg-source: info: building parrot-menu in parrot-menu_2016.7.24.tar.xz
dpkg-source: info: building parrot-menu in parrot-menu_2016.7.24.dsc
debian/rules build
dh build
dh_testdir
dh_update_autotools_config
dh_auto_configure
dh_auto_build
dh_auto_test
fakeroot debian/rules binary
dh binary
dh_testroot
dh_prep
dh_auto_install
dh_install
dh_installdocs
dh_installchangelogs
dh_pysupport
dh_pysupport: This program is deprecated, you should use dh_python2 instead. Migration guide: http://deb.li/dhs2p
dh_icons
dh_perl
dh_link
dh_strip_nondeterminism
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package 'parrot-menu' in '../parrot-menu_2016.7.24_all.deb'.
dpkg-genchanges >../parrot-menu_2016.7.24_amd64.changes
dpkg-genchanges: info: including full source code in upload
dpkg-source --after-build parrot-menu
dpkg-buildpackage: info: full upload; Debian-native package (full source is included)
Now running lintian...
E: parrot-menu source: source-contains-unsafe-symlink menu-icons/parrot-menu.png
W: parrot-menu source: ancient-standards-version 3.8.4 (current is 3.9.8)
W: parrot-menu: unknown-section parrot
W: parrot-menu: unusual-interpreter usr/share/desktop-directories/anon-surf.directory #!xdg-open
W: parrot-menu: script-not-executable usr/share/parrot-menu/applications/parrot-maligno.desktop
W: parrot-menu: unusual-interpreter usr/share/parrot-menu/applications/parrot-maligno.desktop #!xdg-open
W: parrot-menu: script-not-executable usr/share/parrot-menu/applications/parrot-mc.desktop
W: parrot-menu: unusual-interpreter usr/share/parrot-menu/applications/parrot-mc.desktop #!xdg-open
Finished running lintian.
Format: 1.8
Date: Sun, 24 Jul 2016 03:19:53 +0200
Source: parrot-menu
Binary: parrot-menu
Architecture: source all
Version: 2016.7.24
Distribution: testing
Urgency: medium
Maintainer: Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org>
Changed-By: Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org>
Description:
parrot-menu - Parrot GNU/Linux custom menu
Changes:
parrot-menu (2016.7.24) testing; urgency=medium
.
* Debianize source code and update launchers
Checksums-Sha1:
8940831f215d915e98fcec2f1e513536ae3cf2dd 562 parrot-menu_2016.7.24.dsc
4e3c0dcf5fbda2b0bab3c27fca1a3bfb0fa417e0 4306828 parrot-menu_2016.7.24.tar.xz
0b568a63a6727a080cfd11c7e4a6d6e0bc0454f8 4343408 parrot-menu_2016.7.24_all.deb
Checksums-Sha256:
4c843363a6b846fde2f66b980aa05f8dc91007abb6c5fd6a8b308ce84a21f9d8 562 parrot-menu_2016.7.24.dsc
32abf0ed2dad37a507fb0e5adb23b2115a08a7a4aa234de1a834e450f67f407d 4306828 parrot-menu_2016.7.24.tar.xz
0a31bd307ba3efa7f5d81e35acfc573051f8e596c9671a7a169a8150f4e05126 4343408 parrot-menu_2016.7.24_all.deb
Files:
fc6430930dbf62b9ed1966d5e07c9c13 562 parrot optional parrot-menu_2016.7.24.dsc
27bcbf4185efe9a95502fcb02f9b4b2a 4306828 parrot optional parrot-menu_2016.7.24.tar.xz
0db331d10eee848b57d4b84b5b9a337c 4343408 parrot optional parrot-menu_2016.7.24_all.deb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment