1
0
mirror of https://github.com/loviuz/http-chained-requests-automator.git synced 2024-12-12 08:16:12 +01:00

Updated Readme and usage

This commit is contained in:
loviuz 2021-02-05 00:50:45 +01:00
parent 4a70df7ea6
commit 277ee484ac
3 changed files with 92 additions and 69 deletions

View File

@ -22,19 +22,25 @@ $ php composer.phar install
## Usage
```bash
$ php hcra.php params.json [DEBUG]
$ php hcra.php params.json
```
- params.json: is the filename of the JSON file with specifications of the HTTP requests
- DEBUG: use only for debug purpose. It additionally prints out the body response of every HTTP request
## Configuration
To configure HTTP request you have to code your custom JSON file. You can start from the example in the repository:
```json
[
{
"configuration":
{
"verbose_level": 1
}
,
"urls": [
{
"title": "First open to get the cookie",
"url": "http://localhost/mysite/",
"method": "GET",
"headers": null,
@ -47,6 +53,7 @@ To configure HTTP request you have to code your custom JSON file. You can start
"body-regexp": null
},
{
"title": "Login",
"url": "http://localhost/mysite/",
"method": "POST",
"headers": {
@ -67,20 +74,36 @@ To configure HTTP request you have to code your custom JSON file. You can start
]
},
{
"title": "Get the email",
"url": "http://localhost§next_url§",
"method": "GET",
"headers": {
"Cookie": "§cookie§"
},
"body": null,
"header-regexp": null,
"header-regexp": [
{
"content_type": "/Content-Type: (.+)/",
"pragma": "/Pragma: (.+)/"
}
],
"body-regexp": [
{
"email": "/<p>Your email is (.+)!<\\/p>/"
}
]
],
"header-expected":
{
"content_type": "text/html; charset=UTF-8",
"pragma": "no-cache"
},
"body-expected":
{
"email": "dude@dudelang.com"
}
},
{
"title": "Get the flags",
"url": "http://localhost§next_url§?email=§email§",
"method": "GET",
"headers": {
@ -98,7 +121,8 @@ To configure HTTP request you have to code your custom JSON file. You can start
}
]
}
]
]
}
```
Every JSON object is an HTTP request with specific parameters:

View File

@ -1,9 +1,8 @@
{
"configuration":
{
"verbose_level": 1
}
,
"verbose_level": 2
},
"urls": [
{
"title": "First open to get the cookie",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 233 KiB