-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
checksec FORTIFY detection (proccheck) again #244
Closed
Closed
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b11a343
Update proccheck.sh (Fortify)
teoberi 30add96
Update hardening-checks.sh (Fortify proccheck)
teoberi fffec3a
Update build_binaries.sh (Fortify)
teoberi 042ea07
Change test files for Fortify
teoberi 90fdaf8
Add files via upload *.o (object files)
teoberi e75f862
Merge pull request #1 from teoberi/teoberi-NASM-files
teoberi fda3410
Update build_binaries.sh (Fortify). Added warning about NASM assemble…
teoberi d0e898c
Merge branch 'Fortify_proccheck' of https://github.com/teoberi/checks…
teoberi f9fddaf
Add NASM and binutils in the base image.
teoberi cca825b
Add NASM and binutils on the base image.
teoberi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#include <stdio.h> | ||
#include <unistd.h> | ||
|
||
int main() | ||
{ | ||
printf("Hello World\n"); | ||
sleep(2); | ||
return 0; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
section .data | ||
msg db 'Hello, World!', 0ah ;note the newline (Line Feed-LF) at the end (hex:0ah; decimal:10) | ||
len equ $ - msg ;calculate the length of the message | ||
delay dq 2, 100000000 ;define delay with Timespec structure members tv_sec, tv_nsec (qwords, 64-bit integer values) | ||
|
||
section .text | ||
global _start ;must be declared for linker (ld) | ||
|
||
_start: ;tells linker entry point | ||
mov rax, 1 ;system call for write (sys_write 1) | ||
mov rdi, 1 ;file descriptor (1 is stdout) | ||
mov rsi, msg ;address of string to output | ||
mov rdx, len ;message length | ||
syscall ;invoke operating system to do the write | ||
|
||
mov rax, 35 ;system call for nanosleep (sys_nanosleep 35) | ||
mov rdi, delay ;load the pointer to our delay | ||
mov rsi, 0 ;exit code 0 | ||
syscall ;invoke operating system to do the delay | ||
|
||
mov rax, 60 ;system call for exit (sys_exit 60) | ||
xor rdi, rdi ;exit code 0 | ||
syscall ;invoke operating system to exit |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
section .data | ||
msg db "Hello, world!", 0xa ;note the newline (Line Feed-LF) at the end (hex:0ah; decimal:10) | ||
len equ $ - msg ;calculate the length of the message | ||
delay dd 2, 100000000 ;define delay with Timespec structure members tv_sec, tv_nsec (dwords, 32-bit integer values) | ||
|
||
section .text | ||
global _start ;must be declared for linker (ld) | ||
|
||
_start: ;tells linker entry point | ||
mov eax,4 ;system call for write (sys_write 4) | ||
mov ebx,1 ;file descriptor (1 is stdout) | ||
mov ecx,msg ;address of string to output | ||
mov edx,len ;message length | ||
int 0x80 ;invoke operating system to do the write | ||
|
||
mov eax, 162 ;system call for nanosleep (sys_nanosleep 162) | ||
mov ebx, delay ;load the pointer to our delay | ||
mov ecx, 0 ;exit code 0 | ||
int 0x80 ;invoke operating system to do the delay | ||
|
||
mov eax,1 ;system call for exit (sys_exit 1) | ||
xor ebx, ebx ;exit code 0 | ||
int 0x80 ;invoke operating system to exit |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these
.o
files need included? Wouldn't these be compiled by nasm?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two variants:
If the two files are delivered but NASM is also installed, the files are overwritten, as I explained in the post here and here.
I know from experience in other open-source projects that in general binary files are not accepted in the source code but should be generated. Without installing NASM I have no way to do this, that's why I added them.
I asked in the first post after the description for Pull requests if NASM can be installed or if I should add the object files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be added:
nasm binutils
in the docker unbuntu and photon configuration files?
https://github.com/slimm609/checksec.sh/blob/9a7f5353af5ab714abb91c1d4aecfc10ce3af8e4/Dockerfile.ubuntu#L8
gcc clang gcc-multilib nasm binutils && apt-get clean \
https://github.com/slimm609/checksec.sh/blob/9a7f5353af5ab714abb91c1d4aecfc10ce3af8e4/Dockerfile.photon#L7
findutils gzip file which libxml2 python3 python3-pip jq clang nasm binutils && \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add nasm to the images, thats just fine. The Dockerfile.photon and Dockerfile.ubuntu are only used for testing and not shipped as part of the checksec docker image. Anything added to those 2 images is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do that. If it will be OK, I will make a new Pull Requests, this is a bit messy.