Skip to content

Commit

Permalink
Updates related to upgrade to Python 3.11.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
reuteras committed Jul 27, 2023
1 parent fe8b1a2 commit f8089d8
Showing 1 changed file with 45 additions and 10 deletions.
55 changes: 45 additions & 10 deletions setup/install_python_tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Write-DateLog "Install Python in Sandbox." >> "C:\log\python.txt" 2>&1
Start-Process "$SETUP_PATH\python3.exe" -Wait -ArgumentList "/quiet InstallAllUsers=1 PrependPath=1 Include_test=0"
Get-Job | Receive-Job >> "C:\log\python.txt" 2>&1

$PYTHON_BIN="$env:ProgramFiles\Python310\python.exe"
$PYTHON_BIN="$env:ProgramFiles\Python311\python.exe"

&"$PYTHON_BIN" -m venv C:\pip2pi

Expand All @@ -44,35 +44,51 @@ Write-DateLog "Download packages with pip2pi in Sandbox." >> "C:\log\python.txt"
Set-Location C:\
&pip2pi ./tmp/pip/default `
aiohttp[speedups] `
aiosignal>=1.2.0 `
async_timeout>=4.0.1 `
attrs>=22.2.0 `
beautifulsoup4>=4.12.1 `
cabarchive `
capstone `
certifi>=2023.5.7 `
chardet>=5.0.0 `
charset_normalizer>=3.1.0 `
chepy[extras] `
click>=8.1.5 `
colorama `
construct>=2.10.68 `
cryptography>=41.0.1 `
dnslib `
docx2txt `
dpkt `
elasticsearch[async] `
elastic_transport>=8.1.2 `
evtx `
extract-msg `
fonttools `
hachoir `
idna>=3.2 `
ijson `
importlib-metadata>=6.5.0 `
jinja2 `
jsbeautifier `
keyring>=23.13.1 `
keystone-engine `
LnkParse3 `
lxml `
maldump `
MarkupSafe>=2.1.3 `
minidump `
mkyara `
msgpack `
msoffcrypto-tool `
multidict>=6.0.0 `
name-that-hash `
neo4j `
neo4j-driver `
numpy `
olefile `
oletools[full] `
oletools[full]>=0.60.1 `
openpyxl `
orjson `
pandas `
Expand All @@ -83,34 +99,40 @@ Set-Location C:\
pillow `
ppdeep `
prettytable>=3.5 `
prompt_toolkit>=3.0.35 `
protobuf>=4.22.0 `
protodeep `
pycryptodome `
pycryptodomex>=3.17.0 `
pyelftools `
pyhindsight `
pyOneNote `
pyparsing>=2.4.6 `
pypng `
pySigma `
python-magic-bin `
pywin32 `
pyzipper `
python-magic `
regipy[full] `
regipy `
requests `
setuptools `
time-decode `
tomlkit `
tqdm `
tzdata>=2023.1 `
uncompyle6 `
unicorn `
unpy2exe `
urllib3 `
visidata `
xlrd `
XLMMacroDeobfuscator `
urllib3>=1.26.15 `
visidata>=2.11 `
xlrd>=2.0.0 `
XLMMacroDeobfuscator>=0.2.5 `
xxhash `
yara-python `
wheel 2>&1 | findstr /V "ERROR linking" | findstr /V "Access is denied:" | findstr /V "skipping WinError" >> "C:\log\python.txt" 2>&1
wheel>=0.40.0 2>&1 | findstr /V "ERROR linking" | findstr /V "Access is denied:" | findstr /V "skipping WinError" >> "C:\log\python.txt" 2>&1

# Not compatible with Python 3.11:
# regipy[full]>=3.1.6 - https://github.com/astanin/python-tabulate

Set-Location C:\
&pip2pi ./tmp/pip/dfir-unfurl `
Expand All @@ -119,6 +141,11 @@ Set-Location C:\
tomlkit `
wheel 2>&1 | findstr /V "ERROR linking" | findstr /V "Access is denied:" | findstr /V "skipping WinError" >> "C:\log\python.txt" 2>&1

Set-Location C:\
&pip2pi ./tmp/pip/pySigma `
pySigma>=0.9.6 `
wheel 2>&1 | findstr /V "ERROR linking" | findstr /V "Access is denied:" | findstr /V "skipping WinError" >> "C:\log\python.txt" 2>&1

deactivate

Write-DateLog "Install packages in venv default in sandbox." >> "C:\log\python.txt" 2>&1
Expand Down Expand Up @@ -158,12 +185,20 @@ foreach ($url in $urls) {
$staticPath = "C:\venv\dfir-unfurl\Lib\site-packages\unfurl\static\$fileName"
Write-DateLog "Downloading $url.Value to $staticPath." >> "C:\log\python.txt" 2>&1
Invoke-WebRequest -Uri $url.Value -OutFile $staticPath
$baseHtmlContent = $baseHtmlContent.Replace($url.Value, "/static/$fileName")
$baseHtmlContent = $baseHtmlContent.slace($url.Value, "/static/$fileName")
}

Set-Content -Path $baseHtmlPath -Value $baseHtmlContent

deactivate
Write-DateLog "Python venv dfir-unfurl cache done." >> "C:\log\python.txt" 2>&1

Write-DateLog "Install packages in venv pySigma in sandbox (needs older packages that conflicts with oletools)." >> "C:\log\python.txt" 2>&1
Start-Process -Wait -FilePath "$PYTHON_BIN" -ArgumentList "-m venv C:\venv\pySigma"
C:\venv\pySigma\Scripts\Activate.ps1 >> "C:\log\python.txt" 2>&1
Set-Location $TEMP\pip\pySigma
Install-PythonPackage | Out-Null
deactivate
Write-DateLog "Python venv pySigma done." >> "C:\log\python.txt" 2>&1

Write-Output "" > C:\venv\done

0 comments on commit f8089d8

Please sign in to comment.