1N3 / Sn1per

Attack Surface Management Platform
https://sn1persecurity.com
Other
7.93k stars 1.82k forks source link

Pro Commands will not run after update #281

Closed researchlab17 closed 4 years ago

researchlab17 commented 4 years ago

I am having an issue with the pro console commands not running after updating, as soon as I click Scan or Run any type of command it immediately acts like the job is complete and says Command Executed.

Any help? Running Sniper 8.6 and Pro with ALL the purchased Add-Ons

image

researchlab17 commented 4 years ago

Also running in FireFox as I am aware of the Chrome issues, tried both in Root and standard user with elevated privileges.

1N3 commented 4 years ago

Is it just the command execution add-on portion that isn't working now (ie. Does the Pro UI display fine still)?

What happens when you run 'sudo sniper -w google --reimportall' from the command line? Any errors?

Lastly, I would also check your /usr/share/sniper/pro/error.log to see if any errors are reported after running a command from the Pro UI. If you could send anything relevant, that would help as well.

researchlab17 commented 4 years ago

UI seems to be working perfect, when running commands from terminal no issues whatsoever either, same result from another VM instance on the same network.

Here is the last few lines from error log after trying to run test commands

[Tue Aug 11 10:02:10.355769 2020] [php7:notice] [pid 1400] [client 127.0.0.1:40562] PHP Notice: A non well formed numeric value encountered in /usr/share/sniper/pro/workspace-report.php on line 20, referer: https://127.0.0.1:1337/pro/workspace-navigator.php [Tue Aug 11 10:02:10.355888 2020] [php7:notice] [pid 1400] [client 127.0.0.1:40562] PHP Notice: A non well formed numeric value encountered in /usr/share/sniper/pro/workspace-report.php on line 20, referer: https://127.0.0.1:1337/pro/workspace-navigator.php [Tue Aug 11 10:02:10.361685 2020] [php7:notice] [pid 1400] [client 127.0.0.1:40562] PHP Notice: Undefined index: show in /usr/share/sniper/pro/workspace-report.php on line 196, referer: https://127.0.0.1:1337/pro/workspace-navigator.php [Tue Aug 11 10:02:16.892967 2020] [php7:notice] [pid 1401] [client 127.0.0.1:40564] PHP Notice: Undefined index: target in /usr/share/sniper/pro/addons/server-workspace.php on line 11, referer: https://127.0.0.1:1337/pro/workspace-report.php?workspace=google [Tue Aug 11 10:11:36.144815 2020] [php7:notice] [pid 1397] [client 127.0.0.1:40642] PHP Notice: Undefined index: target in /usr/share/sniper/pro/addons/server-workspace.php on line 11, referer: https://127.0.0.1:1337/pro/workspace-report.php?workspace=google [Tue Aug 11 12:01:35.566786 2020] [php7:notice] [pid 1398] [client 127.0.0.1:38228] PHP Notice: Undefined index: target in /usr/share/sniper/pro/addons/server-workspace.php on line 11, referer: https://127.0.0.1:1337/pro/workspace-report.php?workspace=google [Tue Aug 11 12:01:46.338028 2020] [php7:notice] [pid 1399] [client 127.0.0.1:38234] PHP Notice: Undefined index: target in /usr/share/sniper/pro/addons/server-workspace.php on line 11, referer: https://127.0.0.1:1337/pro/workspace-report.php?workspace=google [Tue Aug 11 12:04:46.827412 2020] [php7:notice] [pid 1400] [client 127.0.0.1:38246] PHP Notice: Undefined index: target in /usr/share/sniper/pro/addons/server-workspace.php on line 11, referer: https://127.0.0.1:1337/pro/workspace-report.php?workspace=google

1N3 commented 4 years ago

Thanks. Looks like the PHP stuff are just notices and not anything that would stop it from working.

Can you try the following?

  1. Check if www-data is still in /etc/sudoers:
    grep www /etc/sudoers
    www-data ALL=(ALL:ALL) NOPASSWD:ALL
  2. Set permissions on all Sn1per files again:
    chown root:www-data -Rf /usr/share/sniper/
    usermod -aG root www-data
    usermod -aG sudo www-data
    chmod 775 -Rf /usr/share/sniper/
    chmod 4775 /usr/share/sniper/sniper

