Skip to content

Commit

Permalink
Add go binaries workflow, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeyax committed Feb 9, 2022
1 parent a29fec5 commit ce76938
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 10 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and release binaries

on:
release:
types: [created]
jobs:
build:
name: Create native shared C libraries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Execute CGO builds using XGO
uses: crazy-max/ghaction-xgo@v1
# docs: https://github.com/marketplace/actions/golang-cgo-cross-compiler#inputs
with:
xgo_version: latest
go_version: 1.17
dest: build
pkg: cmd
prefix: server
targets: windows/amd64,linux/386,linux/amd64,darwin/386,darwin/amd64
# Prints the build commands as compilation progresses (default false)
x: true
ldflags: -w -s
buildmode: c-shared
working_dir: ./src-go/server
- name: Upload to GitHub releases
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./src-go/server/build/*"
delete_file: "build/*.h"
tags: true
draft: false
update_latest_release: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.h
*.so
*.dll
*.dylib
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
# Awesome TLS
Fixes Burp Suite's horrible TLS stack.
This extension hijacks Burp's HTTP and TLS stack to make it more powerful and less prone to fingerprinting by all kinds of WAFs.
It does this without resorting to hacks, reflection or forked Burp Suite Community code. All Java code only utilises Burp's Extender API.

## Build Instructions
This extension was developed with JetBrains IntelliJ IDE.
These build instructions assume you're using it too.
## How it works
Unfortunately Burp's Extender API is very limited for more advanced use cases like this, so I had to play around with it to make this work.

1. Compile the go package within `./src-go/`. See [go-src/server](./src-go/server) for build instructions.
Once a request comes in, the extension intercepts it and forwards it to a local HTTPS server that started in the background once loaded/installed.
This server works like a proxy; it forwards the request to the destination, while persisting the original header order and applying a customizable TLS configuration.
Then, the local server forwards the response back to Burp.

Configuration settings and other necessary information like the destination server address are sent to the local server per request by a magic header.
This magic header is stripped from the request before it's forwarded to the destination server, of course.

![diagram](./docs/diagram.png)

Another option would've been to code an upstream proxy server and connect burp to it, but I personally wanted an extension because it's customizable at runtime and more portable.

## Manual build Instructions
This extension was developed with JetBrains IntelliJ (and GoLand) IDE.
The build instructions below assume you're using the same tools to build.
See [workflows](.github/workflows) for the target programming language versions.

1. Compile the go package within `./src-go/`. Run `cd ./src-go/server && go build -o ../../src/main/resources/{OS}-{ARCH}/server.{EXT} -buildmode=c-shared ./cmd/main.go`, replacing `{OS}-{ARCH}` with your OS and CPU architecture and `{EXT}` with your platform's preferred extension for dynamic C libraries. For example: `linux-x86-64/server.so`. See the [JNA docs](https://github.com/java-native-access/jna/blob/master/www/GettingStarted.md) for more info about supported platforms.
2. Compile the GUI form `SettingsTab.form` into Java code via `Build > Build project`.
3. Build the jar with Gradle.
3. Build the fat jar with Gradle.

You should now have on jar file, containing all dependencies.
If you'd rather separate the server binary from the jar, start over from step 1 but instead build the binary to the output directory of the jar.
Binary file added docs/diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src-go/server/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/burp/ServerLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.sun.jna.Platform;

public interface ServerLibrary extends Library {
ServerLibrary INSTANCE = Native.load("server." + (Platform.isWindows() ? "dll" : "so"), ServerLibrary.class);
ServerLibrary INSTANCE = Native.load("server." + (Platform.isWindows() ? "dll" : Platform.isMac() ? "dylib" : "so"), ServerLibrary.class);

String StartServer(String address);
String StopServer();
Expand Down

0 comments on commit ce76938

Please sign in to comment.