Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sampathmende opened this issue Jan 30, 2018 · 18 comments
Open

Comments

@sampathmende
Copy link

sampathmende commented Jan 30, 2018

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
Copy link
Contributor

you need to do port forwarding on VirtualBox

@sampathmende
Copy link
Author

sampathmende commented Jan 31, 2018

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
Copy link
Author

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

@sampathmende
Copy link
Author

sampathmende commented Jan 31, 2018

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
Copy link
Contributor

kmadhusudhan commented Jan 31, 2018

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

@sampathmende
Copy link
Author

sampathmende commented Jan 31, 2018

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
Copy link
Contributor

  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
Copy link
Author

sampathmende commented Feb 1, 2018

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
Copy link
Contributor

kmadhusudhan commented Feb 1, 2018

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

@sampathmende
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

sampathmende commented Feb 1, 2018

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
Copy link
Author

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:in ensure 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:in execute_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: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: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:in block 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:in block 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:in block 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:in block 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:in block 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:in block 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:in block 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:in block (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:in block (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:in block 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:in process'
/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:in run'
/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:in block in safe_thread'

@kmadhusudhan
Copy link
Contributor

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

@sampathmende
Copy link
Author

sampathmende commented Feb 1, 2018

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

@sampathmende
Copy link
Author

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 #Pipeline::URLMounter:0x007ff29c0786b8
Mounted https://test.up.epramaan.cdacmumbai.in/ with #Pipeline::URLMounter:0x007ff29c0786b8
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 - #Set:0x007ff2a81fa818

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

@sampathmende
Copy link
Author

sampathmende commented Feb 1, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants