File tree Expand file tree Collapse file tree 4 files changed +16
-19
lines changed Expand file tree Collapse file tree 4 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Updates
22
22
- golang: real 0m0.691s
23
23
- Adds recursive directory support
24
24
TODO:
25
- - [ ] Fix Partial RELRO
25
+ - [X ] Fix Partial RELRO
26
26
- [ ] Add fortify file function results
27
27
- [ ] Add fortifyProc
28
28
- [ ] Add ProcLibs
Original file line number Diff line number Diff line change @@ -37,14 +37,7 @@ func Fortify(name string, binary *elf.File) *fortify {
37
37
38
38
ldd := GetLdd (name )
39
39
40
- if ldd == "none" {
41
- res .Output = "N/A"
42
- res .Color = "green"
43
- res .Fortified = "0"
44
- res .Fortifiable = "0"
45
- res .LibcSupport = "N/A"
46
- return & res
47
- } else if ldd == "unk" {
40
+ if ldd == "none" || ldd == "unk" {
48
41
res .Output = "N/A"
49
42
res .Color = "unset"
50
43
res .Fortified = "0"
Original file line number Diff line number Diff line change @@ -25,8 +25,14 @@ func RELRO(name string) *relro {
25
25
}
26
26
defer file .Close ()
27
27
28
- bind , _ := file .DynValue (24 )
29
- if len (bind ) > 0 && bind [0 ] == 0 {
28
+ // check both bind and bind_flag.
29
+ // if DT_BIND_NOW == 0, then it is set
30
+ // if DT_FLAGS == 8, then DF_BIND_NOW is set
31
+ // this is depending on the compiler version used.
32
+ bind , _ := file .DynValue (elf .DT_BIND_NOW )
33
+ bind_flag , _ := file .DynValue (elf .DT_FLAGS )
34
+
35
+ if (len (bind ) > 0 && bind [0 ] == 0 ) || (len (bind_flag ) > 0 && bind_flag [0 ] == 8 ) {
30
36
bindNow = true
31
37
}
32
38
Original file line number Diff line number Diff line change @@ -7,14 +7,12 @@ import (
7
7
func PrintLogo () {
8
8
Red := color .New (color .FgHiRed , color .Bold )
9
9
asciiLogo := `
10
- _______ _______ _______ _ _______ _______ _______
11
- ( ____ \|\ /|( ____ \( ____ \| \ /\( ____ \( ____ \( ____ \
12
- | ( \/| ) ( || ( \/| ( \/| \ / /| ( \/| ( \/| ( \/
13
- | | | (___) || (__ | | | (_/ / | (_____ | (__ | |
14
- | | | ___ || __) | | | _ ( (_____ )| __) | |
15
- | | | ( ) || ( | | | ( \ \ ) || ( | |
16
- | (____/\| ) ( || (____/\| (____/\| / \ \/\____) || (____/\| (____/\
17
- (_______/|/ \|(_______/(_______/|_/ \/\_______)(_______/(_______/
10
+ _____ _ _ ______ _____ _ __ _____ ______ _____
11
+ / ____| | | | ____/ ____| |/ // ____| ____/ ____|
12
+ | | | |__| | |__ | | | ' /| (___ | |__ | |
13
+ | | | __ | __|| | | < \___ \| __|| |
14
+ | |____| | | | |___| |____| . \ ____) | |___| |____
15
+ \_____|_| |_|______\_____|_|\_\_____/|______\_____|
18
16
`
19
17
Red .Println (asciiLogo )
20
18
}
You can’t perform that action at this time.
0 commit comments