summaryrefslogtreecommitdiff
path: root/src/libexec/deddos.c
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-10-23 01:20:02 -0500
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-10-23 01:20:02 -0500
commit8c542d83091f9ba5ccb095fad730651f8e6c1eef (patch)
treead26b5a7686d7b78888fa052226551255e3d8633 /src/libexec/deddos.c
parent12201178a5950eecd9537e642b1246011490b499 (diff)
downloadmisc-8c542d83091f9ba5ccb095fad730651f8e6c1eef.tar.gz
misc-8c542d83091f9ba5ccb095fad730651f8e6c1eef.zip
fixed gopherd's LFI and added excuting files.
httpd had flushing issues. realpath is new! does what it says. gives absolute path of a file. deddos, peerip, peerip.pl, were laying around elsewhere. gethostbyname got a new trick. can do decimal addresses among other things. hop0 is a shell script that gets what IP will be put on the source address of outgoing packets sent to $1. rtfs.
Diffstat (limited to 'src/libexec/deddos.c')
-rw-r--r--src/libexec/deddos.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/libexec/deddos.c b/src/libexec/deddos.c
new file mode 100644
index 0000000..245ba41
--- /dev/null
+++ b/src/libexec/deddos.c
@@ -0,0 +1,53 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <signal.h>
+
+void ignore(int a) {}
+
+int main(int argc,char *argv[]) {
+ int i;
+ struct sockaddr sa;
+ signal(SIGALRM,exit);
+ alarm(10);
+ int sl=sizeof(sa);
+ char host[256];
+ char serv[256];
+ char cmd[256];
+ char line[256];
+ char iface[256];
+ char *name[16];
+ getpeername(0,&sa,&sl);
+ //this function is nifty as shit.
+ getnameinfo(&sa,sl,host,256,serv,256,NI_NUMERICHOST);
+ printf("connecting from: %s port %s\n",host,serv);
+ fflush(stdout);
+ printf("select interface:\n");
+ fflush(stdout);
+ system("/bin/cat /etc/interfaces | /usr/bin/tr '\n' ' ' | /usr/bin/fold");
+ fflush(stdout);
+ fgets(iface,sizeof(iface)-1,stdin);
+ for(i=0;iface[i];i++) {
+ if((iface[i] >= 'a' && iface[i] <= 'z') || (iface[i] >= '0' && iface[i] <= '9')) {
+
+ } else {
+ iface[i]=0;
+ }
+ }
+ alarm(60);
+ name[0]="/usr/sbin/tcpdump";
+ name[1]="-c10";
+ name[2]="-ni";
+ name[3]=iface;
+ name[4]="host";
+ name[5]=host;
+ name[6]="and";
+ name[7]="proto";
+ name[8]="UDP";
+ name[9]=0;
+ execv(name[0],name);
+ printf("shit fucked.\n");
+}