Comments (14)
Saw same issue in closed, will try solution there.
from poshc2.
nickkilla@box:~$ sudo posh
Traceback (most recent call last):
File "start.py", line 8, in
run()
File "/opt/PoshC2/poshc2/init.py", line 10, in run
client.start()
File "/opt/PoshC2/poshc2/client/init.py", line 5, in start
from poshc2.client.command_handlers.ImplantHandler import main
File "/opt/PoshC2/poshc2/client/command_handlers/ImplantHandler.py", line 5, in
from poshc2.server.DB import update_item, get_c2server_all, get_implants_all, get_tasks, get_implantdetails, new_urldetails
File "/opt/PoshC2/poshc2/server/DB.py", line 4, in
from poshc2.server.Config import Database
File "/opt/PoshC2/poshc2/server/Config.py", line 1, in
import os, yaml
ModuleNotFoundError: No module named 'yaml'
from poshc2.
So tried the steps in the other Yaml closed issue. I did the pip install requirements and redid the ./Install and still shows no yaml when trying to run posh lister
from poshc2.
Not sure if this is the issue
Package libicu63 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libicu63' has no installation candidate
from poshc2.
I had the same issue (I didn't see the libicu63 problem). After running python3 -m pip install --force-reinstall -r requirements.txt
it showed that PyYAML had been installed by distutils and couldn't be installed by pip. So I did apt remove PyYAML
, re-ran the pip command, and updated posh. It worked for me. I am using the docker install.
Warning, if you see this in the next few hours, see my other issue regarding the kali docker build.
Edit: there's probably a better way to do this, i.e., tell pip or pipenv or whatever to use the system PyYAML, but this was the quickest fix.
from poshc2.
Thanks @clhefton. @nickkilla are you able to confirm if this fixed the issue?
Unfortunately we can't account for what's installed on the OS and if it clashes. You can try docker if it still doesn't work.
from poshc2.
@m0rv4i this issue happens with the docker installation. I don't know about the normal one. I just re-tried the fix I mentioned and I'm not sure how it happened the first time, but it didn't work this time.
Different fix.
@nickkilla I did actually notice the libicu63 error but it doesn't affect anything. The root issue is actually with pipenv somehow not calling the right python, even though I only have one on my system. Maybe it was using some random version within the docker build and that version can't find anything installed with pip?
To get it to work, in /usr/bin/posh-server, change the following:
python3 -m pipenv run python3 -u start.py --server 2>&1 | tee -a "$POSH_PROJECT_DIR/poshc2_server.log"
to:
python3 -m /usr/bin/pipenv run python3 -u start.py --server 2>&1 | tee -a "$POSH_PROJECT_DIR/poshc2_server.log"
from poshc2.
@clhefton The solution yesterday solved the issue.
from poshc2.
I have hitting my head against this issue and trying to work through it and suddenly realised that I was running Install.sh as non-priv user with sudo... This sets up a Virtualenv for the low-priv user which means when you come to run the service as root it can't find the libraries.
It might be a good idea to stick a flag in Install.sh for "don't use sudo" or to change the venv creation process to cope. Off the top of my head though, I don't know how to do this...
(edited for grammar)
from poshc2.
I agree I think I need to investigate the sudo/pipenv behaviour, will add that to the shortlist
from poshc2.
@yg-ht i'm actually confused a little by your last comment, as if you're using a none-priv user and sudo to install the script then are you not using that same low privileged user to run PoshC2 (using sudo again)? If so it should be using the same environment. Either way it would be recommended to use the same technique for installing and running PoshC2.
Having done some testing across OSs and users, my observations are:
- Running install as sudo creates the virtual environment under /root
- Running
posh-
commands using sudo uses the same virtualenv and it works - Running the
posh-
commands without sudo or as a different user doesn't work, as the virtual env is not set up for that user
Is that inline with what you're seeing?
from poshc2.
from poshc2.
Because postgresql is supported in the configuration, and postgresql is not installed in Kali, an error is reported during the automatic installation process because psycopg2 is not installed successfully.
The solution is as follows:
apt-get install postgresql
apt-get install python-psycopg2
apt-get install libpq-dev
python3 -m pip install --force-reinstall -r requirements.txt
from poshc2.
👍 thanks ramoncjs3
from poshc2.
Related Issues (20)
- [BUG] - PwrStatusMonitoring is not working
- [BUG] - SharpSocks not currently working - libhostfxr.so could not be found HOT 2
- [BUG] - Package 'libicu63' has no installation candidate HOT 1
- [BUG] PoshC2 Init while creating Donut payload fails HOT 2
- [BUG] PY_SSIZE_T_CLEAN macro must be defined for '#' formats HOT 3
- [BUG] Python 3.10 Compatibility
- [BUG] macOS JXA/JS implant doesn't check in
- [FEATURE] Command output in Implant Handler Process
- [BUG]
- [BUG] download-file command via PBind-Sharp pivot is broken
- [FEATURE] OneDrive and Google Drive As C2
- [BUG]Implants only connecting via TLSv1 causing fatal negotation error. HOT 3
- Linux implant ("native_dropper") not proceed to stage 2
- Posh Server doesn't start because of missing python modules; e.g. yaml HOT 3
- [FEATURE] Tagging Beacons & More
- [BUG] HOT 2
- [BUG]
- [BUG] - python3: No module named pipenv
- [BUG] - enable-rotation in implant issue HOT 1
- Add custom URLs option for the UrlConfig config.yml attribute
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poshc2.