Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
truonghm committed Sep 22, 2023
1 parent 34ff3a9 commit 5f7e7ff
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Malicious JavaScript Detection

## Running the demo

```bash
docker-compose up -d
```

Example request body:

```json
{
"javascript": [
{
"idx": "string1",
"code": "console.log('Hello World!');"
},
{
"idx": "string2",
"code": "document.write('<center>' '<iframe width=\"11\" height=\"1\" ' 'src=\"http://laghzesh.rzb.ir\" ' 'style=\"border: 0px;\" ' 'frameborder=\"0\" ' 'scrolling=\"auto\">' '</iframe>');"
}
]
}
```

Response:

```json
{
"results": [
{
"idx": "string1",
"label": "benign"
},
{
"idx": "string2",
"label": "malicious"
}
]
}
```

## Training

```bash
./scripts/train_codebert_unimodal.sh
./scripts/train_codebert_bimodal.sh
```

## Testing

```bash
./scripts/inference_codebert_unimodal.sh
./scripts/inference_codebert_bimodal.sh
```

0 comments on commit 5f7e7ff

Please sign in to comment.