After, try running the reimport command again to see if that worked.

researchlab17 commented 4 years ago

blank results

resetting the permissions still having the same result on both machines

This just started recently so I bet others are about to have the same issue.

researchlab17 commented 4 years ago

The status command works but nothing else will actually execute.

1N3 commented 4 years ago

Thanks again for the info. It sounds like something has removed the ability for Apache (the www-data) user from executing sudo commands which most of Sn1per's commands require 'root' to run with the exception of the --status command.

Which OS are you running? Is it the latest Kali 2020.2 release or ?

researchlab17 commented 4 years ago

Latest Kali 2020.2 on the server and latest Parrot on the test VM

1N3 commented 4 years ago

I compared the installer for v8.5 compared to v8.6 and the biggest/only change that might affect this is the upgrade to PHP 7.4.

In v8.5, the commands were:

apt-get install -y php
apt-get install -y php-curl

In v8.6, the commands were changed to:

apt-get install -y php7.4
apt-get install -y php7.4-curl

Can you please try the following to refresh the PHP installation? I've found that older PHP versions can interfere with newer versions installed on the same system, so this will confirm if this is the issue or not.

dpkg -l | grep php | tee /tmp/packages.txt 2> /dev/null
for a in `dpkg -l | grep php | awk '{print $2}'`; do apt purge -y $a; done;
apt install -y php7.4 php7.4-common php7.4-cli php7.4-xml apache2 libapache2-mod-php
/etc/init.d/apache2 restart
researchlab17 commented 4 years ago

That broke things. lol

image

1N3 commented 4 years ago

Sorry about that.. it shouldn't be too hard to restore but I kinda need to see the output from the following command:

dpkg -l | grep php
researchlab17 commented 4 years ago

Tried reinstalling Pro (same result, then "rebroke" things. Here's the output

dpkg -l | grep php ii libapache2-mod-php 2:7.4+76 all server-side, HTML-embedded scripting language (Apache 2 module) (default) ii libapache2-mod-php7.4 7.4.5-1+b1 amd64 server-side, HTML-embedded scripting language (Apache 2 module) ii php-common 2:76 all Common files for PHP packages ii php7.4 7.4.5-1 all server-side, HTML-embedded scripting language (metapackage) ii php7.4-cli 7.4.5-1+b1 amd64 command-line interpreter for the PHP scripting language ii php7.4-common 7.4.5-1+b1 amd64 documentation, examples and common module for PHP ii php7.4-json 7.4.5-1+b1 amd64 JSON module for PHP ii php7.4-opcache 7.4.5-1+b1 amd64 Zend OpCache module for PHP ii php7.4-readline 7.4.5-1+b1 amd64 readline module for PHP ii php7.4-xml 7.4.5-1+b1 amd64 DOM, SimpleXML, XML, and XSL module for PHP

1N3 commented 4 years ago

Can you email support@xerosecurity.com with your license key please? I would like to try and re-install from a fresh Kali image using your specific license key to verify. I just re-tested from a fresh Kali image using my own key, but everything is working fine on my end.

1N3 commented 4 years ago

Did you ever get this working? I tested this on both a fresh Kali 2020.2 and ParrotOS 7.4 image and both seem to be fine.

1N3 commented 4 years ago

Had someone else run into this and were able to resolve this with the following commands:

apt-get install php php-curl php-pear php-mysql
apt install -y php7.4 php7.4-common php7.4-cli php7.4-xml apache2 libapache2-mod-php

Let me know if that doesn't work and I'll re-open, but I'm pretty sure this will work.

GraylockInc commented 4 years ago

I am having the same issue, no results, no action, just he spinning blue circle.

image

1N3 commented 4 years ago

@GraylockInc If you're web UI displays okay, this is likely a separate issue. I opened a new issue to track this here: https://github.com/1N3/Sn1per/issues/287