olacabs / jackhammer

Jackhammer - One Security vulnerability assessment/management tool to solve all the security team problems.
https://jch.olacabs.com/userguide
Other
718 stars 162 forks source link

Jackhammer build done successfully. But how to access the appliaiton #72

Open sampathmende opened 6 years ago

sampathmende commented 6 years ago

I have run initial setup of jackahammer application after 2 months of effort. Finally today build ran successfully and got message jackhammer is up and running. then I restarted with below commands docker-compose stop docker-compose rm docker-compose up -d

Then I tried to access the application with url localhost:5000 but getting error message page cannot be displayed This site can’t be reached localhost refused to connect. Did you mean http://localhost3000.org/? Search Google for localhost 3000 ERR_CONNECTION_REFUSED

Tried on another port with localhost:3000 got same message Please help to access the application By the way I am on windows 8.1 and installed docker toolbox with oracle virtual box on windows Thanks in adavance, Sampath

kmadhusudhan commented 6 years ago

you need to do port forwarding on VirtualBox

sampathmende commented 6 years ago

Dear Madhu,

Can you please elaborate as i am new to it. My machine : windows 8.1 installed docker toolbox and oracle vm on VM what commands do i need to run to port the port numbers? and how

$ docker ps CONTAINER ID IMAGE COMMAND STATUS PORTS NAMES f539c9d50fb1 jackhammer_web "bash -c 'mkdir -p t" Up 4 minutes 0.0.0.0:5000->3000/tcp jackhammer_web_1 b5a003f93d66 redis "docker-entrypoint.s" Up 4 minutes 0.0.0.0:32768->6379/tcp jackhammer_redis_1 f70001d3d221 mysql "docker-entrypoint.s" Up 3 minutes (unhealthy) 0.0.0.0:3306->3306/tcp jackhammer-db

sampathmende commented 6 years ago

I ran the below command for port forwarding on

1 Docker (on windows machine host)

$ docker run -d -p 5000:3000 --name jackhammer_web_1 jackhammer_web C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: Conflict. The container name "/jackhammer_web_1" is already in use by container "f539c9d50fb1efe6f8f8f865e61 0390028b55f51ce9522c106e84273ddf99bde". You have to remove (or rename) that container to be able to reuse that name. See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

2 On Vm also the same command got the error attached screenshot

virtualbox_default_31_01_2018_13_31_56

kmadhusudhan commented 6 years ago

you can follow steps from http://blog.johannesmp.com/2017/01/25/port-forwarding-ssh-from-virtualbox/ or https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/

sampathmende commented 6 years ago

Dear Madhu and Team, Finally I able to see jackhammer application login screen. Thankyou for help. But default credentials are not working. This is not single user mode build. sudo sh ./docker-build.sh When i tried to login with default credentials i am getting invalid email or password error. I tried to register for new user but Team dropdown not showing anything and its empty box. Pls suggest. untitled

And how to install gem morcha ?? will it cause malfunctioning the jackhammer ?? if so how to install it pls specify the path as the commands are not working.

kmadhusudhan commented 6 years ago

please run this query in a db User.create(name: 'jackhammer',email: "jackhammer@olacabs.com",password: "j4ckh4mm3r", is_admin?: true)

sampathmende commented 6 years ago

How to run sir ? Kindly help ! windows host machine and oracle vm guest machine Do i need to use docker terminal to run these commands?? whats the path?? How to access the DB from docker terminal on host machine??

kmadhusudhan commented 6 years ago

1) Login to web docker from virtual box by running docker exec -it jackhammer_web bash 2) go to rails console by running rails c 3) copy and paste given statement in console

sampathmende commented 6 years ago

I ran the command on rails c console as suggested . it executed the command showed commit success message. Then i restarted the docker container with docker compose docker-compose stop docker-compose rm docker-compose up -d After that i tried to login but getting same invalid email or password error. How can i make sure whether user record its there in db ?? I used User.find(1) but shows no active record exists pls see the image below. By the way i have used my email id and some other password in the query. pls suggest untitled1 untitled2

kmadhusudhan commented 6 years ago

User.first or User.last run this from rails console

sampathmende commented 6 years ago

Thanks madhu its up and running i able to login to application can see the user interface. Thanks a lot. Now I added Team and added the new project url to it by going to Add Target-Scan web target - chose the team and add the url . After sometime it showed the results/findings Issue#1 : But how can i ensure whether is scanning the app?? Issue#2 :Starting jackhammer-db ... done Starting jackhammer_redis_1 ... done Could not find gem 'mocha (~> 0.14.0)' in any of the gem sources listed in your Gemfile. Run bundle install to install missing gems Initially wen I do setup and giving the build i got above error. whats the impact of this?? how can i install that??

kmadhusudhan commented 6 years ago

scan status will show scanning if it is scanning ,if you want see the logs run tail -f log/sidekiq.log from web docker

sampathmende commented 6 years ago

capture22 what is webdocker ?? the command is not running docker termincal ?? I added the urls to scan but its showing scan in progress. after scan is complete its not showing any results. showing 0 findings.

sampathmende commented 6 years ago

I run the sidekiq command getting below log

"} 2018-02-01T09:06:52.929Z 70 TID-gmzhxf0n4 WARN: TypeError: no implicit conversion of nil into String 2018-02-01T09:06:52.929Z 70 TID-gmzhxf0n4 WARN: /home/app/app/workers/dynamic_scan_worker.rb:71:in exist?' /home/app/app/workers/dynamic_scan_worker.rb:71:inensure in perform' /home/app/app/workers/dynamic_scan_worker.rb:82:in perform' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:167:inexecute_job' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:139:in block (5 levels) in process' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq.rb:36:inblock in ' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:135:in block (4 levels) in process' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:128:inblock in invoke' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-status-0.7.0/lib/sidekiq-status/server_middleware.rb:37:in call' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/server/active_record.rb:6:in call' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-middleware-0.3.0/lib/sidekiq-middleware/server/unique_jobs.rb:18:in ca /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-statistic-1.2.0/lib/sidekiq/statistic/middleware.rb:10:in call' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/server/logging.rb:10:in call' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-retries-0.4.0/lib/sidekiq/retries/server/middleware.rb:15:in call' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/middleware/chain.rb:133:in invoke' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:134:inblock (3 levels) in process' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/logging.rb:32:in with_context' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:132:inblock (2 levels) in process' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:183:in stats' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:131:inblock in process' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq.rb:35:in block in <module:Sidekiq>' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:126:inprocess' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:82:in process_one' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:70:inrun' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/util.rb:17:in watchdog' /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.10/lib/sidekiq/util.rb:26:inblock in safe_thread'

kmadhusudhan commented 6 years ago

check log file for this scan , log file presents in log/scans

sampathmende commented 6 years ago

Pls find scan folder logs. which is something selenium webdriver is causing the issue while reporting error. reporterror

sampathmende commented 6 years ago

hi Pls find the sidekiq log

for almost last half an hour its showing below log in sidekq.log Loading scanner... Mounting https://test.up.epramaan.cdacmumbai.in/ with # Mounted https://test.up.epramaan.cdacmumbai.in/ with # Processing target...https://test.up.epramaan.cdacmumbai.in/ Running tasks in stage: wait Running tasks in stage: mount Running tasks in stage: file Running tasks in stage: code code - Arachni - #

can you pls tell me now whether its scanning or stopped??

sampathmende commented 6 years ago

is there any update madhu??? I started this scan yesterday 4 pm (01-Feb-2018). Today i came to office(02-Feb-9.20 AM) and checked still its showing scannng under progress.So there is a bug in jackhammer or scripts. which is actually not scanning it seems. P