Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
IOT-fuzz
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
尹启迪
IOT-fuzz
Commits
e99269ef
Commit
e99269ef
authored
Nov 23, 2020
by
张航玮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 脚本生成.py
parent
3a830c88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
32 deletions
+63
-32
脚本生成.py
脚本生成.py
+63
-32
No files found.
脚本生成.py
View file @
e99269ef
impor
t
os
impor
t
os
...
...
@@ -4,27 +4,28 @@ IP='192.168.1.1'
PORT
=
80
script
=
'from boofuzz import *
\r\n
'
name_list
=
[]
def
add_script
(
lines
):
global
script
for
line
in
lines
:
script
+=
line
script
+=
line
def
function_name
(
file_dir
):
global
script
functions
=
os
.
listdir
(
file_dir
)
for
function
in
functions
:
function
=
'function/'
+
function
f
=
open
(
function
,
'r'
)
lines
=
f
.
readlines
()
print
(
lines
)
#
print(lines)
add_script
(
lines
)
script
+=
'
\r\n
'
def
do_body
(
line
):
def
do_data
(
line
):
global
script
line
=
line
[
0
:
-
1
]
t
=
line
.
split
(
'&'
)
for
i
in
range
(
len
(
t
)):
m
,
n
=
t
[
i
]
.
split
(
'='
)
...
...
@@ -33,10 +34,27 @@ def do_body(line):
if
i
!=
len
(
t
)
-
1
:
script
+=
'
\t\t
s_static("&")
\r\n
'
def
do_body
(
line
):
global
script
t
=
line
.
split
(
' '
)
print
(
t
)
if
t
[
0
]
!=
"GET"
:
for
i
in
range
(
len
(
t
)):
if
'
\n
'
in
t
[
i
]:
tt
=
t
[
i
]
.
split
(
'
\n
'
)
if
i
!=
0
:
script
+=
'
\t
s_delim(" ")
\r\n
'
script
+=
'
\t
s_static("
%
s")
\r\n
'
%
(
tt
[
0
])
script
+=
'
\t
s_static("
\\
r
\\
n")
\r\n
'
else
:
if
i
!=
0
:
script
+=
'
\t
s_delim(" ")
\r\n
'
script
+=
'
\t
s_static("
%
s")
\r\n
'
%
(
t
[
i
])
else
:
print
(
"123"
)
function_name
(
"function"
)
print
(
script
)
...
...
@@ -48,13 +66,35 @@ script+='\tsession = Session(target=tar,receive_data_after_each_request=True,)\r
f
=
open
(
"
REQUEST_FILE
"
,
'r'
)
Fscript
=
open
(
'
./FuzzScript.py'
,
'wb
'
)
f
=
open
(
"
1.txt
"
,
'r'
)
Fscript
=
open
(
'
FuzzScript.py'
,
'w
'
)
lines
=
f
.
readlines
()
for
line
in
lines
:
if_data
=
False
for
i
in
range
(
len
(
lines
)):
line
=
lines
[
i
]
if
line
[
0
:
3
]
==
"-*-"
:
name
=
line
[
3
:
-
1
]
print
(
name
)
script
+=
'
\t
s_initialize(name="
%
s")
\r\n
'
%
(
name
)
name_list
.
append
(
name
)
elif
line
==
'
\n
'
:
next_line
=
lines
[
i
+
1
]
if
next_line
[
0
:
3
]
!=
"-*-"
:
if_data
=
True
else
:
print
(
i
)
if
if_data
:
script
+=
'
\t
with s_block("data"):
\r\n
'
do_data
(
next_line
)
print
(
"data"
)
if_data
=
False
else
:
do_body
(
line
)
# while line:
# if line=='\r\n':
...
...
@@ -72,21 +112,13 @@ for line in lines:
# else:
# t=line.split(' ')
# for i in range(len(t)):
# if '\n' in t[i]:
# tt=t[i].split('\n')
# if i!=0:
# script+='\t\ts_delim(" ")\r\n'
# script+='\t\ts_static("%s")\r\n' %(tt[0])
# script+='\t\ts_static("\\r\\n")\r\n'
# else:
# if i!=0:
# script+='\t\ts_delim(" ")\r\n'
# script+='\t\ts_static("%s")\r\n' %(t[i])
# line=f.readline()
# script+='\r\n'
# Fscript.write(script)
# Fscript.close()
# f.close()
\ No newline at end of file
# t=line.split(' ')
# for i in range(len(t)):
# line=f.readline()
# script+='\r\n'
print
(
script
)
Fscript
.
write
(
script
)
Fscript
.
close
()
f
.
close
()
print
(
name_list
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment