-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from LimesKey/main
New feature: Dictionary-based password attacks
- Loading branch information
Showing
13 changed files
with
366 additions
and
183 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# | ||
# https://github.com/microsoft/action-psscriptanalyzer | ||
# For more information on PSScriptAnalyzer in general, see | ||
# https://github.com/PowerShell/PSScriptAnalyzer | ||
|
||
name: PSScriptAnalyzer | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '29 8 * * 0' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
name: PSScriptAnalyzer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run PSScriptAnalyzer | ||
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f | ||
with: | ||
# Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options. | ||
# The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules. | ||
path: .\ | ||
recurse: true | ||
# Include your own basic security rules. Removing this option will run all the rules | ||
includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"' | ||
output: results.sarif | ||
|
||
# Upload the SARIF file generated in the previous step | ||
- name: Upload SARIF results file | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: results.sarif |
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ env: | |
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
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 +1,16 @@ | ||
/target | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
|
||
Rockyou.* |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Specify the downloads folder | ||
$downloads_folder = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path | ||
# Set the path for the DNAnalyzer directory in the downloads folder | ||
$dir_path = "$downloads_folder/PasswordGPT" | ||
# Creates a temporary windows progam file | ||
$TempFile = New-TemporaryFile | ||
|
||
$repo = "VerisimilitudeX/PasswordGPT" | ||
$file = "PasswordGPT-64x.exe" | ||
$releases = "https://api.github.com/repos/$repo/releases" | ||
$RockYou = "https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt" | ||
|
||
#$ErrorActionPreference = 'SilentlyContinue' | ||
$ProgressPreference = 'SilentlyContinue' # adds increased downloading speed | ||
|
||
try { | ||
# Check if the directory already exists | ||
if ([System.IO.Directory]::Exists($dir_path)) { | ||
Write-Host "The directory already exists." | ||
} else { | ||
# Try to create the directory for DNAnalyzer in the downloads folder | ||
New-Item -Path "$dir_path" -ItemType Directory | ||
} | ||
} catch [System.Exception] { | ||
# Catch any errors and print a message | ||
Write-Host "Something went wrong..." -ForegroundColor Red | ||
Write-Error $_.Exception.Message | ||
} | ||
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name | ||
$download = "https://github.com/$repo/releases/download/$tag/$file" | ||
|
||
if (!(Test-Path -Path ("$dir_path/$file") -PathType Leaf)) { | ||
Write-Host "Downloading latest release for PasswordGPT to $dir_path/PasswordGPT-64x..." | ||
Invoke-WebRequest -Uri $download -OutFile "$dir_path/$file" | ||
} | ||
|
||
Write-Host "Downloading RockYou password database..." | ||
Invoke-WebRequest -Uri $RockYou -Out $TempFile | ||
|
||
$Rock_You_Path = $TempFile.FullName | ||
$ShortcutPath = "$dir_path\RockYou.lnk" | ||
Write-Host $Rock_You_Path | ||
|
||
$WsScriptObj = New-Object -ComObject ("WScript.Shell") | ||
$Shortcut = $WsScriptObj.CreateShortcut($ShortcutPath) | ||
$Shortcut.TargetPath = $Rock_You_Path | ||
$Shortcut.Save() | ||
|
||
if (Test-Path "$dir_path\$file") { | ||
Write-Host "Installed sucessfully, running program now!" -ForegroundColor Green | ||
Start-Process -FilePath "$dir_path/$file" -Wait | ||
|
||
|
||
Write-Host "Cleaning up... Deleting temp files" | ||
try { | ||
Remove-Item $TempFile.FullName | ||
Remove-Item $ShortcutPath | ||
} catch [System.Exception] { | ||
Write-Host "Something went wrong..." -ForegroundColor Red | ||
Write-Error $_.Exception.Message | ||
} | ||
} | ||
|
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
File renamed without changes.
File renamed without changes.
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,76 +1,76 @@ | ||
import json | ||
|
||
ALGO = input("Enter Algorithm: ").upper() | ||
|
||
while True: | ||
# Prompt the user for the GPU data | ||
gpu_model = input("GPU Model: ").upper() | ||
|
||
# Check if the user entered an empty string for the GPU model | ||
# If they did, exit the loop | ||
if gpu_model == "": | ||
break | ||
|
||
while True: | ||
hashrate = str(input("Enter your hashrate: ")).upper() | ||
unacceptable_formats = ['/', '\\', 'S'] | ||
for char in range(0, len(hashrate)): | ||
if hashrate[char] in unacceptable_formats: | ||
hashrate[char].replace(hashrate[char], '') | ||
|
||
if hashrate[char].isalpha(): # if char in input is alpha | ||
unit = hashrate[char].upper() # put alaphabet into array | ||
|
||
if unit is None: | ||
print("Please enter a valid hashrate with the unit of the hashrate.") | ||
continue | ||
acceptable_formats = ['H', 'KH', 'MH', 'GH', 'TH'] # list of acceptable hashes | ||
count = 0 | ||
for values in acceptable_formats: | ||
if unit == values: | ||
count++ | ||
print(count) | ||
if count != 1: | ||
# format_input is not in acceptable_formats | ||
print("Incorrect Input") | ||
continue | ||
# try again | ||
|
||
gflop = input("Enter GPFLOPs: ") | ||
if gflop != "": | ||
break | ||
|
||
# Create a dictionary with the data and append it to the list | ||
gpu_dict = { | ||
f"{gpu_model}": { | ||
"GFLOPS-64": gflop, | ||
f"{ALGO} HASHRATE": (hashrate + unit + "/s")} | ||
} | ||
|
||
|
||
def write_json(data, filename='data.json'): | ||
# Read the file | ||
with open(filename, 'r') as file: | ||
file_data = json.load(file) | ||
|
||
# Check if the array exists in the file | ||
found = False | ||
for i, subarr in enumerate(file_data): | ||
if subarr[0] == data[0]: | ||
found = True | ||
break | ||
|
||
if found: | ||
# Array exists, so modify the dictionary contained in the second element of the subarray | ||
file_data[i][1].update(data[1]) | ||
else: | ||
# Array does not exist, so add it to the file | ||
file_data.append(data) | ||
# Write the modified data to the file | ||
with open(filename, 'w') as file: | ||
json.dump(file_data, file, indent=4) | ||
|
||
|
||
# Write the data to the JSON file | ||
write_json(gpu_dict) | ||
print("Data saved to data.json") | ||
import json | ||
|
||
ALGO = input("Enter Algorithm: ").upper() | ||
|
||
while True: | ||
# Prompt the user for the GPU data | ||
gpu_model = input("GPU Model: ").upper() | ||
|
||
# Check if the user entered an empty string for the GPU model | ||
# If they did, exit the loop | ||
if gpu_model == "": | ||
break | ||
|
||
while True: | ||
hashrate = str(input("Enter your hashrate: ")).upper() | ||
unacceptable_formats = ['/', '\\', 'S'] | ||
for char in range(0, len(hashrate)): | ||
if hashrate[char] in unacceptable_formats: | ||
hashrate[char].replace(hashrate[char], '') | ||
|
||
if hashrate[char].isalpha(): # if char in input is alpha | ||
unit = hashrate[char].upper() # put alaphabet into array | ||
|
||
if unit is None: | ||
print("Please enter a valid hashrate with the unit of the hashrate.") | ||
continue | ||
acceptable_formats = ['H', 'KH', 'MH', 'GH', 'TH'] # list of acceptable hashes | ||
count = 0 | ||
for values in acceptable_formats: | ||
if unit == values: | ||
count++ | ||
print(count) | ||
if count != 1: | ||
# format_input is not in acceptable_formats | ||
print("Incorrect Input") | ||
continue | ||
# try again | ||
|
||
gflop = input("Enter GPFLOPs: ") | ||
if gflop != "": | ||
break | ||
|
||
# Create a dictionary with the data and append it to the list | ||
gpu_dict = { | ||
f"{gpu_model}": { | ||
"GFLOPS-64": gflop, | ||
f"{ALGO} HASHRATE": (hashrate + unit + "/s")} | ||
} | ||
|
||
|
||
def write_json(data, filename='data.json'): | ||
# Read the file | ||
with open(filename, 'r') as file: | ||
file_data = json.load(file) | ||
|
||
# Check if the array exists in the file | ||
found = False | ||
for i, subarr in enumerate(file_data): | ||
if subarr[0] == data[0]: | ||
found = True | ||
break | ||
|
||
if found: | ||
# Array exists, so modify the dictionary contained in the second element of the subarray | ||
file_data[i][1].update(data[1]) | ||
else: | ||
# Array does not exist, so add it to the file | ||
file_data.append(data) | ||
# Write the modified data to the file | ||
with open(filename, 'w') as file: | ||
json.dump(file_data, file, indent=4) | ||
|
||
|
||
# Write the data to the JSON file | ||
write_json(gpu_dict) | ||
print("Data saved to data.json") |
Oops, something went wrong.