1. Trang chủ
  2. » Giáo án - Bài giảng

An toàn hệ điều hành và hợp ngữ

200 6 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

A Biên www.hutech.edu.vn *1.2022.COS131* tailieuhoctap@hutech.edu.vn : I .I VII BÀI 1: T NG QUAN V AN TOÀN H U HÀNH 1.2.1 Authentication 1.2.2 Authorization 1.2.3 Accounting ÀNH 1.3.3 Race Condition 10 10 10 11 1.4 11 12 12 13 14 14 15 17 18 20 21 22 23 24 25 26 3.2 26 II 3.2.1 SQL injection 27 3.2.2 OS Command Injection 27 3.2.3 Buffer Overflow 28 3.2.4 Uncontrolled Format String 29 3.2.5 Integer Overflow 29 3.2.6 Zero-Day Exploits 30 3.3 QUÁ TRÌNH KHAI THÁC 31 33 BÀI 4: CÔNG C B O M T 34 34 4.1.1 Nmap 34 4.1.2 Nessus 35 4.1.3 Fuzzing 36 4.1.4 OpenVas .37 4.1.5 MBSA 38 4.1.6 SecureCheq 39 39 4.1.8 Secunia PSI 39 4.1.9 Retina 39 4.1.10 QualysGuard 40 4.2 CÔN 40 40 41 .43 66 .66 .67 67 69 71 BÀI 5: B O V H TH NG T P TIN 72 72 73 74 75 75 76 78 91 .91 92 III 92 93 94 hác 95 96 CÂU H I VÀ BÀI T P 97 98 98 6.1.1 Malware 98 6.1.2 Virus 98 6.1.3 Worms 99 6.1.4 Trojan 99 6.1.5 Rootkit 100 6.1.6 Spyware 100 6.1.7 Programmatic 101 101 6.2.1 101 102 105 105 105 106 106 107 107 107 108 108 6.4.1 Secure Boot U 109 6.4.2 Early Antimalware (ELAM) 109 110 6.4.4 User Account Control 111 112 6.4.6 Bitlocker 113 115 BÀI 7: H P NG 116 116 116 117 117 118 IV 119 120 121 121 122 123 123 123 123 7.9.4 ghi 123 7.9 124 124 125 125 126 126 7.11 THANH GHI 127 127 128 129 129 130 131 132 132 133 134 134 135 135 135 136 136 137 138 139 140 140 141 141 141 143 V 143 143 143 144 144 147 150 152 152 7.17.2 154 155 155 155 156 156 y không i u ki n 157 y có i u ki n 157 7.18.4 Ví d 159 160 7.19.1 Ví d 161 162 7.20.1 ASCII 163 7.20.2 BCD 164 7.20.3 Ví d 165 166 i 166 168 169 170 171 172 .173 174 176 7.23.1 Cú pháp 176 7.23.2 Ví d 177 7.23.3 C u trúc D li u X p ch ng 178 180 181 183 183 7.26.2 Con tr 184 VI 7.26.3 Hàm g i h th ng x lý t 184 7.26.4 T 184 7.26.5 M 185 7.26.6 185 185 7.26.8 7.26.9 c 186 186 7.26.10 Ví d 186 188 190 VII an tồn Tin ngành An tồn thơng tin trúc Bài VIII Bài 7: cách tính ghi 8088/8086 8086, , - - 50% 50% vào phòng thi 176 BÀI 7: display: mov edx,1; dài tin nh n mov ecx, sum ;tin nh vi t mov ebx,1;mô t file(stdout) mov eax,4;g i h th ng(sys_write) int0x80;g i nhân mov eax,1;g i h int0x80;g i nhân section global x x: db db db sum: db th ng(sys_exit) data 7.23 TH T C TRONG H P NG 7.23.1 Cú pháp proc_name: procedure body ret CALL proc_name BÀI 7: 7.23.2 Ví d sum section text global _start _start: ;g i v mov ecx,'4' sub ecx,'0' mov sub ;ph s m vào trình liên k t edx,'5' edx,'0' call sum ;g i t ng th t c mov [res], eax mov ecx, msg mov edx, len mov ebx,1 ;mô t file(stdout) mov eax,4 ;g i h th ng(sys_write) int 0x80 ;g i nhân mov mov mov mov int ecx, res edx,1 ebx,1 ;mô t file(stdout) eax,4 ;g i h th ng(sys_write) 0x80 ;g i nhân mov eax,1 ;g i h th ng(sys_exit) int 0x80 ;g i nhân sum: mov eax, ecx add eax, edx add eax,'0' ret section.data msg db "The sum is:",0xA,0xD len equ $- msg segment.bss res resb d ng gcc 177 178 BÀI 7: 7.23.3 C u trúc D ng PUSH operand POP address/register - theo cách sau: ; PUSH AX PUSH BX ; MOV AX, VALUE1 li u X p ch ng BÀI 7: MOV BX, VALUE2 MOV VALUE1, AX MOV VALUE2, BX ; POP BX POP AX Ví d section text global _start ;ph s _start: ;g i v m vào trình liên k t call display mov eax,1 ;g i h th ng(sys_exit) int 0x80 ;g i nhân display: mov next: push mov mov mov mov int80h ecx,256 ecx eax,4 ebx,1 ecx, achar edx,1 pop ecx mov dx,[achar] cmp byte[achar],0dh inc byte[achar] loop next ret section.data achar db '0' d ng gcc 179 180 BÀI 7: theo cách sau: 0123456789:;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu vwxyz{|} 7.24 QUY TRONG H P NG Fact(n)= n * fact (n-1)for n >0 section text global _start _start:;g i v ;ph s m vào trình liên k t mov bx,3;for calculating factorial call proc_fact add ax,30h mov [fact], ax mov edx,len ; dài tin nh n d ng gcc BÀI 7: mov mov mov ecx,msg ;tin nh vi t ebx,1;mô t file(stdout) eax,4;g i h th ng(sys_write) 0x80;g i nhân mov mov mov mov edx,1; dài tin nh n ecx,fact ;tin nh vi t ebx,1;mô t file(stdout) eax,4;g i h th ng(sys_write) 0x80;g i nhân mov eax,1;g i h 0x80;g i nhân int int int 181 th ng(sys_exit) proc_fact: cmp bl,1 jg do_calculation mov ax,1 ret do_calculation: dec bl call proc_fact inc bl mul bl ;ax = al * bl ret section data msg db 'Factorial is:',0xa len equ $ - msg section.bss fact resb 7.25 MACRO TRONG H P NG - - %macro %endmacro 182 BÀI 7: %macro macro_name number_of_params %endmacro number_of_params mov mov mov mov int edx,len ; p ecx,msg ; vi t ebx,1;mô t file(stdout) eax,4;g i h th ng(sys_write) 0x80;g i kernel M ; M t macro có hai tham s ;Th c hi n l nh g i h th ng ghi %macro write_string mov eax,4 mov ebx,1 mov ecx,%1 mov edx,%2 int80h %endmacro macro_name BÀI 7: section text global _start ;ph s d ng gcc _start:;g i v i m vào trình liên k t write_string msg1, len1 write_string msg2, len2 write_string msg3, len3 mov eax,1;g i h int0x80;g i nhân th ng(sys_exit) section data msg1 db 'Hello, programmers!',0xA,0xD len1 equ $ - msg1 msg2 db 'Welcome to the world of,',0xA,0xD len2 equ $- msg2 msg3 db 'Linux assembly programming! ' len3 equ $- msg3 Hello, programmers! Welcome to the world of, Linux assembly programming! 7.26 QU N LÝ T P TIN TRONG H P NG : - 7.26.1 Mô t t p tin Mô - stdin, stdout stderr 0, 183 184 BÀI 7: 7.26.2 Con tr t p tin Con 7.26.3 Hàm g i h %eax Tên th ng x %ebx %ecx %edx sys_fork - - sys_read char * size_t sys_write const char * size_t sys_open Int Int sys_close - - sys_creat Int - 19 sys_lseek const char * const char * off_t - 7.26.4 T o m - lý t p tin t p tin BÀI 7: 7.26.5 M t p tin hi n có - -ghi (2) 7.26.6 ct t p tin - 7.26.7 Ghi vào t p tin - 185 186 BÀI 7: - 7.26.8 óng t p tin - ý EAX - 7.26.9 c p nh t t p tin - - - - - 7.26.10 Ví d myfile.txt thông tin BÀI 7: section text global _start ;ph s _start:;g i v m vào trình liên k t ;create the file mov eax,8 mov ebx, file_name mov ecx,0777;read, write and execute by all int0x80;g i nhân mov [fd_out], eax ; write into the file mov edx,len ;s byte mov ecx, msg ;tin nh vi t mov ebx,[fd_out];mô t file mov eax,4;g i h th ng(sys_write) int 0x80;g i nhân ; close the file mov eax,6 mov ebx,[fd_out] ;vi t thông báo cho bi t k t thúc ghi t p tin mov eax,4 mov ebx,1 mov ecx, msg_done mov edx, len_done int0x80 ;open the file for reading mov eax,5 mov ebx, file_name mov ecx,0;cho quy n truy c p ch c mov edx,0777; c, vi t th c thi b i t t c int0x80 mov [fd_in], eax ;read from file mov eax,3 mov ebx,[fd_in] mov ecx, info mov edx,26 int0x80 ; close the file mov eax,6 mov ebx,[fd_in] int0x80 d ng gcc 187 188 BÀI 7: ;print the info mov eax,4 mov ebx,1 mov ecx, info mov edx,26 int0x80 mov eax,1;g i h th ng(sys_exit) int 0x80;g i nhân section data file_name db 'myfile.txt' msg db 'Welcome to Tutorials Point' len equ $-msg msg_done db 'Written to file',0xa len_done equ $-msg_done section.bss fd_out resb fd_in resb info resb 26 Written to file Welcome to Tutorials Point 7.27 QU N LÝ B NH TRONG H P NG sys_brk () - Ví d : section text global _start ;ph s d ng gcc BÀI 7: _start: ;g i v m vào trình liên k t mov eax,45 xor ebx, ebx int 80h ;sys_brk add ;s ;sys_brk eax,16384 mov eax,45 int 80h cmp jl mov sub mov xor std rep cld mov mov mov mov int eax,0 exit ;thoát edi, eax edi,4 ecx,4096 eax, eax stosd eax,4 ebx,1 ecx, msg edx, len 80h c b ra, n u l i ; a ch kh d ng cao nh t ;tr n DWORD cu i ;s c phân b ;làm r ng eax ;qua k ti p ;thay th cho toàn b khu v ; t c DF v tr ;in m t tin nh n exit: mov eax,1 xor ebx, ebx int 80h section msg len equ data db "Allocated 16 kb of memory!",10 $ - msg Allocated 16 kb of memory ebx, eax c phân b ng 189 190 TÀ [1]Herbert h Thompson; Scott g Chase (2008), The Software Vulnerability Guide, CHARLES RIVER MEDIA, INC., ISBN: 1-58450-358-0 [2] Edition), Pearson Education [3]Jang, Michael (2011), Security Strategies in Linux Platforms and Applications, Jones & Bartlett Learning, ISBN-13: 978-0763791896 [4]

Ngày đăng: 28/07/2023, 17:57

TỪ KHÓA LIÊN QUAN

w