From: b Date: Thu, 8 Sep 2022 20:50:11 +0000 (+0000) Subject: First commit of trap X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;ds=sidebyside;p=botm%2Fwww-trap First commit of trap --- 998abc067d3253786c5ae21deeca48bf533905c2 diff --git a/makefile b/makefile new file mode 100644 index 0000000..d4dfe7c --- /dev/null +++ b/makefile @@ -0,0 +1,56 @@ +CC=gcc +CF=-g -Wall + +MV = mv +CP = cp +RM = rm +MKDIR = mkdir + +BIN_DIR = /botm/bin/trap +CONF_DIR = /botm/etc/www/conf + + +CONF=1190 baltixy botm rnk + + +# LF=-lIL +#LF2=-lcgi + +all: trap + + +trap: trap.c + $(CC) $(CF) -o trap trap.c + +bin_dir: + $(MKDIR) -p $(BIN_DIR) + +cp_bin: trap | bin_dir + $(CP) trap $(BIN_DIR) + +conf_dir: + $(MKDIR) -p $(CONF_DIR) + +cp_conf: $(CONF) + + +$(CONF): trap.conf | conf_dir + $(MKDIR) -p $(CONF_DIR)/$@ + $(CP) trap.conf $(CONF_DIR)/$@ + +install: cp_bin cp_conf + + +rm_bin: + $(RM) -f $(BIN_DIR)/trap + +rm_conf: + $(RM) -f $(foreach conf, $(CONF), $(CONF_DIR)/$(conf)/trap.conf) + +uninstall: rm_bin rm_conf + + +clean: + $(RM) -r trap + +.PHONY: all bin_dir cp_bin conf_dir cp_conf install rm_bin rm_conf uninstall clean $(CONF) diff --git a/trap.c b/trap.c new file mode 100644 index 0000000..6ab3c00 --- /dev/null +++ b/trap.c @@ -0,0 +1,60 @@ +// TRAAAP ! ! ! +//#include +#include +#include + + +int main (int argc, char *argv[]) +{ + //s_cgi *cgi; + + unsigned long randomhex; + //cgi=cgiInit(); + + sscanf(((getenv("PATH_INFO")!=NULL)?(getenv("PATH_INFO")+1):""),"%lx",&randomhex); + srand(randomhex); + + printf("Content-type: text/html\n\n"); + fputs("\n",stdout); + printf("Oh no, the trap! • 0x%08lx • Bicycles on the Moon\n",randomhex); + fputs("\n",stdout); + fputs("\n",stdout); + //fputs("\"1190.bicyclesonthemoon.info\"\n",stdout); + fputs("

Oh no, the trap!

\n",stdout); + printf("Your number is: 0x%08lx
\n",randomhex); + fputs("Please see these too:
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
\n",stdout); + fputs("But don't look at these:
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
  • \n",stdout); + randomhex=rand(); + printf("0x%08lx\n",randomhex,randomhex); + fputs("
\n",stdout); + + + return 0; +} diff --git a/trap.conf b/trap.conf new file mode 100644 index 0000000..78faab3 --- /dev/null +++ b/trap.conf @@ -0,0 +1,7 @@ +#The TRAP for bots! + +ScriptAlias /trap /botm/bin/trap/trap + + + Require all granted +