Skip to content

Commit

Permalink
Migrate pipeline (#14)
Browse files Browse the repository at this point in the history
* Remove requirements

* Update examples

* Migrate pipelines

* Update badge

* Update lint to Poetry

* Add pyinstaller

* Explicit Powershell

* New connection

* Make things a bit less bash

* Headless Poetry on Windows is a pain

* Re-add display name

* Correct display names

* Add pywin32-ctypes

* Add pefile
  • Loading branch information
thebeanogamer authored Jan 12, 2020
1 parent 0a08401 commit f6852a1
Show file tree
Hide file tree
Showing 7 changed files with 329 additions and 110 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# HSTS Parser

[![Build Status](https://thebeanogamer.visualstudio.com/HSTSparser/_apis/build/status/HSTSparser?branchName=master)](https://thebeanogamer.visualstudio.com/HSTSparser/_build/latest?definitionId=2&branchName=master) ![Publish Status](https://thebeanogamer.vsrm.visualstudio.com/_apis/public/Release/badge/f24623e9-719d-4c7f-b194-3be7917a22bf/1/1) ![Licence](https://img.shields.io/github/license/thebeanogamer/hstsparser) ![Python 3.7.x](https://img.shields.io/badge/python-3.7.x-yellow.svg)
[![Build Status](https://dev.azure.com/thebeanogamer/HSTSparser/_apis/build/status/Lint%20Pipeline?branchName=master)](https://dev.azure.com/thebeanogamer/HSTSparser/_build/latest?definitionId=2&branchName=master) [![Release Status](https://dev.azure.com/thebeanogamer/HSTSparser/_apis/build/status/Release%20Pipeline?branchName=master)](https://dev.azure.com/thebeanogamer/HSTSparser/_build/latest?definitionId=7&branchName=master) ![Licence](https://img.shields.io/github/license/thebeanogamer/hstsparser) ![Python 3.8.x](https://img.shields.io/badge/python-3.8.x-yellow.svg)

HSTS Parser is a simple tool to parse Firefox and Chrome's HSTS databases into actually helpful forensic artifacts! You can read more about the research behind this tool and potential uses for it over on [my blog](https://blog.daniel-milnes.uk/hsts-for-forensics-you-can-run-but-you-cant)!

## Installation

Installing HSTS Parser is easy! Just run the below command to install the dependencies and you're good to go!
Installing HSTS Parser is easy! Just run the below commands to install everything you need!

```shell
pip3 install -r requirements.txt
### Linux

```bash
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
poetry install
```

### Windows

```powershell
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
poetry install
```

Alternatively, if you're using Windows, you can use the executables on the [releases page](https://github.com/thebeanogamer/hstsparser/releases/latest) to not need to install anything at all.
Expand All @@ -19,7 +29,7 @@ Alternatively, if you're using Windows, you can use the executables on the [rele
All of the below documentation is written for the Python version rather than the standalone, but the commands are the same, just replacing `python3 hstsparser.py` with the name of the executable.

```shell
$ python3 hstsparser.py -h
$ poetry run python hstsparser.py -h
usage: hstsparser.py [-h] [-w WORDLIST] (--firefox | --chrome) FILE

Process HSTS databases
Expand All @@ -40,19 +50,19 @@ optional arguments:
#### Firefox

```shell
python3 hstsparser.py --firefox SiteSecurityServiceState.txt
poetry run python hstsparser.py --firefox SiteSecurityServiceState.txt
```

#### Chrome

```shell
python3 hstsparser.py --chrome TransportSecurity
poetry run python hstsparser.py --chrome TransportSecurity
```

#### Chrome with Wordlist

```shell
python3 hstsparser.py -w wordlist.txt --chrome TransportSecurity
poetry run python hstsparser.py -w wordlist.txt --chrome TransportSecurity
```

## Screenshots
Expand Down
12 changes: 9 additions & 3 deletions azure-pipelines.yml → azure-pipelines/lint-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ jobs:
- task: UsePythonVersion@0
displayName: 'Set Python version'
inputs:
versionSpec: '3.7.x'
versionSpec: '3.8.x'
addToPath: true

- script: pip install -r requirements-ci.txt
displayName: 'Install project using pip'
- script: curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
displayName: Install Poetry

- script: $HOME/.poetry/bin/poetry config virtualenvs.create false
displayName: Disable Poetry VirtualEnvs

- script: $HOME/.poetry/bin/poetry install --no-interaction --no-ansi
displayName: Install project using Poetry

- script: python -m flake8 .
displayName: 'Run linter'
Expand Down
43 changes: 43 additions & 0 deletions azure-pipelines/release-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
trigger:
- master

pr: none

jobs:
- job: Publish
displayName: Publish

pool:
vmImage: windows-latest

steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.8.x'
inputs:
versionSpec: 3.8.x
addToPath: true

- task: PowerShell@2
inputs:
targetType: 'inline'
script: '(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python'
displayName: Install Poetry

- script: '%USERPROFILE%/.poetry/bin/poetry config virtualenvs.create false'
displayName: Disable Poetry VirtualEnvs

- script: '%USERPROFILE%/.poetry/bin/poetry install --no-interaction --no-ansi'
displayName: Install project using Poetry

- task: PowerShell@2
inputs:
targetType: 'inline'
script: 'pyinstaller --onefile hstsparser.py'
displayName: 'Create Executable'

- task: GitHubRelease@1
displayName: 'GitHub release (create)'
inputs:
gitHubConnection: 'github.com'
tagPattern: '.*'
assets: '$(System.DefaultWorkingDirectory)\dist\hstsparser.exe'
Loading

0 comments on commit f6852a1

Please sign in to comment.