mitmproxy2swagger icon indicating copy to clipboard operation
mitmproxy2swagger copied to clipboard

command not found

Open alex-niht opened this issue 1 year ago • 9 comments

I'm installing on an updated, upgraded VMware instance of kali Linux. Busy with the apisec api penetration testing course.

Used pip3 to install into the/opt/ directory. If I use the command to run the flow through mitmproxy2swagger it keeps saying: command not found.

alex-niht avatar Jun 20 '24 19:06 alex-niht

I am experiencing the same issue as well, have you been able to get a work-around outside github?

NelsonOmoniyi avatar Jun 21 '24 15:06 NelsonOmoniyi

No I haven't managed to get this to work.
Error Message I keep getting: Using cached mitmproxy2swagger-0.13.0-py3-none-any.whl (15 kB) Using cached aioquic-0.9.25-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB) Using cached asgiref-3.7.2-py3-none-any.whl (24 kB) Installing collected packages: asgiref, aioquic, mitmproxy2swagger Attempting uninstall: asgiref Found existing installation: asgiref 3.8.1 ERROR: Cannot uninstall asgiref 3.8.1, RECORD file not found. Hint: The package was installed by debian.

I have tried to use a docker container, python venv environment and still no luck. I even reloaded a new kali vm instance, same error... as well as on parrot os... I really don't know what more to try.. or if I'm doing something wrong. I initially kept getting python asigref errors, but in the parrot os when I created a python virtual environment it installed perfectly but as soon as I input the command to run the flow through mitmproxy2swagger it keeps saying mitmproxy2swagger command not found...

alex-niht avatar Jun 22 '24 05:06 alex-niht

I am also facing the same error. Trying to solve it from last 3 days

khargosh99 avatar Jul 04 '24 11:07 khargosh99

I also haven't managed to make it work. The best bet would be to learn how to use the docker container method. I managed to get it set up in a container, but I don't know much about Docker, so another thing to learn and master.... Iv only just started to learn and use Linux so I guess its all about the learning curve..

alex-niht avatar Jul 05 '24 06:07 alex-niht

Hi, I had the same issue. I received this warning:

WARNING: The script mitmproxy2swagger is installed in '/home/kali/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

I moved the install to /usr/local/bin and the command is now found.

sudo mv /home/kali/.local/bin/mitmproxy2swagger /usr/local/bin

josephotrust avatar Jul 17 '24 18:07 josephotrust

Getting same error but them i tried to install it using docker here is my process $ git clone [email protected]:alufers/mitmproxy2swagger.git $ cd mitmproxy2swagger $ docker build -t mitmproxy2swagger . $ sudo docker run --rm mitmproxy2swagger -h

This worked well UNTIL i got the error

$ sudo docker run --rm mitmproxy2swagger -i ../flows -o spec.yml -p http://[URL] -f flow No existing swagger file found. Creating new one. Traceback (most recent call last): File "/venv/bin/mitmproxy2swagger", line 8, in sys.exit(main()) File "/venv/lib/python3.10/site-packages/mitmproxy2swagger/mitmproxy2swagger.py", line 179, in main for req in capture_reader.captured_requests(): File "/venv/lib/python3.10/site-packages/mitmproxy2swagger/mitmproxy_capture_reader.py", line 112, in captured_requests with open(self.file_path, "rb") as logfile: FileNotFoundError: [Errno 2] No such file or directory: '../flows'

File is there but still showing this error

vikas9452 avatar Jul 28 '24 15:07 vikas9452

Same issue here, and I use windows with Python 3.1

Anpilaot avatar Sep 23 '24 11:09 Anpilaot

Was facing the same problem.

Create a python venv then pip install it in there: python3 -m venv mitmproxy_venv

Then activate the venv: source mitmproxy_venv/bin/activate

Now run: pip3 install mitmproxy2swagger

As long as you're in that venv you can run the normal commands.

To jump out of the venv just run 'deactivate'.

realp05h avatar Nov 09 '24 00:11 realp05h

I have built an equivalent of this tool in case anyone needs another approach https://github.com/AndrewWalsh/demystify

AndrewWalsh avatar Mar 19 '25 06:03 AndrewWalsh