aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-20_www: set the WebSocket address schema based on URL protocolShulhan
If the address is using "https:" protocol, the WebSocket address will use the "wss://" schema. This changes require latest update on wui repository.
2022-03-14Release trunks v0.2.0 (2022-03-13)v0.2.0Shulhan
Release trunks under GPL 3.0 or later license. See https://kilabit.info/journal/2022/gpl for more information.
2022-03-14all: changes the license of trunks software to GPL 3.0 or laterShulhan
See https://kilabit.info/journal/2022/gpl for more information.
2022-03-13all: update dependenciesShulhan
2022-02-05Release trunks v0.1.0 (2022-02-05)v0.1.0Shulhan
Module trunks is a library and HTTP service that provide web user interface to test HTTP service, similar to Postman, and for load testing. For the load testing we use vegeta [1] as the backend.
2022-02-05go.mod: update share module to v0.34.0Shulhan
2022-02-05Makefile: run the test with CGO_ENABLED=1Shulhan
In case user set CGO_ENABLED=0, the task for "all" will fail. This commit fix this by setting CGO_ENABLED to 1 when running test with -race option.
2022-01-10all: update share and ciigo modulesShulhan
2021-12-21all: add option to open link inside an iframeShulhan
The NavLink struct now has field OpenInIFrame. If its true, the Href will be opened inside an iframe in the same window, otherwise it will opened in new tab.
2021-12-21all: add feature to register custom navigation linkShulhan
Using Trunks.RegisterNavLink, one can register custom link into left navigation menu.
2021-12-20go.mod: update share and ciigo modules to latestShulhan
2021-12-10all: realign all structsShulhan
Changes, * AttackResult storage size decreased -24 bytes * Environment storage size decreased -32 bytes * HttpTarget storage size decreased -24 bytes * RunRequest storage size decreased -32 bytes * RunResponse storage size decreased -8 bytes * Target storage size decreased -16 bytes * WebSocketTarget storage size decreased -8 bytes
2021-12-10www: fix rendering the WebSocket responseShulhan
The returned value from WebSocketTarget's onClickRun() is already decoded as object, so we did not need to convert and run JSON.parse with it.
2021-12-06go.mod: update to latest share moduleShulhan
This changes update on how memfs initialized and GoEmbed called.
2021-10-19cmd/trunks: update the node when changes on .js and .html filesShulhan
When the worker build received an update to .js or .html files, we run the Node.Update method on affected node to fetch their latest content. This is to allow the task to embed files, generate the latest content.
2021-10-19www: load the stored variables into Target, HttpTarget, WebSocketTargetShulhan
In the commit edff37e3 and 264cb988, we store the user modified input into local storage. This including Target options and variables, HttpTarget headers and parameters, and WebSocket headers and parameters. When the user interface refreshed, the stored variables is loaded into input form but not saved into current Target/HttpTarget/WebSocketTarget variables. This changes fix this issue by loading the stored variables into into current instance of Target/HttpTarget/WebSocketTarget variables.
2021-10-18all: rename internal/cmd/trunks-example to internal/cmd/trunksShulhan
The internal/cmd/trunks-example is not run and provide an example only now, its include the workers to build, recompile, re-embeded files.
2021-10-17all: merge all workers for related to development to internal/cmdShulhan
Previously, we have a workers to recompile TypeScript and regenerate HTML files from adoc inside the Trunks type. The workers will run if the environment variable TRUNKS_DEV set to non-zero. This changes move those workers to the internal/cmd/trunks-example, because those workers are related for development only not for running Trunks server.
2021-10-17www: disable modifying the Base URL on targetShulhan
The BaseURL should be only set once by server and read-only to client. This is to prevent a malicious client attempt to attack non-predefined target.
2021-10-17all: move the main program for example to internal/cmd/trunks-exampleShulhan
The "cmd" directory on module should be reserved for installable program that can be executed outside of this repository. The trunks-example is development server should be run on root of this repository only, not installable to $GOBIN.
2021-10-17www: create separate functions to save to local storagesShulhan
This changes split the Save function into several functions, in order to help review and minimize wrong storage key on load and save.
2021-10-11go.mod: update to latest share and ciigo moduleShulhan
Changes, * share: fix the HTTP caching using ETag on the server * share: rename the terminology to generate Go source code to "embed" * ciigo: check markup modification time before converting to HTML
2021-09-29_www: store the target attack options to local storageShulhan
Once the Attack button is clicked, the Target's attack options will be stored to local storage. On the next refresh or opening the Trunks web interface, the stored values will be loaded again.
2021-09-29all: implement WebSocket notification when attack finishedShulhan
When the attack finished, the WebSocket server will broadcast the result to all clients as message "/_trunks/api/attack/result".
2021-09-28all: change the environment to set WebSocket port instead of addressShulhan
Setting the websocket listen address on environment require, re-parsing address port on the web side to connect to the server. In order to simplify creating connection on client, we set only the websocket port in the environment.
2021-09-28www: group related fields to use fieldset instead of headerShulhan
Currently we are experimenting changing the layout for grouping input fields from flat layout into fieldset, so user can see more separation between each sub-section.
2021-09-27all: minimize recompilation on changes on _wwwShulhan
Instead of re-run the commands to recompile and embed for each file changes on _www, we queue changes into channel and run the recompile only if the channel is not empty.
2021-09-27all: implement WebSocket APIShulhan
The WebSocket API replace the HTTP APIs for running and canceling attack. Later, it will use to notify the result of attack.
2021-09-26all: unembed HTTP server on TrunksShulhan
Since we will implement API using WebSocket later, we need to split between the one that manage HTTP and one that manage WebSocket.
2021-09-25all: simplify development on trunks-exampleShulhan
Previously to developer and test trunks on local we need to run "tsc -w" on directory _www to watch and recompile any changes to TypeScript files, and run "go run ./cmd/trunks-example" to view the Trunks web interface. Since we will have internal documentation inside _www/docs, we need to run another ciigo server that watch any changes to .adoc files and convert it to HTML. Three separate commands for development. This changes refactoring the development process by running two goroutines when TRUNKS_DEV environment variable is set to non-empty. One goroutine watch any changes to TypeScript, HTML, and tsconfig files inside the _www, and when there is an update it will execute "tsc -p" to recompile and "go run ./internal/generate-memfs" to embed them into Go source. Another goroutine watch any changes to .adoc files inside "_www/docs" directory and convert them into HTML files. This goroutine will running in the background while the HTTP server is running too.
2021-09-25_www: store the variables, headers, and parameters to local storageShulhan
When user click "Run" button on any HttpTarget or WebSocketTarget, the application will store each dynamic values of input in Target's Variables, HttpTarget/WebSocketTarget Headers and Parameters into local storage. By storing the dynamic values of form input, different users can have their own dynamic values and automatically loaded when they re-open the Trunks website again.
2021-09-25example: return all response like HTTP Request in JSON formatShulhan
The endpoint for GET and POST examples now return the object like HTTP Request which contains the HTTP Method, URL, Headers, Form, MultipartForm, and the Body. This will allow us to inspect the request with logging in to console.
2021-09-25all: check and convert HTTP target parameters to multipart/form-dataShulhan
If the content-type of request is multipart/form-data, convert the parameters in HttpTarget using ToMultipartFormData().
2021-09-25all: prevent leaking Target and HttpTarget headers and variablesShulhan
In case two or more users access the Trunks web and set the target variables, the last user that run any HttpTarget will set the Target variables or HttpTarget headers/variables. The next user that open the Trunks web will see the values of headers and variables from the latest run. This changes fix this issue by generating new RunRequest using request original target
2021-09-23_www: word wrap the input labelShulhan
In case the label is longer than 200px, break them by words.
2021-09-23all: convert the params to JSON objectShulhan
Since the HttpTarget Params type changes to KeyFormInput, we cannot use the Params directly but need to convert it JSON object first using map[string]interface{}.
2021-09-23_www: fix the layout using px instead of emShulhan
Using em is hard to calculate between fixed menu on the left, content, and header. Especially when there is an element that needs width larger than parent width (the header of target).
2021-09-22_www: fix missing variables not rendered on TargetShulhan
Also, * allow auto scroll to the target top content when the Target menu clicked * fix header overflow on HTTP and WebSocket target
2021-09-20Makefile: add task to re-compile the TypeScript filesShulhan
The "tsc" task run the tsc program using the tsconfig.json inside the directory _www, which will recompile all TypeScript before generating the embeded file.
2021-09-20_www: set default form input kind to stringShulhan
In case the FormInput from response does not define the Kind, due to lazy programmer, generate default form input string.
2021-09-19all: display notification on failed or success RunShulhan
Previously, after clicking the "Run" button user need to inspect the "Run output" to check if the request is success or fail. This changes, display a notification everytime the "Run" finished. It will display the notification as error or success based on the HttpStatusCode inside the RunResponse
2021-09-19all: add option to set description (Hint) on any inputs elementShulhan
This changes refactor the KeyValue from map[string]string into map[string]FormInput, where FormInput is a struct with Label, Hint, Kind, Value, Max, and Min. With the available of Hint field, the web user interface can render it as description of input. This changes also make all input hint to be displayed on the first render.
2021-09-18all: add "Hint" for Target, HTTP, and WebSocket TargetShulhan
The "Hint" provide a general description for Target, a single HttpTarget, and WebSocketTarget.
2021-09-18_www: add "hint" for input of Environment and Attack optionsShulhan
The hint is a text that will be displayed when the icon "i" on the right side of input is clicked. It provide a description of input.
2021-09-18www: refactoring using TypeScript and wui libraryShulhan
Previously, the web user interface is written in pure, single JavaScript file. The LOC is short but its become hard to maintenance, especially when there is a change in HTML layout or on the response format. This changes rewrite the interface to use TypeScript in order to easily maintenance. The generated JavaScript is loaded using module [1]. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
2021-09-09_www: set the HTTP and WebSocket background titleShulhan
This is to make the target title distinguishable in between another titles.
2021-09-09_www: make the target also clickableShulhan
Previously only HTTP/WS targets that have their link when the navigation item is clicked. This changes make the header target to be clickable too. Also, changes the hash path to use the following format, * "/${target.ID}" - for target only * "/${target.ID}/http/${httptarget.ID}" - for HTTP target * "/${target.ID}/ws/${httptarget.ID}" - for WebSocket target
2021-09-06all: set the original HTTP target if IsCustomizable is trueShulhan
If the HTTP target IsCustomizable, user can set the request method, path, and/or request type. When user changes those values, the values should overwrite the configuration on server, so the Run method can use it for creating request.
2021-09-02_www: implement hash location on each targetShulhan
When user click the target, the location hash will be set to the target id. By setting the hash, we can allow user to refresh the page and render the previous selected target.
2021-09-02_www: hide the "Attack results" on each target if AllowAttack is falseShulhan