jtpereyda / boofuzz

A fork and successor of the Sulley Fuzzing Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

http request body is always truncated

ssandme opened this issue · comments

I wrote a http post request script. There are more than 8,000 use cases after mutation, but every time the request body is sent out, it is not complete. I don’t know why. When I try to modify the request header After the length of one of the field values, the request content is sent out completely, but the actual length of the request header is so long, is there any way I can send the complete request content under such circumstances? My complete script is as follows, and the modified request header is: X-Auth-Value
`from boofuzz import *

def main():
URI = "/dte-crm-epms-portal/phase/2/733dd11e-0b5a-462f-9a10-f29315a97db6"
XVALUE= "wqlXb4FYWrDTWh08E_TFO3T4MfRQhal5BIs39-PsM3O.9RjNwUzMzkjM2EjOiAHelJCLiEGMlBDZ3gjYkFmZlRzM5MmNxcjMyUjZjRTN5ATN2MTZiojI1Jye.9JiN1IzUIJiOicGbhJCLiQ1VKJiOiAXe0Jye"
#XVALUE ="HHh.uuu.09l"
session = Session(
target=Target(connection=TCPSocketConnection("epmsfz.dte.com.cn", 443)),
)
s_initialize(name="Request")
with s_block("Request"):
# POST @/dte-crm-epms-portal/phase/2/733dd11e-0b5a-462f-9a10-f29315a97db6 HTTP/1.1
s_group("Method", ["PUT", "HEAD", "GET", "POST", "DELETE", "CONNECT", "OPTIONS", "TRACE"])
s_delim(" ", name="space-1")
s_static(URI, name="Request-URI")
s_delim(" ", name="space-2")
s_static("HTTP/1.1", name="HTTP-Version")
s_static("\r\n", name="Request-Line-CRLF")
# Host: epmsfz.dte.com.cn
s_static("Host:", name="Host-Line")
s_delim(" ", name="space-3")
s_static("epmsfz.dte.com.cn", name="Host-Line-Value")
s_static("\r\n", name="Host-Line-CRLF")
# X-Account-Id: 10232465
s_static("X-Account-Id:", name="X-Account-Id-Line")
s_delim(" ", name="space-4")
s_static("10232465", name="X-Account-Id-Value")
s_static("\r\n", name="X-Account-Id-CRLF")
# X-Emp-No: 10232465
s_static("X-Emp-No:", name="X-Emp-No-Line")
s_delim(" ", name="space-5")
s_static("10232465", name="X-Emp-No-Line-Value")
s_static("\r\n", name="X-Emp-No-Line-CRLF")
# Internal: 1
s_static("Internal:", name="Internal-Line")
s_delim(" ", name="space-6")
s_static("1", name="Internal-Value")
s_static("\r\n", name="Internal-CRLF")
# X-Auth-Value: 10232465
s_static("X-Auth-Value:", name="X-Auth-Value-Line")
s_delim(" ", name="space-7")
s_static(XVALUE,name="X-Auth-Value-Value")
s_static("\r\n", name="X-Auth-Value-Line-CRLF")
# X-Proj-I: 733dd11e-0b5a-462f-9a10-f29315a97db6
s_static("X-Proj-Id:", name="X-Proj-Id-Line")
s_delim(" ", name="space-8")
s_static("733dd11e-0b5a-462f-9a10-f29315a97db6", name="X-Proj-Id-Value")
s_static("\r\n", name="X-Proj-Id-Line-CRLF")

    s_static("Content-Type:", name="Content-Type-Line")
    s_delim(" ", name="space-9")
    s_static("application/json;charset=utf-8", name="Content-Type-Value")
    s_static("\r\n", name="Content-Type-Line-CRLF")

    s_static("Content-Length:", name="Content-Length-Header")
    s_delim(" ", name="space-10")
    s_size("Body-Content", output_format="ascii", name="Content-Length-Value")
    s_static("\r\n", "Content-Length-CRLF")
s_static("\r\n", "Request-CRLF")
with s_block("Body-Content"):
    # s_string('{"basProjPhaseId":"","phaseName":"hahhahah","phaseRemark":"","saleProjId":""}',
    #          name="Body-Content-Value")
    s_static('{')
    s_static('"basProjPhaseId"')
    s_delim(":")
    s_string('""')
    s_delim(",")

    s_static('"phaseName"')
    s_delim(":")
    s_string('""')
    s_delim(",")

    s_static('"phaseRemark"')
    s_delim(":")
    s_string('""')
    s_delim(",")

    s_static('"saleProjId"')
    s_delim(":")
    s_string('""')

    s_static('}')

session.connect(s_get("Request"))
session.fuzz()

if name == "main":
main()`