How to setup API security testing Lab with - Crapi - MAC SILICON Chip
If you are going to learn penetration testing then someday you need to setup this machine for practise purpose.
I am writing this blog because you also might not wish to use kali linux and directly want to install crapi on your mac
So Here are the steps:
.
davinder@Davinders-MacBook-Air ~ % ls
Applications Personal Work
Desktop Pictures bugbounty
Documents Projects codeql
Downloads Public go
Library PycharmProjects nuclei-templates
Movies Sites sonarqube
Music Study
First I created one folder with name api
davinder@Davinders-MacBook-Air ~ % mkdir api
Inside api i created one more folder lab
After I go inside the lab folder and run commands as follows
davinder@Davinders-MacBook-Air lab % curl -o docker-compose.yaml https://raw.githubusercontent.com/OWASP/crAPI/main/deploy/docker/docker-compose.yml
Result:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7310 100 7310 0 0 16099 0 --:--:-- --:--:-- --:--:-- 16353
After i crated one more directory as:
davinder@Davinders-MacBook-Air lab % mkdir crapi
davinder@Davinders-MacBook-Air lab % mv docker-compose.yaml crapi
davinder@Davinders-MacBook-Air lab % cd crapi
davinder@Davinders-MacBook-Air crapi % sudo docker-compose pull
Password:
[+] Pulling 0/8
⠼ postgresdb Pulling 0.5s
⠼ crapi-identity Pulling 0.5s
⠼ crapi-community Pulling 0.5s
⠼ crapi-workshop Pulling 0.5s
⠼ crapi-web Pulling 0.5s
⠼ mailhog Pulling 0.5s
⠼ api.mypremiumdealership.com Pulling 0.5s
[+] Pulling 0/8ing 0.5s
⠴ postgresdb Pulling 0.5s
⠴ crapi-identity Pulling 0.5s
⠴ crapi-community Pulling 0.5s
⠴ crapi-workshop Pulling 0.5s
⠴ crapi-web Pulling 0.5s
⠴ mailhog Pulling 0.5s
⠴ api.mypremiumdealership.com Pulling 0.5s
⠴ mongodb Pulling 0.5s
error getting credentials - err: exit status 1, out: ``
Here comes one error: I entered my mac password, but its not working. Thanks to the post:
MacOS - I just had to change the docker config file.
The “credsStore” was “desktop” and changed it to “osxkeychain”.
used nano to do it. sudo nano ~/.docker/config.json
https://forums.docker.com/t/error-failed-to-solve-error-getting-credentials-err-exit-status-1-out/136124/5
It worked :)
Then run the following commands:
davinder@Davinders-MacBook-Air crapi % sudo nano ~/.docker/config.json
davinder@Davinders-MacBook-Air crapi % sudo docker-compose pull
[+] Pulling 75/8
✔ mailhog Pulled 52.3s
✔ mongodb Pulled 48.4s
✔ crapi-web Pulled 48.4s
✔ crapi-community Pulled 61.7s
✔ api.mypremiumdealership.com Pulled 62.4s
✔ crapi-identity Pulled 34.0s
✔ crapi-workshop Pulled 30.4s
✔ postgresdb Pulled 17.6s
davinder@Davinders-MacBook-Air crapi % sudo docker-compose -f docker-compose.yaml --compatibility up -d
[+] Running 11/11
✔ Network crapi_default Created 0.1s
✔ Volume "crapi_postgresql-data" Created 0.0s
✔ Volume "crapi_mongodb-data" Created 0.0s
✔ Container api.mypremiumdealership.com Started 0.1s
✔ Container postgresdb Healthy 0.1s
✔ Container mailhog Started 0.1s
✔ Container mongodb Healthy 0.1s
✔ Container crapi-identity Healthy 0.1s
✔ Container crapi-community Healthy 0.0s
✔ Container crapi-workshop Healthy 0.1s
✔ Container crapi-web Started 0.1s
Finally its running on 127.0.0.1:8025