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

Problem installing the jackhammer on windows 7 #7

Open shinankit opened 7 years ago

shinankit commented 7 years ago

bundle.sh: line 13: syntax error: unexpected end of file ERROR: Service 'web' failed to build: The command '/bin/sh -c bash bundle.sh' re turned a non-zero code: 2

NitescuLucian commented 7 years ago

Could you try to apply the fix for #4 error?

shinankit commented 7 years ago

It didnt work what I did is just removed until loop and replaced it with bundle install --jobs 4 but now it is running but um getting something like this and I dont know where will be the issue

We're sorry, but something went wrong. If you are the application owner check the logs for more information.

please help me out with this issue

NitescuLucian commented 7 years ago

Perfect! As wierd as it may sound. Do what I did on #6 and wait a few minutes.

shinankit commented 7 years ago

I tried it n number of times so what happens is, for almost 5-10 minutes it keeps on loading and suddenly is shows the error and then its done nothing else happens, I am trying since today morning I uninstalled it couple of times and tried it but the result is same need immediate help

NitescuLucian commented 7 years ago

For me it replaced the error page with the Jackhammer ... Could you run the following commands and privide a snip of the logs?

docker-compose stop
docker-compose rm
docker-compose up

It is without "-d".

shinankit commented 7 years ago

Creating jackhammer_redis_1 Creating jackhmmaer-db Creating jackhammer_web_1 Attaching to jackhammer_redis_1, jackhmmaer-db, jackhammer_web_1 redis_1 | 1:C 12 May 12:10:58.272 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/ redis.conf jackhmmaer-db | Initializing database jackhmmaer-db | 2017-05-12T12:10:58.672199Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). jackhmmaer-db | 2017-05-12T12:10:59.083455Z 0 [Warning] InnoDB: New log files cr eated, LSN=45790 jackhmmaer-db | 2017-05-12T12:10:59.137814Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. jackhmmaer-db | 2017-05-12T12:10:59.200612Z 0 [Warning] No existing UUID has bee n found, so we assume that this is the first time that this server has been star ted. Generating a new UUID: 0f2fa769-370c-11e7-9763-0242ac120003. jackhmmaer-db | 2017-05-12T12:10:59.201965Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. jackhmmaer-db | 2017-05-12T12:10:59.202292Z 1 [Warning] root@localhost is create d with an empty password ! Please consider switching off the --initialize-insecu re option. jackhmmaer-db | 2017-05-12T12:10:59.933134Z 1 [Warning] 'user' entry 'root@local host' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:10:59.933264Z 1 [Warning] 'user' entry 'mysql.sys@ localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:10:59.933300Z 1 [Warning] 'db' entry 'sys mysql.sy s@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:10:59.933325Z 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:10:59.933378Z 1 [Warning] 'tables_priv' entry 'sys _config mysql.sys@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | Database initialized jackhmmaer-db | Initializing certificates jackhmmaer-db | Generating a 2048 bit RSA private key jackhmmaer-db | ................................................................ ..............................................+++ jackhmmaer-db | ........+++ jackhmmaer-db | unable to write 'random state' jackhmmaer-db | writing new private key to 'ca-key.pem' jackhmmaer-db | ----- jackhmmaer-db | Generating a 2048 bit RSA private key jackhmmaer-db | ................................................................ ................................................................+++ jackhmmaer-db | ................................................................ .+++ jackhmmaer-db | unable to write 'random state' jackhmmaer-db | writing new private key to 'server-key.pem' jackhmmaer-db | ----- jackhmmaer-db | Generating a 2048 bit RSA private key jackhmmaer-db | ......................+++ jackhmmaer-db | ................................................................ .........+++ jackhmmaer-db | unable to write 'random state' jackhmmaer-db | writing new private key to 'client-key.pem' jackhmmaer-db | ----- jackhmmaer-db | Certificates initialized jackhmmaer-db | MySQL init process in progress... jackhmmaer-db | 2017-05-12T12:11:04.972592Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). jackhmmaer-db | 2017-05-12T12:11:04.981789Z 0 [Note] mysqld (mysqld 5.7.18) star ting as process 107 ... jackhmmaer-db | 2017-05-12T12:11:04.990127Z 0 [Note] InnoDB: PUNCH HOLE support available jackhmmaer-db | 2017-05-12T12:11:04.990248Z 0 [Note] InnoDB: Mutexes and rw_lock s use GCC atomic builtins jackhmmaer-db | 2017-05-12T12:11:04.990267Z 0 [Note] InnoDB: Uses event mutexes jackhmmaer-db | 2017-05-12T12:11:04.990284Z 0 [Note] InnoDB: GCC builtin __atomi c_thread_fence() is used for memory barrier jackhmmaer-db | 2017-05-12T12:11:04.990296Z 0 [Note] InnoDB: Compressed tables u se zlib 1.2.3 jackhmmaer-db | 2017-05-12T12:11:04.990308Z 0 [Note] InnoDB: Using Linux native AIO jackhmmaer-db | 2017-05-12T12:11:04.990542Z 0 [Note] InnoDB: Number of pools: 1 jackhmmaer-db | 2017-05-12T12:11:04.990656Z 0 [Note] InnoDB: Using CPU crc32 ins tructions jackhmmaer-db | 2017-05-12T12:11:04.992452Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M jackhmmaer-db | 2017-05-12T12:11:05.007090Z 0 [Note] InnoDB: Completed initializ ation of buffer pool jackhmmaer-db | 2017-05-12T12:11:05.010014Z 0 [Note] InnoDB: If the mysqld execu tion user is authorized, page cleaner thread priority can be changed. See the ma n page of setpriority(). jackhmmaer-db | 2017-05-12T12:11:05.021998Z 0 [Note] InnoDB: Highest supported f ile format is Barracuda. jackhmmaer-db | 2017-05-12T12:11:05.044590Z 0 [Note] InnoDB: Creating shared tab lespace for temporary tables jackhmmaer-db | 2017-05-12T12:11:05.046542Z 0 [Note] InnoDB: Setting file './ibt mp1' size to 12 MB. Physically writing the file full; Please wait ... jackhmmaer-db | 2017-05-12T12:11:05.187609Z 0 [Note] InnoDB: File './ibtmp1' siz e is now 12 MB. jackhmmaer-db | 2017-05-12T12:11:05.188877Z 0 [Note] InnoDB: 96 redo rollback se gment(s) found. 96 redo rollback segment(s) are active. jackhmmaer-db | 2017-05-12T12:11:05.188937Z 0 [Note] InnoDB: 32 non-redo rollbac k segment(s) are active. jackhmmaer-db | 2017-05-12T12:11:05.189346Z 0 [Note] InnoDB: Waiting for purge t o start jackhmmaer-db | 2017-05-12T12:11:05.239850Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 2535558 jackhmmaer-db | 2017-05-12T12:11:05.240148Z 0 [Note] Plugin 'FEDERATED' is disab led. jackhmmaer-db | 2017-05-12T12:11:05.244628Z 0 [Note] Found ca.pem, server-cert.p em and server-key.pem in data directory. Trying to enable SSL support using them . jackhmmaer-db | 2017-05-12T12:11:05.247501Z 0 [Note] InnoDB: Loading buffer pool (s) from /var/lib/mysql/ib_buffer_pool jackhmmaer-db | 2017-05-12T12:11:05.249745Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170512 12:11:05 jackhmmaer-db | 2017-05-12T12:11:05.252763Z 0 [Warning] CA certificate ca.pem is self signed. jackhmmaer-db | 2017-05-12T12:11:05.266131Z 0 [Warning] 'user' entry 'root@local host' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:05.266263Z 0 [Warning] 'user' entry 'mysql.sys@ localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:05.266301Z 0 [Warning] 'db' entry 'sys mysql.sy s@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:05.266323Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:05.268046Z 0 [Warning] 'tables_priv' entry 'sys _config mysql.sys@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:05.279452Z 0 [Note] Event Scheduler: Loaded 0 e vents jackhmmaer-db | 2017-05-12T12:11:05.281784Z 0 [Note] mysqld: ready for connectio ns. jackhmmaer-db | Version: '5.7.18' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL) jackhmmaer-db | 2017-05-12T12:11:05.281887Z 0 [Note] Executing 'SELECT FROM IN FORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to sk ip this check. jackhmmaer-db | 2017-05-12T12:11:05.281903Z 0 [Note] Beginning of list of non-na tively partitioned tables jackhmmaer-db | 2017-05-12T12:11:05.301767Z 0 [Note] End of list of non-natively partitioned tables jackhmmaer-db | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as tim e zone. Skipping it. jackhmmaer-db | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. jackhmmaer-db | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time z one. Skipping it. jackhmmaer-db | 2017-05-12T12:11:11.005341Z 5 [Warning] 'user' entry 'root@local host' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:11.005520Z 5 [Warning] 'user' entry 'mysql.sys@ localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:11.005574Z 5 [Warning] 'db' entry 'sys mysql.sy s@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:11.005598Z 5 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | 2017-05-12T12:11:11.005642Z 5 [Warning] 'tables_priv' entry 'sys _config mysql.sys@localhost' ignored in --skip-name-resolve mode. jackhmmaer-db | mysql: [Warning] Using a password on the command line interface can be insecure. jackhmmaer-db | mysql: [Warning] Using a password on the command line interface can be insecure. jackhmmaer-db | ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for ' root'@'%' web_1 | Puma starting in single mode... web_1 | Version 2.14.0 (ruby 2.3.0-p0), codename: Fuchsia Friday web_1 | Min threads: 0, max threads: 16 web_1 | Environment: production web_1 | /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rb-readline-0. 5.1/lib/readline.rb:458: warning: already initialized constant Readline::HISTORY

web_1 | /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rb-readline-0. 5.1/lib/readline.rb:486: warning: already initialized constant Readline::FILENAM E_COMPLETION_PROC web_1 | /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rb-readline-0. 5.1/lib/readline.rb:517: warning: already initialized constant Readline::USERNAM E_COMPLETION_PROC web_1 | /root/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rb-readline-0. 5.1/lib/readline.rb:523: warning: already initialized constant Readline::VERSION

redis1 | ._

redis1 | .-``_ ''-.

redis1 | .-`. `_. ''-._ Redis 3.2.8 (00000000/0) 64 bit redis_1 | .- .-.\/ ., ''-._

redis_1 | ( ' , .-|, ) Running in standalone mode redis1 | |`-.-...- _...-.``-.|'_.-'| Port: 6379 redis_1 | |-. `. / _.-' | PID: 1 redis1 | `-. -._-./ .-' .-'

redis1 | |`-.-._-._.-' .-'_.-'|

redis1 | | `-.`-. .-'_.-' | http://redis.io

redis1 | `-. -._-._.-'.-' _.-'

redis1 | |`-.-._-._.-' .-'_.-'|

redis1 | | `-.`-. .-'_.-' |

redis1 | `-. -._-._.-'.-' _.-'

redis1 | `-. `-._.-' .-'

redis1 | `-. _.-'

redis_1 | `-.__.-'

redis_1 | redis_1 | 1:M 12 May 12:10:58.273 # WARNING: The TCP backlog setting of 511 c annot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. redis_1 | 1:M 12 May 12:10:58.273 # Server started, Redis version 3.2.8 redis_1 | 1:M 12 May 12:10:58.273 # WARNING overcommit_memory is set to 0! Ba ckground save may fail under low memory condition. To fix this issue add 'vm.ove rcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysc tl vm.overcommit_memory=1' for this to take effect. redis_1 | 1:M 12 May 12:10:58.273 # WARNING you have Transparent Huge Pages ( THP) support enabled in your kernel. This will create latency and memory usage i ssues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm /transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in orde r to retain the setting after a reboot. Redis must be restarted after THP is dis abled. redis_1 | 1:M 12 May 12:10:58.274 The server is now ready to accept connect ions on port 6379 redis_1 | 1:M 12 May 12:15:59.099 100 changes in 300 seconds. Saving... redis_1 | 1:M 12 May 12:15:59.107 Background saving started by pid 12 redis_1 | 12:C 12 May 12:15:59.118 DB saved on disk redis_1 | 12:C 12 May 12:15:59.120 RDB: 0 MB of memory used by copy-on-writ e redis_1 | 1:M 12 May 12:15:59.207 Background saving terminated with success

redis_1 | 1:M 12 May 12:21:00.092 100 changes in 300 seconds. Saving... redis_1 | 1:M 12 May 12:21:00.092 Background saving started by pid 13 redis_1 | 13:C 12 May 12:21:00.101 DB saved on disk redis_1 | 13:C 12 May 12:21:00.103 RDB: 0 MB of memory used by copy-on-writ e

NitescuLucian commented 7 years ago

Are you root when running the commands?

shinankit commented 7 years ago

yes running as administrator as im on windows

shinankit commented 7 years ago

I think I found the issue but not the solution This is the production.log file content which says that table jackhammer_production.users is not found and this is related to mysql now it will be easier for u to identify the solution

Logfile created on 2017-05-12 14:21:51 +0000 by logger.rb/53141

I, [2017-05-12T14:21:58.392351 #38] INFO -- : Started GET "/" for 192.168.99.1 at 2017-05-12 14:21:58 +0000 I, [2017-05-12T14:21:58.682395 #38] INFO -- : Processing by Users::SessionsCont roller#new as HTML E, [2017-05-12T14:21:58.716879 #38] ERROR -- : Some exception occured...#<Mysql2 ::Error: Table 'jackhammer_production.users' doesn't exist> I, [2017-05-12T14:21:58.732080 #38] INFO -- : Rendered errors/internal_server _error.html.erb within layouts/application (1.3ms) I, [2017-05-12T14:23:06.165817 #38] INFO -- : Completed 500 Internal Server Err or in 67480ms (ActiveRecord: 72.8ms) F, [2017-05-12T14:23:06.187480 #38] FATAL -- : ActionView::Template::Error (Mysql2::Error: Table 'jackhammer_production.session s' doesn't exist: SHOW FULL FIELDS FROM sessions): 3: Jackhammer - Vulnerability Manager 4: <%= stylesheet_link_tag 'application', media: 'all', 'data-tu rbolinks-track' => true %> 5: <%= javascript_include_tag 'application', 'data-turbolinks-track ' => true %> 6: <%= csrf_meta_tags %> 7: 8: 9: <%if user_signed_in? %> app/views/layouts/application.html.erb:6:in _app_views_layouts_application_ht ml_erb___3678677509035555483_70230265934960' app/controllers/application_controller.rb:113:inblock (2 levels) in render_5 00' app/controllers/application_controller.rb:112:in render_500' app/controllers/application_controller.rb:109:inhandle_exception' app/controllers/application_controller.rb:105:in `block in <class:ApplicationC ontroller>'

Cavallando commented 7 years ago

I may have found your solution, since Docker is technically running a linux VM there is a problem reading the .sh files that are formatted in DOS. This is what I did:

dos2unix /web/bundle.sh dos2unix docker-build.sh

After this, jackhammer started in the quickstart terminal perfectly.