-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Path changes and variable name changes made
- Loading branch information
dscarson
committed
Feb 7, 2014
1 parent
c08c01c
commit 92ab1a7
Showing
4 changed files
with
53 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
#!/usr/bin/env bash | ||
OWTF_RootDir=$1 | ||
|
||
. $(pwd)/../../../../../../../scripts/openvas/openvas_init.sh | ||
. $OWTF_RootDir/scripts/openvas/openvas_init.sh "$OWTF_RootDir" | ||
|
||
passwd=$(date +%s | base64 | head -c 10) #/dev/urandom did not work when called from owtf script,otherwise it works fine | ||
OWTF_OPENVAS_PASSWD=$(date +%s | base64 | head -c 10) #/dev/urandom did not work when called from owtf script,otherwise it works fine | ||
#Let me know if there is a wayaround | ||
|
||
update_config_setting "OPENVAS_PASS" "$passwd" | ||
update_config_setting "OPENVAS_PASS" "$OWTF_OPENVAS_PASSWD" | ||
|
||
if [ -d "/var/lib/openvas/users/admin" ]; then | ||
openvasad -c remove_user -n admin | ||
fi | ||
|
||
passwd=$passwd expect -c 'log_user 0 | ||
OWTF_OPENVAS_PASSWD=$OWTF_OPENVAS_PASSWD expect -c 'log_user 0 | ||
spawn openvasad -c add_user -n admin -r Admin | ||
sleep 1 | ||
expect "Enter password:" | ||
send "$env(passwd)\n" | ||
send "$env(OWTF_OPENVAS_PASSWD)\n" | ||
sleep 1 ' | ||
|
||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters