Commit a1868d19 authored by dmknght's avatar dmknght
parents 456c31d2 cee42e5b
all:
/usr/bin/go build update-launchers.go
/usr/bin/strip update-launchers
DPkg::Post-Invoke { "[ ! -x /usr/share/parrot-menu/update-parrot-menu ] || /usr/share/parrot-menu/update-parrot-menu wait_dpkg"; }
DPkg::Post-Invoke { "[ ! -x /usr/share/parrot-menu/update-launchers ] || /usr/share/parrot-menu/update-launchers wait_dpkg"; }
#!/bin/bash
echo -e "
Mimikatz files are located at
/usr/share/mimikatz
enter this folder to use the tool
"
parrot-menu (2:2019.06.19) testing; urgency=medium
* Remove mimikatz wrapper, now provided by its package.
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Wed, 19 Jun 2019 15:31:27 +0200
parrot-menu (2:2019.06.17) testing; urgency=medium
* Fix testssl launcher.
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Mon, 17 Jun 2019 23:31:25 +0200
parrot-menu (2:2019.06.15) testing; urgency=medium
* Update daemon launchers.
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Sat, 15 Jun 2019 16:56:08 +0200
parrot-menu (2:2019.06.06.1) testing; urgency=medium
* Rebuild package.
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Thu, 06 Jun 2019 22:36:07 +0200
parrot-menu (2:2019.06.06) testing; urgency=medium
* Add new tool launchers.
* Update some launchers.
* Update service launchers to not open a terminal window.
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Thu, 06 Jun 2019 18:38:28 +0200
parrot-menu (2:2019.05.20) testing; urgency=medium
* Update (and fix) new golang launcher updater.
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Sun, 19 May 2019 23:35:32 +0200
parrot-menu (2:2019.05.19) testing; urgency=medium
* Rewrite the menu lanucher updater in golang.
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Sun, 19 May 2019 19:53:27 +0200
parrot-menu (2:2019.04.10) testing; urgency=medium
* Update airgeddon launcher.
......
......@@ -2,12 +2,12 @@ Source: parrot-menu
Section: parrot
Priority: optional
Maintainer: Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org>
Build-Depends: debhelper
Build-Depends: debhelper, golang-go
Standards-Version: 3.8.4
Package: parrot-menu
Architecture: all
Depends: ${misc:Depends}, ${perl:Depends}, gksu, libdpkg-perl, libfile-fcntllock-perl, xdg-utils
Architecture: any
Depends: ${misc:Depends}, gksu, xdg-utils
Breaks: dradis (<< 3.1.0~rc2)
Replaces: mate-menus
Description: Parrot GNU/Linux custom menu
......
......@@ -5,6 +5,6 @@ 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/
update-parrot-menu usr/share/parrot-menu/
update-launchers usr/share/parrot-menu/
menu-icons/* usr/share/icons/
dconf/parrot-menu etc/dconf/db/local.d/
......@@ -2,7 +2,7 @@
Name=beef start
Comment=Turn Browser Exploitation framework service on
Encoding=UTF-8
Exec=menuexec service beef-xss start
Exec=service beef-xss start
Icon=parrot-beef.png
StartupNotify=false
Terminal=true
......
......@@ -2,7 +2,7 @@
Name=beef stop
Comment=Turn Browser Exploitation framework off
Encoding=UTF-8
Exec=menuexec service beef-xss stop
Exec=service beef-xss stop
Icon=parrot-beef.png
StartupNotify=false
Terminal=true
......
[Desktop Entry]
Name=mysql stop
Comment=Stop MySQL database service
Name=brutespray
Encoding=UTF-8
Exec=menuexec "service mysql stop"
Exec=menuexec "brutespray"
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Type=Application
Categories=14-03-mysqld;
X-Parrot-Package=mysql-server
Categories=05-password-attacks;
X-Parrot-Package=brutespray
[Desktop Entry]
Name=mysql start
Comment=Start MySQL database service
Name=changeme
Encoding=UTF-8
Exec=menuexec "service mysql start"
Exec=menuexec "changeme"
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Type=Application
Categories=14-03-mysqld;
X-Parrot-Package=mysql-server
Categories=05-password-attacks;
X-Parrot-Package=changeme
[Desktop Entry]
Name=mysql restart
Comment=Restart MySQL database service
Name=chaosreader
Encoding=UTF-8
Exec=menuexec "service mysql restart"
Exec=menuexec "chaosreader"
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Type=Application
Categories=14-03-mysqld;
X-Parrot-Package=mysql-server
Categories=09-01-network-sniffers;
X-Parrot-Package=chaosreader
......@@ -2,7 +2,7 @@
Name=dradis start
Comment=Start Dradis reporting tool service
Encoding=UTF-8
Exec=menuexec "service dradis start"
Exec=service dradis start
Icon=parrot-dradis.png
StartupNotify=false
Terminal=true
......
......@@ -2,7 +2,7 @@
Name=dradis stop
Comment=Stop Dradis reporting tool service
Encoding=UTF-8
Exec=menuexec "service dradis stop"
Exec=service dradis stop
Icon=parrot-dradis.png
StartupNotify=false
Terminal=true
......
......@@ -2,7 +2,7 @@
Name=dradis
Comment=Web interface reporting tool for security assessments
Encoding=UTF-8
Exec=menuexecg "service dradis start; xdg-open https://127.0.0.1:3004"
Exec=bash -c "service dradis start; xdg-open https://127.0.0.1:3004"
Icon=parrot-dradis.png
StartupNotify=false
Terminal=false
......
[Desktop Entry]
Name=gobuster
Encoding=UTF-8
Exec=menuexec "gobuster -h"
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Type=Application
Categories=01-info-gathering;03-webapp-analysis;top10
X-Parrot-Package=gobuster
......@@ -2,10 +2,10 @@
Name=nginx restart
Comment=Restart nginx httpd service
Encoding=UTF-8
Exec=menuexec service nginx restart
Exec=/usr/sbin/service nginx restart
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-02-httpd;
X-Parrot-Package=nginx
......@@ -2,10 +2,10 @@
Name=nginx start
Comment=Start nginx httpd service
Encoding=UTF-8
Exec=menuexec service nginx start
Exec=/usr/sbin/service nginx start
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-02-httpd;
X-Parrot-Package=nginx
......@@ -2,10 +2,10 @@
Name=nginx stop
Comment=Stop nginx httpd service
Encoding=UTF-8
Exec=menuexec service nginx stop
Exec=/usr/sbin/service nginx stop
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-02-httpd;
X-Parrot-Package=nginx
[Desktop Entry]
Name=impacket
Encoding=UTF-8
Exec=bash -c "echo -e 'Python module to easily build and dissect network protocols\n\navailable commands:\n\nimpacket-GetUserSPNs\nimpacket-rpcdump\nimpacket-smbserver\nimpacket-netview\nimpacket-samrdump\nimpacket-wmiexec\nimpacket-ntlmrelayx\nimpacket-secretsdump';bash"
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Type=Application
Categories=09-sniffing-spoofing;
X-Parrot-Package=python-impacket
[Desktop Entry]
Name=inspectrum
Encoding=UTF-8
Exec=inspectrum
Icon=parrot-gqrx.png
StartupNotify=false
Terminal=false
Type=Application
Categories=06-05-radio-tools;
X-Parrot-Package=inspectrum
......@@ -2,10 +2,10 @@
Name=mysql/mariadb restart
Comment=Restart mysql / mariadb database service
Encoding=UTF-8
Exec=menuexec "service mysql restart"
Exec=/usr/sbin/service mysql restart
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-03-mysqld;
X-Parrot-Package=mariadb-server
......@@ -2,10 +2,10 @@
Name=mysql/mariadb start
Comment=Start mysql / mariadb database service
Encoding=UTF-8
Exec=menuexec "service mysql start"
Exec=/usr/sbin/service mysql start
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-03-mysqld;
X-Parrot-Package=mariadb-server
......@@ -2,10 +2,10 @@
Name=mysql/mariadb stop
Comment=Stop mysql / mariadb database service
Encoding=UTF-8
Exec=menuexec "service mysql stop"
Exec=/usr/sbin/service mysql stop
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-03-mysqld;
X-Parrot-Package=mariadb-server
......@@ -2,10 +2,10 @@
Name=mimikatz
Comment=Uses admin rights on Windows to display passwords of currently logged in users in plaintext
Encoding=UTF-8
Exec=menuexec "mimikatz"
Exec=xdg-open /usr/share/mimikatz
Icon=parrot-mimikatz.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=10-maintaining-access;05-04-pass-hash;
X-Parrot-Package=mimikatz
......@@ -2,10 +2,10 @@
Name=postgresql restart
Comment=Restart postgresql database service
Encoding=UTF-8
Exec=menuexec "service postgresql restart"
Exec=/usr/sbin/service postgresql restart
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-05-postgresql;
X-Parrot-Package=postgresql
......@@ -2,10 +2,10 @@
Name=postgresql start
Comment=Start postgresql database service
Encoding=UTF-8
Exec=menuexec "service postgresql start"
Exec=/usr/sbin/service postgresql start
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-05-postgresql;
X-Parrot-Package=postgresql
......@@ -2,10 +2,10 @@
Name=postgresql stop
Comment=Stop postgresql database service
Encoding=UTF-8
Exec=menuexec "service postgresql stop"
Exec=/usr/sbin/service postgresql stop
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-05-postgresql;
X-Parrot-Package=postgresql
[Desktop Entry]
Name=sshd restart
Encoding=UTF-8
Exec=menuexec service ssh restart
Exec=/usr/sbin/service ssh restart
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-06-sshd;
Comment=Restart the ssh service
......
[Desktop Entry]
Name=sshd start
Encoding=UTF-8
Exec=menuexec service ssh start
Exec=/usr/sbin/service ssh start
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-06-sshd;
Comment=Start ssh server
......
[Desktop Entry]
Name=sshd stop
Encoding=UTF-8
Exec=menuexec service ssh stop
Exec=/usr/sbin/service ssh stop
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Terminal=false
Type=Application
Categories=14-06-sshd;
Comment=Stop ssh server
......
[Desktop Entry]
Name=testssl
Encoding=UTF-8
Exec=menuexec "testssl -b"
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Type=Application
Categories=02-vulnerability-analysis;
X-Parrot-Package=testssl.sh
[Desktop Entry]
Name=wig
Encoding=UTF-8
Exec=bash -c "wig -h;bash"
Icon=parrot-menu.png
StartupNotify=false
Terminal=true
Type=Application
Categories=03-webapp-analysis;03-01-cms-identification;03-05-web-vulnerability-scanners;
X-Parrot-Package=wig
[Desktop Entry]
Name=windows-binaries
Encoding=UTF-8
Exec=xdg-open /usr/share/windows-binaries/
Icon=parrot-menu.png
StartupNotify=false
Terminal=false
Type=Application
Categories=10-maintaining-access
X-Parrot-Package=windows-binaries
[Desktop Entry]
Name=x32dbg
Encoding=UTF-8
Exec=x32dbg
Icon=parrot-ollydbg.png
StartupNotify=false
Terminal=false
Type=Application
Categories=07-reverseengineer;
X-Parrot-Package=x64dbg
[Desktop Entry]
Name=x64dbg
Encoding=UTF-8
Exec=x64dbg
Icon=parrot-ollydbg.png
StartupNotify=false
Terminal=false
Type=Application
Categories=07-reverseengineer;
X-Parrot-Package=x64dbg
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"os/user"
"strings"
)
type launcher struct {
name string
path string
filename string
deb string
sandboxed bool
todelete bool
toupdate bool
}
func main() {
if uid, _ := user.Current(); uid.Uid != "0" {
os.Stderr.WriteString(fmt.Sprintf("Wrong user %s! - Run this program as root\n", uid.Name))
os.Exit(1)
}
fmt.Println("Scanning application launchers")
// get list of files in /usr/share/parrot-menu/applications (source)""
sfiles, err := ioutil.ReadDir("/usr/share/parrot-menu/applications/")
if err != nil {
log.Fatal(err)
}
// get list of files in /usr/share/applications (destination)
dfiles, err := ioutil.ReadDir("/usr/share/applications/")
if err != nil {
log.Fatal(err)
}
// get list of installed packages
tmp, _ := exec.Command("bash", "-c", "apt list --installed | cut -d'/' -f1").Output()
packages := strings.Split(string(tmp), "\n")
// create source and destination structures
source := make([]launcher, len(sfiles))
destination := make([]launcher, len(dfiles))
// initialize source structure
var spath string
for i, f := range sfiles {
spath = fmt.Sprintf("/usr/share/parrot-menu/applications/%s", f.Name())
getLauncherContent(&source[i], spath, f.Name())
}
// initialize destination structure
var dpath string
for i, f := range dfiles {
dpath = fmt.Sprintf("/usr/share/applications/%s", f.Name())
getLauncherContent(&destination[i], dpath, f.Name())
}
fmt.Println("Updating active launchers")
removeOldLaunchers(destination)
copyActiveLaunchers(source, packages)
exec.Command("sync")
fmt.Println("Done")
}
func getLauncherContent(s *launcher, path string, filename string) {
// set path
s.path = path
// set filename
s.filename = filename
// set name
tmpname, _ := exec.Command("bash", "-c",
fmt.Sprintf("grep Name= %s | sed -e 's/Name=//g'", path)).Output()
s.name = strings.Trim(string(tmpname), "\n")
// set package name
tmpdeb, _ := exec.Command("bash", "-c",
fmt.Sprintf("grep X-Parrot-Package= %s | sed -e 's/X-Parrot-Package=//g'", path)).Output()
s.deb = strings.Trim(string(tmpdeb), "\n")
}
func removeOldLaunchers(files []launcher) {
for _, f := range files {
if f.deb != "" {
os.Remove(f.path)
}
}
}
func copyLauncher(source string, destination string) (error, error, error) {
in, errOpen := os.Open(source)
if errOpen != nil {
fmt.Printf("[WARNING] Can't open: %s - %v\n", source, errOpen)
}
out, errClose := os.Create(destination)
if errClose != nil {
fmt.Printf("[WARNING] Can't create: %s - %v\n", destination, errClose)
}
_, errCopy := io.Copy(out, in)
if errCopy != nil {
fmt.Printf("[WARNING] Can't install launcher - %v\n", errCopy)
}
defer in.Close()
defer out.Close()
return errOpen, errClose, errCopy
}
func copyActiveLaunchers(launchers []launcher, packages []string) {
for _, l := range launchers {
for _, p := range packages {
if l.deb == p {
copyLauncher(l.path, fmt.Sprintf("/usr/share/applications/%s", l.filename))
}
}
}
}
#!/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);