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
3e45851d
Commit
3e45851d
authored
Mar 29, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
24/3/29 漏洞类型接口开发完成
parent
9cfe5d97
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
93 additions
and
1 deletions
+93
-1
spring.log
fuzzbackend/log/spring.log
+0
-0
kittyProperties.java
...n/java/com/example/fuzzControll/conf/kittyProperties.java
+9
-1
vulnerabilityTypeConstent.java
...ple/fuzzControll/constents/vulnerabilityTypeConstent.java
+5
-0
vulnerabilityTypeController.java
.../fuzzControll/controller/vulnerabilityTypeController.java
+19
-0
vulnerabilityTypeEntity.java
...example/fuzzControll/pojo/vo/vulnerabilityTypeEntity.java
+9
-0
vulnerabilityTypeServiceImpl.java
...zzControll/service/impl/vulnerabilityTypeServiceImpl.java
+41
-0
vulnerabilityTypeService.java
...xample/fuzzControll/service/vulnerabilityTypeService.java
+8
-0
application-dev.yml
fuzzbackend/src/main/resources/application-dev.yml
+2
-0
No files found.
fuzzbackend/log/spring.log
View file @
3e45851d
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/conf/kittyProperties.java
View file @
3e45851d
...
...
@@ -9,7 +9,7 @@ public class kittyProperties {
String
path
;
String
venvPath
;
String
methodPath
;
String
vulnerabilityTypePath
;
public
String
getPath
()
{
return
path
;
}
...
...
@@ -33,4 +33,12 @@ public class kittyProperties {
public
void
setMethodPath
(
String
methodPath
)
{
this
.
methodPath
=
methodPath
;
}
public
String
getVulnerabilityTypePath
()
{
return
vulnerabilityTypePath
;
}
public
void
setVulnerabilityTypePath
(
String
vulnerabilityTypePath
)
{
this
.
vulnerabilityTypePath
=
vulnerabilityTypePath
;
}
}
fuzzbackend/src/main/java/com/example/fuzzControll/constents/vulnerabilityTypeConstent.java
0 → 100644
View file @
3e45851d
package
com
.
example
.
fuzzControll
.
constents
;
public
class
vulnerabilityTypeConstent
{
public
static
final
String
ARRAY_INDEX_OUT_OF_BOUNDS_VULNERABILIT
=
"0"
;
}
fuzzbackend/src/main/java/com/example/fuzzControll/controller/vulnerabilityTypeController.java
View file @
3e45851d
package
com
.
example
.
fuzzControll
.
controller
;
import
com.example.fuzzControll.pojo.vo.AjaxResult
;
import
com.example.fuzzControll.pojo.vo.generateMethodEntity
;
import
com.example.fuzzControll.pojo.vo.vulnerabilityTypeEntity
;
import
com.example.fuzzControll.service.testService
;
import
com.example.fuzzControll.service.vulnerabilityTypeService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/vulnerabilityType"
)
public
class
vulnerabilityTypeController
{
@Autowired
vulnerabilityTypeService
service
;
@RequestMapping
(
value
=
"/generate"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
upload
(
@RequestBody
vulnerabilityTypeEntity
vulnerabilityTypeEntity
)
{
try
{
service
.
generation
(
vulnerabilityTypeEntity
);
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"漏洞类型测试失败!"
);
}
return
AjaxResult
.
success
(
"漏洞类型测试成功!"
);
}
}
fuzzbackend/src/main/java/com/example/fuzzControll/pojo/vo/vulnerabilityTypeEntity.java
0 → 100644
View file @
3e45851d
package
com
.
example
.
fuzzControll
.
pojo
.
vo
;
import
lombok.Data
;
@Data
public
class
vulnerabilityTypeEntity
{
String
vulnerabilityTypeName
;
String
[]
paramJson
;
}
fuzzbackend/src/main/java/com/example/fuzzControll/service/impl/vulnerabilityTypeServiceImpl.java
0 → 100644
View file @
3e45851d
package
com
.
example
.
fuzzControll
.
service
.
impl
;
import
com.example.fuzzControll.conf.kittyProperties
;
import
com.example.fuzzControll.constents.protocolConstent
;
import
com.example.fuzzControll.constents.vulnerabilityTypeConstent
;
import
com.example.fuzzControll.pojo.vo.protocolGenerationEntity
;
import
com.example.fuzzControll.pojo.vo.vulnerabilityTypeEntity
;
import
com.example.fuzzControll.service.vulnerabilityTypeService
;
import
com.example.fuzzControll.tools.cmdTools
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
(
"vulnerabilityTypeService"
)
public
class
vulnerabilityTypeServiceImpl
implements
vulnerabilityTypeService
{
cmdTools
cmdTools
=
new
cmdTools
();
@Autowired
kittyProperties
kitty
;
@Override
public
void
generation
(
vulnerabilityTypeEntity
vulnerabilityTypeEntity
)
{
String
cmd
=
parseParameters
(
vulnerabilityTypeEntity
);
cmdTools
.
runProgramCmdAndResultTofile
(
cmd
);
}
public
String
parseParameters
(
vulnerabilityTypeEntity
vulnerabilityTypeEntity
)
{
switch
(
vulnerabilityTypeEntity
.
getVulnerabilityTypeName
().
toLowerCase
())
{
case
"array_index_out_of_bounds_vulnerabilit"
:
return
arrayIndexOutOfBoundsVulnerabilitCmd
(
vulnerabilityTypeEntity
);
default
:
log
.
error
(
"未知漏洞![{}]"
,
vulnerabilityTypeEntity
.
getVulnerabilityTypeName
());
return
null
;
}
}
private
String
arrayIndexOutOfBoundsVulnerabilitCmd
(
vulnerabilityTypeEntity
vulnerabilityTypeEntity
)
{
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getVulnerabilityTypePath
()
+
"vul_types_test.py "
+
vulnerabilityTypeConstent
.
ARRAY_INDEX_OUT_OF_BOUNDS_VULNERABILIT
;
}
//todo 还有很多类型要写
}
fuzzbackend/src/main/java/com/example/fuzzControll/service/vulnerabilityTypeService.java
0 → 100644
View file @
3e45851d
package
com
.
example
.
fuzzControll
.
service
;
import
com.example.fuzzControll.pojo.vo.protocolGenerationEntity
;
import
com.example.fuzzControll.pojo.vo.vulnerabilityTypeEntity
;
public
interface
vulnerabilityTypeService
{
void
generation
(
vulnerabilityTypeEntity
vulnerabilityTypeEntity
);
}
fuzzbackend/src/main/resources/application-dev.yml
View file @
3e45851d
...
...
@@ -20,3 +20,4 @@ kitty:
path
:
"
/home/qbq/fuzz50/kitty/renix/"
#kitty项目下的各协议生成模板python文件路径
venvPath
:
"
/home/qbq/fuzz50/kitty/venv/bin/python"
methodPath
:
"
/home/qbq/fuzz50/kitty/2020test/"
#kitty下变异方法路径
vulnerabilityTypePath
:
"
/home/qbq/fuzz50/kitty/2020test/"
#kitty下漏洞类型python路径
\ No newline at end of file
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