Skip to content

Commit

Permalink
First commit, many more to come
Browse files Browse the repository at this point in the history
  • Loading branch information
pinyugi committed Jun 25, 2020
0 parents commit 18fe387
Show file tree
Hide file tree
Showing 16 changed files with 1,187 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
package-lock.json
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2020 BottingRocks

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
zz
108 changes: 108 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
ticket-cli
=======================

A simple cli app to help you with Supreme's ticket. It can bootstrap a ticket.wasm file into a NodeJS file, that
can run by itself.

On the bin/ folder there is a copy of a wasm2js that it's compiled from https://github.com/WebAssembly/binaryen.

You can install ticket-cli by running `npm -g install` or just execute it directly by from the bin/ folder.

Note: You still have to call `npm install` if you intend on running it from the bin/ folder.

Example:

```js

./bin/run --help

//or if it is installed locally

ticket --help

```

ticket
<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)

# Commands
<!-- commands -->
* [`ticket bootstrap`](#ticket-bootstrap)

## `ticket bootstrap`

Bootstraps a ticket.wasm file into an equivalent stand-alone NodeJS script

```
USAGE
$ ticket bootstrap TICKET_FILE BOOTSTRAP_FILE
ARGUMENTS
TICKET_FILE Ticket.wasm file
BOOTSTRAP_FILE Output file where to save the newly generated bootstrapped JS ticket.wasm
OPTIONS
--run-times=run-times Run the _ticket generating process N times. Default value is set to 0 meaning it will run forevever until the
bootstrapped script has exited
--timestamp=timestamp Uses a static timestamp instead of using Date.now() on the bootstrapped script
--user-agent=user-agent Sets a custom User-Agent
DESCRIPTION
Converts a ticket.wasm file into a NodeJS script that can be run independently from the browser. It uses wasm2js to
initially convert the wasm file into a Javascript file.
However, the sys calls are not correctly imported
so this command goes further into making some more additions via modifying the JS AST after the wasm-to-js conversion. It adds some browser's
properties such as Document, User-Agent, and anything else that ticket.wasm might request.
Note: Supreme's ticket.wasm might start requesting other browser properties, so some of these flag options
might change.
Adding your User-Agent into the bootstrapped script is easy as adding
the --user-agent flag and specifying the custom User-Agent you want.
Note: Not passing a User-Agent will result in using the default User-Agent which is: "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
In addition, you can also pass in the --run-times flag which will limit your bootstrapped script to only run N number of times.
This is especially good because Supreme's ticket.wasm runs indefinitely and will continue to generate new _ticket values in a never-ending
loop until the script exits.
Passing a static timestamp is also an option if you want your bootstrapped script to start with a desired timestamp.
Example: Loading the wasm through a local file path that contains ticket.wasm
$ ticket bootstrap ticket.wasm ticket.wasm.js
Example: Using a custom User-Agent
$ ticket bootstrap --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
ticket.wasm ticket.wasm.js
Example: Limiting the bootstrapped script to generate a maximum of 5 _ticket cookies
$ ticket bootstrap --run-times=5 ticket.wasm ticket.wasm.js
Example: Passing a static timestamp
$ ticket bootstrap --timestamp=1591993300052 ticket.wasm ticket.wasm.js
To run the bootstrapped file is as simple as:
$ node ticket.wasm.js
```

#Roadmap

The commands `generate-call-graph`, `log-func-args`, `log-func-calls`, and `print-props` will be implemented some time in the near future.
5 changes: 5 additions & 0 deletions bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

require('@oclif/command').run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'))
3 changes: 3 additions & 0 deletions bin/run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\run" %*
Binary file added bin/wasm2js
Binary file not shown.
Binary file added fixtures/ticket.wasm
Binary file not shown.
72 changes: 72 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "ticket-cli",
"version": "0.1.0",
"description": "A tool with various commands to help you debug Supreme's Ticket WASM file with ease.",
"keywords": [
"supreme",
"anti-bot",
"ticket",
"ticket supreme"
],
"homepage": "https://github.com/BottingRocks/ticket-cli",
"bugs": "https://github.com/BottingRocks/ticket-cli/issues",
"repository": "BottingRocks/ticket-cli",
"license": "MIT",
"author": "BottingRocks",
"main": "src/index.js",
"bin": {
"ticket": "./bin/run"
},
"files": [
"/bin",
"/src"
],
"scripts": {
"prepack": "oclif-dev manifest && oclif-dev readme",
"postpack": "rm -f oclif.manifest.json",
"test": "nyc mocha --forbid-only \"test/**/*.test.js\"",
"posttest": "eslint .",
"version": "oclif-dev readme && git add README.md",
"eslint": "./node_modules/eslint/bin/eslint.js src/commands/ --fix"
},
"dependencies": {
"@babel/core": "7.4.3",
"@babel/generator": "^7.0.0-beta.51",
"@babel/parser": "7.4.3",
"@babel/template": "^7.10.1",
"@babel/traverse": "7.4.3",
"@babel/types": "7.4.0",
"@oclif/command": "^1",
"@oclif/config": "^1",
"@oclif/plugin-help": "^3",
"ast-types": "0.12.3",
"axios": "^0.19.2",
"chalk": "^4.0.0",
"cli-ux": "^5.4.6",
"cors": "^2.8.5",
"lodash": "^4.17.15",
"prepack": "^0.2.54",
"recast": "^0.18.1",
"request": "^2.88.2",
"request-promise": "^4.2.5"
},
"devDependencies": {
"@oclif/dev-cli": "^1",
"@oclif/test": "^1",
"chai": "^4",
"eslint": "^7.2.0",
"eslint-config-oclif": "^3.1",
"eslint-plugin-sort-requires": "^2.1.0",
"globby": "^10",
"mocha": "^5",
"nyc": "^14"
},
"engines": {
"node": ">=8.0.0"
},
"oclif": {
"commands": "./src/commands",
"bin": "ticket",
"plugins": []
}
}
Loading

0 comments on commit 18fe387

Please sign in to comment.