case of system calls, the ring3 enters ring0, which wastes a lot of CPU cycles. For example, system calls must be directed from ring3 to ring0 (except for the int command called by the kernel, most of which are performed by the hacker kernel module). The level before and after permission escalation is fixed, cpl must be 3, and the DPL of int 80 must be 3, so that the CPU checks the DPL of the gate Descriptor and the CPL of the caller is completely un
process switching based on kernel stack switching
Difficulty coefficient: ★★★★☆ Experiment objective to deeply understand the concept of process and process switching, synthesize application process, CPU management, PCB, LDT, kernel stack, kernel state and so on to solve practical problems, and start to establish system knowledge. Experimental Content
Today's Linux 0.11 uses TSS (later there will be a detailed discussion) and a command to complete the task switch, although simple, but this inst
overflow, and then we'll see how we can exploit the vulnerability.
Vulnerability utilization
To exploit the vulnerability, you must find a string offset that overrides the return address. We can send aaaabbbbccccddd by sending ... Such a combination string looks at exactly where the return address is overwritten. After some analysis, it is learned that at 4056 of the offset is exactly the cover of the function return address. So we're going to design an overflow string like this:
GET/AAAA....|
ds ss es fs gs) of the sub-defined task from the segment register. general Register status 3. status of the eflags register 4. status of the EIP register 5. the status of the audit register. 6. TR register Status 7. LDTR register status 8. IO ing base address and IO ing (exist in TSS) 9. the stack pointer of privilege level 0, 1, and 2 (exists in TSS) 10. before a task is scheduled, all the preceding information except the TR register status is included in the TSS. Similarly, all content of the
to load the program. There will be many loops in the shell program. When dealing with loops, you can only let the program run forward, basically not let it jump back, you need to think out of the loop. Do not use Peid to query entries. You can track entries in one step to improve the capability of manual entry searching.Load the program with OD.Confirm an entry warning, and the Od prompts the program to shell. If you choose not to continue the analysis.Stop here0040D001 60 pushad first remember
are collectively referred to as transfer commands (We will conduct further research later ). Now we will introduce the simplest command to modify CS and IP addresses:JMP refers to the order.
If you want to modify the Cs and IP content at the same time, the command can be completed in the form of "JMP segment address: Offset address", as shown in figure
JMP 2ae3: 3, after execution: cs = 2ae3h, IP = 0003 H,
Original address: Http://www.cnblogs.com/dennisOne? 8086CPU Transfer Instruction classification
Unconditional transfer instructions (e.g., JMP)
Conditional Transfer Directives
loop instructions (e.g. loop)
Process
Interrupt
? operator offsetOffset in assembly language is the symbol processed by the assembler, its function is to take the offset address of the label.? jmp directi
Dark Group sulton residual zero
The simple implementation of XOR dynamic encryption first of all, I would like to express my special thanks to Yan binlang's great guidance to me.
Then, simply put, the code is followed by comments, which should be detailed! 4-byte Encryption
The efficiency is good. In a loopd loop, an exclusive or encrypted Key is added with 2, so that each 4 bytes is converted into an exclusive or value.
My blog is http://hi.baidu.com/
Pushad // all registers into the stack
Call
the JMP and call commands.
4. Introduction to the two Commands
(1) Assembly statements (command statements)For instructions, see http://blog.csdn.net/scucj/archive/2009/06/19/4281659.aspx.
(2) pseudoinstructions (indicative statement)1. Symbolic Definition Statement(1) equivalent statement equFormat: Name equ expressionFunction: defines a value for a symbol, or a symbolic name, or even an executable command.The equ statement cannot be redefined befor
to the compiler's "custom". In this section we analyze a small online example, the following is a user listed two sections of the program, in the interview was asked what the pros and cons.
Program 1:
if (K > 8) {for
(int h=0;h
From the programming specification, it is clear that program 2 is better than program 1, because if the "dosomething" part is more complex, the program is 2 compact and not redundant, and you can extract the public parts of the IF and Else branch "dosomething" out o
('PASS ftp' +'\r\n') data = s.recv(1024) s.send('REST' +buffer+'\r\n') s.close()
Restart the FTP server under Immunity debugger (click "debug", then restart or press CTRL + F2) to start the FTP server architecture vulnerability. According to the previous practice, the EIP and ESP buffer must have a format created by metasploit. Copy these values, we will use them to calculate the differences between EIP and ESP registers in bytes.
In this example, the values of EIP and ESP are:
EIP: 69413269ESP:
I have seen some people asking me how to remove the bjfnt 1.2 shell over the past few days. So I wrote this article because the latest version is version 1.3, so I will only talk about the 1.3 shell here, I think 1.2 is simpler than 1.3. of course there are countless experts here, but they don't have time to write something out, so I just have to do it.
There are countless instructions. My total experience is to keep F8 until I can see that a loop cannot go through, and then stop and analyze it.
:
2. Prepare JMP
The above briefly introduces the basic method of assembly-level debugging in VS, and explains how to analyze the machine code using the mov command as an example. With these tools and materials, you can clearly understand the details of the code to be executed within the system. From the preceding section, we can see that the First Command executed by the GetTickCount API is mov. If you can change the Opcode of mov to
Lucifer.; #########################################################################. 386. Model flat, stdcall; -bit memory model option Casemap:none; Case sensitive include \masm32\include\kernel32.inc; ------------------------------------ ; Please read the final usage of the text; ------------------------------------ARGCL PROTO:D Word,:D Word. Code; ######################################################################## #ArgCl proc Argnum:dword, ItemBuffer:D Word local cmdline:D word local c
to save the bytecode of the Code function. jmpaddr points to the JMP Instruction address from JMP to the code function. The call [target function] jumps to the address of the JMP [function address] command before JMP is directed to the first address of the target function. Ofsfuncaddr is used to save the offset of the
methods, which is mixed with a lot of flowers and spam commands and then decoded,It is also a bunch of antidebugger, which may be decoded and restored to IAT. It is also a bunch of antidebugger... and finally jumps to the real OEP of the program to deal with such shells.The method is to first find the OEP and then fix the IAT
When the shell jumps to OEP, it is generally a cross-segment jump. There are many jump methods, such as jmp xxxxxxxx,
in Linux we can use the GDB debugger can also use objdump this tool, of course, there are other tools, but here I will not say, and then open the file in hexadecimal we can use XXD, We make a hex-mode change to the file by calling Xxd inside the vim, and of course there are other hex editors, and I'm not going to say it, because I'm also playing, after all, I'm still learning Win32 API (my real egg hurts), so let's start with a simple program.Let's look at this program first, it's simple, a mai
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.