Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fuzzBackEnd
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
钱炳权
fuzzBackEnd
Commits
7752009e
Commit
7752009e
authored
May 27, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加车联网协议
parent
e47c4040
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
162 additions
and
0 deletions
+162
-0
ProtocolConstent.java
.../com/example/fuzzControll/constents/ProtocolConstent.java
+5
-0
ServerClassEnum.java
...a/com/example/fuzzControll/constents/ServerClassEnum.java
+32
-0
ProtocolTemplateImpl.java
...ample/fuzzControll/service/impl/ProtocolTemplateImpl.java
+125
-0
No files found.
fuzzIntegration/src/main/java/com/example/fuzzControll/constents/ProtocolConstent.java
View file @
7752009e
...
@@ -48,4 +48,9 @@ public class ProtocolConstent {
...
@@ -48,4 +48,9 @@ public class ProtocolConstent {
public
static
final
String
RSTP
=
"rstp_raw.py "
;
public
static
final
String
RSTP
=
"rstp_raw.py "
;
public
static
final
String
SMTP
=
"smtp_tcp.py "
;
public
static
final
String
SMTP
=
"smtp_tcp.py "
;
public
static
final
String
TIRP
=
"tirp_udp.py "
;
public
static
final
String
TIRP
=
"tirp_udp.py "
;
public
static
final
String
AMQP
=
"amqp.py "
;
public
static
final
String
UDPNM
=
"udpnm_udp.py "
;
public
static
final
String
DOIP
=
"doip.py "
;
public
static
final
String
COAP
=
"coap.py "
;
public
static
final
String
MQTT
=
"mqtt.py "
;
}
}
fuzzIntegration/src/main/java/com/example/fuzzControll/constents/ServerClassEnum.java
View file @
7752009e
package
com
.
example
.
fuzzControll
.
constents
;
package
com
.
example
.
fuzzControll
.
constents
;
public
enum
ServerClassEnum
{
public
enum
ServerClassEnum
{
RTSP
(
"rtsp"
,
"testOnDemandRTSPServer 8554"
),
FTP
(
"ftp"
,
"testOnDemandFTP 8554"
),
//error
DTLS12
(
"dtls12"
,
"testOnDemandFTP 8554"
),
//error
DNS
(
"dns"
,
"testOnDemandFTP 8554"
),
//error
DICOM
(
"dicom"
,
"testOnDemandFTP 8554"
),
//error
SMTP
(
"smtp"
,
"testOnDemandFTP 8554"
),
//error
SSH
(
"ssh"
,
"testOnDemandFTP 8554"
),
//error
TLS
(
"tls"
,
"testOnDemandFTP 8554"
),
//error
DAAP_HTTP
(
"daap_http"
,
"testOnDemandFTP 8554"
),
//error
SIP
(
"sip"
,
"testOnDemandFTP 8554"
);
//error
private
String
name
;
private
String
serverName
;
ServerClassEnum
(
String
name
,
String
serverName
)
{
this
.
name
=
name
;
this
.
serverName
=
serverName
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getServerName
()
{
return
serverName
;
}
public
void
setServerName
(
String
serverName
)
{
this
.
serverName
=
serverName
;
}
}
}
fuzzIntegration/src/main/java/com/example/fuzzControll/service/impl/ProtocolTemplateImpl.java
View file @
7752009e
...
@@ -138,6 +138,20 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -138,6 +138,20 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
return
smtpCmd
(
testEntity
);
return
smtpCmd
(
testEntity
);
case
"tirp"
:
case
"tirp"
:
return
tirpCmd
(
testEntity
);
return
tirpCmd
(
testEntity
);
case
"amqp"
:
//todo need doc
return
amqpCmd
(
testEntity
);
case
"udpnm"
:
return
udpnmCmd
(
testEntity
);
case
"someIp"
:
return
someIpCmd
(
testEntity
);
case
"doip"
:
return
doipCmd
(
testEntity
);
case
"coap"
:
return
coapCmd
(
testEntity
);
case
"mqtt"
:
return
mqttCmd
(
testEntity
);
case
"sendPcap"
:
return
sendPcapCmd
(
testEntity
);
default
:
default
:
throw
new
FuzzException
(
"Unknown protocol!"
);
throw
new
FuzzException
(
"Unknown protocol!"
);
}
}
...
@@ -147,6 +161,117 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -147,6 +161,117 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
}
}
private
String
sendPcapCmd
(
TestEntity
testEntity
)
{
//todo 还不清楚怎么做
return
null
;
}
private
String
mqttCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
5
,
"mqtt"
))
{
return
""
;
}
String
ip
=
null
;
String
port
=
null
;
String
topic
=
null
;
String
username
=
null
;
String
password
=
null
;
try
{
ip
=
testEntity
.
getParamJson
()[
0
];
port
=
testEntity
.
getParamJson
()[
1
];
topic
=
testEntity
.
getParamJson
()[
1
];
username
=
testEntity
.
getParamJson
()[
1
];
password
=
testEntity
.
getParamJson
()[
1
];
}
catch
(
Exception
e
)
{
log
.
error
(
"mqtt参数解析失败!"
);
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
MQTT
+
" "
+
ip
+
" "
+
port
+
" "
+
topic
+
" "
+
username
+
" "
+
password
;
}
private
String
coapCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
3
,
"coap"
))
{
return
""
;
}
String
ip
=
null
;
String
port
=
null
;
String
path
=
null
;
try
{
ip
=
testEntity
.
getParamJson
()[
0
];
port
=
testEntity
.
getParamJson
()[
1
];
path
=
testEntity
.
getParamJson
()[
1
];
}
catch
(
Exception
e
)
{
log
.
error
(
"coap参数解析失败!"
);
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
COAP
+
" "
+
ip
+
" "
+
port
+
" "
+
path
;
}
private
String
doipCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"doip"
))
{
return
""
;
}
String
ip
=
null
;
String
port
=
null
;
try
{
ip
=
testEntity
.
getParamJson
()[
0
];
port
=
testEntity
.
getParamJson
()[
1
];
}
catch
(
Exception
e
)
{
log
.
error
(
"doip参数解析失败!"
);
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
UDPNM
+
" "
+
ip
+
" "
+
port
;
}
private
String
someIpCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"someIp"
))
{
return
""
;
}
String
ip
=
null
;
String
port
=
null
;
try
{
ip
=
testEntity
.
getParamJson
()[
0
];
port
=
testEntity
.
getParamJson
()[
1
];
}
catch
(
Exception
e
)
{
log
.
error
(
"someIp参数解析失败!"
);
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
DOIP
+
" "
+
ip
+
" "
+
port
;
}
private
String
udpnmCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"udpnm"
))
{
return
""
;
}
String
ip
=
null
;
String
port
=
null
;
try
{
ip
=
testEntity
.
getParamJson
()[
0
];
port
=
testEntity
.
getParamJson
()[
1
];
}
catch
(
Exception
e
)
{
log
.
error
(
"udpnm参数解析失败!"
);
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
UDPNM
+
" "
+
ip
+
" "
+
port
;
}
private
String
amqpCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
5
,
"amqp"
))
{
return
""
;
}
String
ip
=
null
;
String
port
=
null
;
String
queue
=
null
;
String
exchange
=
null
;
String
routing_key
=
null
;
try
{
ip
=
testEntity
.
getParamJson
()[
0
];
port
=
testEntity
.
getParamJson
()[
1
];
queue
=
testEntity
.
getParamJson
()[
2
];
exchange
=
testEntity
.
getParamJson
()[
3
];
routing_key
=
testEntity
.
getParamJson
()[
4
];
}
catch
(
Exception
e
)
{
log
.
error
(
"amqp参数解析失败!"
);
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
AMQP
+
" "
+
ip
+
" "
+
port
+
" "
+
queue
+
" "
+
exchange
+
" "
+
routing_key
;
}
private
String
tirpCmd
(
TestEntity
testEntity
)
{
private
String
tirpCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"tirp"
))
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"tirp"
))
{
return
""
;
return
""
;
...
...
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