Skip to content

Commit

Permalink
maint: run the pre-commit run --all-files
Browse files Browse the repository at this point in the history
Run a batch of linters and static code analyzers to gauge our source
code tree.

A `git diff -w` only shows 3 no-op changes to source code.

Signed-off-by: Claudio André <[email protected]>
  • Loading branch information
claudioandre-br committed Jul 10, 2023
1 parent 47b5341 commit f8d4cbe
Show file tree
Hide file tree
Showing 26 changed files with 6,440 additions and 6,456 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ jobs:
tags: |
${{ env.REPO }}:${{ github.event.inputs.tag }}
${{ env.REPO }}:${{ github.event.inputs.tag }}_J${{ github.run_number }}
${{ env.REPO }}:${{ github.event.inputs.tag }}_J${{ github.run_number }}
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/virusscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
update_release_body: true
files: |
.7z$
.zip$
.zip$
14 changes: 1 addition & 13 deletions IDE/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,18 @@

"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: focal, bionic
"args": { "VARIANT": "jammy" }
},

// Set *default* container specific settings.json values on container create.
"settings": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cpptools",
"jeff-hykin.better-cpp-syntax",
"ms-vscode.cpptools-themes",
"galarius.vscode-opencl",
"ms-vscode.cpptools-extension-pack"
]

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
5 changes: 1 addition & 4 deletions IDE/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
Expand All @@ -24,4 +21,4 @@
]
}
]
}
}
4 changes: 1 addition & 3 deletions IDE/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
Expand All @@ -25,4 +23,4 @@
"problemMatcher": []
}
]
}
}
2 changes: 1 addition & 1 deletion IDE/john.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"arch.h": "c"
}
}
}
}
4 changes: 2 additions & 2 deletions IDE/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Visual Studio Code Remote Development allows you to use a container as a full-fe

In here you can find the project files (the workspace). Basically, you should use it this way:

```
```text
project
│ john.code-workspace
│ .devcontainer
Expand All @@ -24,4 +24,4 @@ project
- Debugging in action:
- watch the breakpoint, inspection of variable contents, "step in", "step into", "step out". Stop using `printf()` while experimenting with John the Ripper.

![](Debugging-JtR-Using-IDE.png)
![VSCode Screen](Debugging-JtR-Using-IDE.png)
4,058 changes: 2,029 additions & 2,029 deletions Releases/1.9.0.J1/bundle_log.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Releases/1.9.0.J1/bundle_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ com.openwall.John permissions:
1. com.openwall.John x86_64 master tutorial-repo < 53.6 MB


Installing? Installing? ???????????????????? 97%Installing? ???????????????????? 97%Installing? ???????????????????? 100%Installing? ???????????????????? 100% 0 bytes/sInstallation complete.
Installing? Installing? ???????????????????? 97%Installing? ???????????????????? 97%Installing? ???????????????????? 100%Installing? ???????????????????? 100% 0 bytes/sInstallation complete.
$ flatpak run com.openwall.John
Created directory: /home/JtR/.john
John the Ripper 1.9.0-jumbo-1 [linux-gnu 64-bit x86_64 AVX2 AC]
Expand Down Expand Up @@ -756,4 +756,4 @@ All 3 formats passed self-tests!
### Performed 12 tests in 287 seconds ###
-------------------------------------------
section_end:1557860865:build_scriptsection_start:1557860865:after_scriptsection_end:1557860869:after_scriptsection_start:1557860869:archive_cachesection_end:1557860873:archive_cachesection_start:1557860873:upload_artifacts_on_successsection_end:1557860878:upload_artifacts_on_successJob succeeded


Expand Down
1,564 changes: 782 additions & 782 deletions Releases/1.9.0.J1/docker_log.txt

Large diffs are not rendered by default.

2,554 changes: 1,277 additions & 1,277 deletions Releases/1.9.0.J1/x32_log.txt

Large diffs are not rendered by default.

2,454 changes: 1,227 additions & 1,227 deletions Releases/1.9.0.J1/x64_log.txt

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions Releases/rolling/bundle_log.txt

Large diffs are not rendered by default.

736 changes: 368 additions & 368 deletions Releases/rolling/docker_log.txt

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Releases/rolling/get-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ if [[ "$1" == "ALL_FILES" ]]; then
sha256sum -- *.7z
sha256sum -- john.flatpak
fi

1,334 changes: 667 additions & 667 deletions Releases/rolling/x64_log.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cloud-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ RUN apt-get update -qq && \
USER usr
WORKDIR /host/workdir
ENV PROVIDER AWS
CMD /bin/bash
CMD /bin/bash
2 changes: 1 addition & 1 deletion cloud-tool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ locals {
region = var.region
profile = var.profile
}
} */
} */
26 changes: 15 additions & 11 deletions cloud-tool/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The default settings of this tool perform actions on AWS that are eligible for t

Note that you may create resources which cost money. Run `terraform destroy` when you no longer need those resources.

### Use Cases
## Use Cases

It is useful for provisioning and destroying instances: it is fast, repeatable and reduces the risk of human error. There is no possibility to forget to delete an instance or the EBS disk. It makes sense if someone wants to start a few instances and try a wordlist here, or a mask there, maybe incremental over there.
- you provision all instances at once;
Expand All @@ -21,7 +21,7 @@ IMPORTANT: The total cost of your cracking sessions on AWS will vary depending o
### Dependencies
[Terraform](http://www.terraform.io/downloads.html) and [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html). The following docker image has all dependencies installed:

```
```bash
cd PROJECT_FOLDER && \
docker run -it --rm -v $(pwd):/host/workdir -v ~/.aws/:/home/usr/.aws/:ro claudioandre/cloud-tool
```
Expand All @@ -31,7 +31,7 @@ Hint: create an alias for the command.
Create your [AWS profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).

Example `~/.aws/credentials`
```
```text
[usr]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Expand All @@ -40,19 +40,20 @@ aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
### Adjust it to your use case
You need to open and edit the file `variables.tf`.

1. Find your public IP adress using, for instance, https://www.myip.com/
1. Find your public IP adress using, for instance, [https://www.myip.com/](https://www.myip.com/).
Update the `cidr_blocks inside` session `variable "ingress_data"` in `variable.tf`.
2. You can also make adjustments to `variable "regions_list"`.

## Key and server
You can use your own ssh keys or create new ones. You will use the ssh keys only during your cracking session, so it can be disposable. Do NOT use a passphrase to create it.
```
```bash
ssh-keygen -t rsa -f workerKey
# key was created
```

## Example (Something I really did)

```
```bash
# Get the tool
git clone https://github.com/openwall/john-packages.git cloud
cd cloud/cloud-tool
Expand Down Expand Up @@ -123,15 +124,18 @@ terraform destroy

## Usage of Spot Instances

If you want to run cheaper Spot instances, you should specify this on your command line (or edit the `variables.tf` file, of course).
If you want to run cheaper Spot instances, you should specify this on your command-line (or edit the `variables.tf` file, of course).

```
```bash
$ terraform plan --var "spot=yes" --var "spot_price=0.23" # today's price for a g3s.xlarge
# Command output

$ terraform apply --var "spot=yes" --var "spot_price=0.23"
# Command output
```

If you need information about Spot pricing, please visit:
* https://aws.amazon.com/ec2/spot/pricing/?nc1=h_ls
* Also, there is a Pricing history button at https://console.aws.amazon.com/ec2sp/v2/home?region=us-east-1#/spot where you can see a nice "Spot Instance pricing history" graphic.
* [https://aws.amazon.com/ec2/spot/pricing/?nc1=h_ls](https://aws.amazon.com/ec2/spot/pricing/?nc1=h_ls)
* Also, there is a Pricing history button at [https://console.aws.amazon.com/ec2sp/v2/home?region=us-east-1#/spot](https://console.aws.amazon.com/ec2sp/v2/home?region=us-east-1#/spot) where you can see a nice "Spot Instance pricing history" graphic.

Remember that your instance can be stopped by Amazon at any time.
Remember that your instance can be stopped by Amazon at any time.
2 changes: 1 addition & 1 deletion cloud-tool/security-group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ resource "aws_security_group" "jtrcrackers-sg" {
Customer = var.customer
Confidentiality = var.confidentiality
}
}
}
2 changes: 1 addition & 1 deletion cloud-tool/spot.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ resource "aws_spot_instance_request" "worker" {
Customer = var.customer
Confidentiality = var.confidentiality
}
}
}
2 changes: 1 addition & 1 deletion cloud-tool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ variable customer {
variable confidentiality {
type = string
default = "Default"
}
}
20 changes: 10 additions & 10 deletions docs/announcement.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Subject: John the Ripper binary packages
# Subject: John the Ripper binary packages

This is in fact nothing new for the list, but we would like to announce the existence of John the Ripper compiled packages:
* git repository at https://github.com/openwall/john-packages
* git repository at [https://github.com/openwall/john-packages.](https://github.com/openwall/john-packages)

- there are a stable release (Jumbo 1), a rolling release [1], and a development release;
- you can find packages:
- in PortableApp style: for Windows and Mac;
- in sandboxed style [2]: for Linux;
- a Canonical snap (the recommended), a flatpak and a Docker image (the recommended method for use in the cloud ☁);
- in PortableApp style: for Windows and Mac;
- in sandboxed style [2]: for Linux;
- a Canonical snap (the recommended), a flatpak and a Docker image (the recommended method for use in the cloud ☁);

What these packages offer:
- the deployment process and scripts used are public and are evaluated by Static Code Analyzers;
Expand All @@ -20,16 +20,16 @@ Image (from readme):

Hardening:
- it's known [3] that `john` isn't to be used on untrusted inputs, but how about use hardening with `john`?
- our Linux packages execute in a sandbox which limits the system privileges so that if a malicious content manages exploits a vulnerability to execute arbitrary code it will be unable to compromise the underlying OS.
- in addition, some packages use binary hardening techniques [4];
- our Linux packages execute in a sandbox which limits the system privileges so that if a malicious content manages exploits a vulnerability to execute arbitrary code it will be unable to compromise the underlying OS.
- in addition, some packages use binary hardening techniques [4];

The packages and usage guidelines are available for use by the community at https://github.com/openwall/john-packages.
The packages and usage guidelines are available for use by the community at [https://github.com/openwall/john-packages.](https://github.com/openwall/john-packages)

We appreciate your input and feedback. Greetings everyone.

- [1] Rolling release, also known as rolling update or continuous delivery, is a concept in software development of
frequently delivering updates to applications. This is in contrast to a standard or point release.
- [2] In computer security, a sandbox is a security mechanism for separating running programs, usually in an effort
to mitigate system failures and/or software vulnerabilities from spreading.
- [3] https://github.com/openwall/john-packages/security/policy I think magnum said this.
- [4] https://en.wikipedia.org/wiki/Hardening_(computing)
- [3] [https://github.com/openwall/john-packages/security/policy](https://github.com/openwall/john-packages/security/policy) I think magnum said this.
- [4] [https://en.wikipedia.org/wiki/Hardening_(computing)](https://en.wikipedia.org/wiki/Hardening_(computing))
5 changes: 2 additions & 3 deletions patches/0001-Handle-self-confined-system-wide-build.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ index 83afed9eb..fa7d43f58 100644
--- a/src/params.h
+++ b/src/params.h
@@ -106,10 +106,18 @@

#if JOHN_SYSTEMWIDE
#ifndef JOHN_SYSTEMWIDE_EXEC /* please refer to the notes above */
-#define JOHN_SYSTEMWIDE_EXEC "/usr/libexec/john"
Expand All @@ -56,6 +56,5 @@ index 83afed9eb..fa7d43f58 100644
#endif
#define JOHN_PRIVATE_HOME "~/.john"
#endif
--
--
2.39.2

5 changes: 2 additions & 3 deletions patches/0001-Remove-peflags-from-the-default-target.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ index c6b47b5ff..587a32193 100644
@@ -195,7 +195,7 @@ default:
JOHN_OBJS="$(JOHN_OBJS) @CC_ASM_OBJS@" \
AESNI_ARCH=@AESNI_ARCH@

- @if [ "$(OS)" = "Windows_NT" ]; then \
+ @if [ "$(OS)" = "None-Windows_NT" ]; then \
$(MAKE) peflags; \
fi
@echo
--
--
2.39.2

0 comments on commit f8d4cbe

Please sign in to comment.