Today is: 8 January, 2012
Check todays hot topics

Language

Thursday, October 1, 2009 - 18:29

This is a crappy dynamic form class I built. It's been stripped down to protect the innocent. It's actually kinda useful if you have to generate a lot of forms. This does not include a post handler, control scripts or templates. If you scroll to the bottom you'll see a simple use case.

0

Thursday, October 1, 2009 - 13:28
fukung, image, lwp, rape, scraper

This script will crawl fukung.net and grab every image it see's. We attempt to create an archive resembling media.fukung.net's directory structure.

The neat thing is it preserves image tags in the database. I figured, what good is it to have a fuck ton of images in a fuck ton of directories if they're not even sensibly organized. For every image we insert we keep track of it's class('sfw', 'nsfw') and it's tags (if any).

0

Sunday, September 13, 2009 - 06:26
fibonacci

Everyone seems to over-complicate this. Theres 23894728934723 different ways to do this but my way is simple.

#!/usr/bin/perl
 
use strict;
use warnings;
 
my $default = 100;
my @num = (0, 1);
$\ = "\n";
 
sub main {
        my $iterations = $ARGV[0] ? $ARGV[0] : $default;
        for(0..$iterations) {
                my $fib = ($num[0] + $num[1]);
                $num[0] = $num[1];
                print $num[1] = $fib;
        }
}
 
main();

Heres what it looks like:

$ ./fibonacci.pl
1
2
3
5
8
13
21
34
55
89

0

Thursday, September 10, 2009 - 15:56
GD, image, lwp, resize

Compile a txt file of image urls, download the images, resize them. Pretty simple, pretty ghetto. This is a proof for something much larger I will post a later date. This requires Image::Resize which requires GD.

#!/usr/bin/perl
 
use strict;
use warnings;
 
use Data::Dumper;
use Image::Resize;
use LWP::UserAgent;
use Getopt::Long;
 
my $x;
my $y;
my $url;
my $input;
my $outdir;
 
my $verbose = 1;
 
sub do_options {
        my $var = GetOptions( 'i|input=s' => \$input,
                                'u|url=s' => \$url,

0

Thursday, September 3, 2009 - 21:53

We wrote this to cheat on an internet poll. At first we were using the Proxy Spider to gather proxies and iterate through them with LWP::UserAgent. *THAN* we discovered ProxyHopper exists, and we set out on rigging internet polls across the land. My favorite internet polls are ones that use the GET method. This will require heavy modification to work anywhere other than it's intended target. It shouldn't be too hard.

0

Thursday, September 3, 2009 - 19:39
Ascii Animation

Ghettocode's ASCII animation contest. Submit gangster TERM animations in any language of your choice. We'll take a vote and decide on a winner.

Datagram:

Get the Flash Player to see this player.

0

Thursday, September 3, 2009 - 17:50
eth0, network, proc, stats

lol old. Who needs iptraf or any other horse shit to tell you whats going through your NIC. We got perl function calls older than you are!

#! /usr/bin/perl
 
for $i (0 .. 15 ) {
  $rx[$i] = 0 ;
  $ox[$i] = 0 ;
} ;
 
format STDOUT_TOP =
                        Network Statistics
 Received (eth0)                           Transmitted (eht0)
     Bytes       Packets errors  drops     Bytes      Packets   errors
Drops  Colls
 
------------------------------------------------------------------------------------
.
 
format STDOUT =

0

Thursday, September 3, 2009 - 17:29

This is useful (probably responsible as well) for owners of large blocks of IP space. This is useful to people who are not you. It's always nice to have forward and reverse resolving ip space even if it's not being used.

In my case we had large net blocks straddling several physical locations. This really helped me locate large blocks and their relative location without having to telnet into network gear and dicking around with all 28347238947238942984 ports feeding our network. It's plenty ghetto. Enjoy.

#!/bin/bash

0

Thursday, September 3, 2009 - 17:34
bugtraq, motd, rss

Force your sysadmins to keep on top of the latest security advisories. Change $outputfile to /etc/motd or change your login profile to cat something else. Do whatever you want with it really, it's essentially an RSS reader in bash.

#!/bin/sh
 
url="http://www.securityfocus.com/rss/vulnerabilities.xml"
 
 
pagetitle="=============================================================================
                         Current Bugtraq Vulnerabilities 
============================================================================="

0

Thursday, September 3, 2009 - 15:27
Arp, ddos, flood, POC, Poison, syn, syn flood

This is a modified version of NWO's POC syn flooder. None of us ever had the need/guts/reason to test it outside a network lab. I've used this and something similar to stress test core routers, fiber loops, and firewalls in a datacenter. It's sorta neat. NWO comments have been left in. I gotta say I'm a little disappointed they're as clean and tame as they are, he's usually a comment loller.

0