-
Notifications
You must be signed in to change notification settings - Fork 20
/
install_db_windows.ps1
45 lines (39 loc) · 1.5 KB
/
install_db_windows.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
$HOUNDSPLOIT_PATH = "$HOME/.HoundSploit"
$scriptFolder = (Get-Location).Path
if (-not (Test-Path $HOUNDSPLOIT_PATH)) {
mkdir $HOUNDSPLOIT_PATH
}
if (-not (Test-Path $HOUNDSPLOIT_PATH\exploitdb)) {
cd $HOUNDSPLOIT_PATH
git clone https://gitlab.com/exploit-database/exploitdb
} else {
cd $HOUNDSPLOIT_PATH\exploitdb
$gitOutput = git pull
if ($gitOutput -eq "Already up to date.") {
Write-Host "Database already up-to-date"
} else {
if (Test-Path $HOUNDSPLOIT_PATH\hound_db.sqlite3) {
rm $HOUNDSPLOIT_PATH\hound_db.sqlite3
}
New-Item $HOUNDSPLOIT_PATH\houndsploit_db.lock
Write-Host "Latest version of the database downloaded"
}
}
if (-not (Test-Path $HOUNDSPLOIT_PATH\houndsploit)) {
git clone https://github.com/nicolas-carolo/houndsploit $HOUNDSPLOIT_PATH\houndsploit
}
cd $HOUNDSPLOIT_PATH\houndsploit
$gitOutput = git pull
if ($gitOutput -eq "Already up to date.") {
Write-Host "HoundSploit already up-to-date"
} else {
New-Item $HOUNDSPLOIT_PATH\houndsploit_sw.lock
Write-Host "Latest version of HoundSploit downloaded"
Write-Host "Run the following commands as Administrator (be sure to use the Python 3 interpreter)"
Write-Host "\tPS> pip install -r $HOUNDSPLOIT_PATH\houndsploit\requirements.txt"
Write-Host "\tPS> cd $HOUNDSPLOIT_PATH\houndsploit"
Write-Host "\tPS> rm $HOUNDSPLOIT_PATH\houndsploit_sw.lock"
Write-Host "\tPS> python setup.py install"
Write-Host "\tPS> houndsploit"
}
cd $scriptFolder