URI::http::Dump - A module to assist in the reverse engineering of URL parameters.
Version 0.01
## Whatever you get the picture. use constant URI => 'http://longassuri:obsecureport' . '/stupid_path/segments/probably/not/needed/but/there/for/fun/' . 'dumbFile.that.says.nothing.of.security' . '?Stupidquerry=HexencodedNonsense&Oth=er&cra=p' ; use URI::http::Dump; URI::http::Dump->new( URI )->makeLifeEasy; perl -MURI::http::Dump -e'URI::http::Dump->new("uri")->makeLifeEasy'; ## Same as. perl -MURI::http::Dump -e'mls("http://google.com")' ## Overview of process $ perl -MURI::http::Dump -e'mls("http://google.com")' $ vim url.txt ## change stuff $ perl -MURI::http::Dump -e'mls("http://google.com")' http://google.com/foobar.do?a=b
The simplicity of Unix is in the way it treats (most) everything like a file, and this is just a simplicity mechanism so you can treat URIs as a file too via YAML markup, ie, easily manipulate them with a text editor.
Say you're trying to reverse engineer a website for the purpose of automation and the URL that is causing annoyance has a shit ton of parameters with numerous different quirks: ie, base64 encoding, custom encoding, hexecoding nonsense, or maybe they just spelt everything in pig latin. Now, for reasons known to the reader, you need to make sense of this: this module will help you.
This module really has a small scope, and the route of action it takes depends entirely on the existance of the URI's file-store. On the first invocation, before the file-store exists, URI::http::Dump will decompile the URL provided to new() to its basic URI components and store it to a file.
On the second invocation, URI::http::Dump will compile the URI from the components in the file-store and output the URI to stdout. It will continue on this route for each subsequent invocation until the file-store is deleted. Then it will re-render the file from the arguments to constructor so you can begin the process again.
Because of the internal function of the URI module query segments encoded and unencoded in the respective steps, ie., the file will probably look more ledgable than the URI by default.
If you have deep voodoo you need to do to the URI in an automated fashion you can utilize a Moose around method modifier on the ->load or ->dump functions.
->load
->dump
All URIs must start with http://
The CANONICAL_SRC element in the dump *NEVER* changes. It is there for reference only
Convenience functions calls ->new with provided uri_string, and then calls ->makeLifeEasy
->new
->makeLifeEasy
Beware ->load and dump are not inverses, load takes a HashRef; dump outputs yaml.
dump
load
The input to ->new can be one of the following: a URI, the file's location with a YAML dump of the URI, or a HashRef in the format of the output of the ->dump function.
Returns a dump of the URI in the YAML format. Defaults to url.txt.
Saves the dump of the URI in the YAML format to the file specified in ->filename, which is by default url.txt.
->filename
Specifies the filename of the file-store.
Accepts a HashRef of the YAML file-store. Returns a new URI::http representation of the HashRef.
URI::http
Accepts the YAML file-store location outputs a HashRef of the YAML file-store. This HashRef is processed by >load. Returns a URI representation of the file-store.
>load
URI
Evan Carroll, <me at evancarroll.com>
<me at evancarroll.com>
Please report any bugs or feature requests to bug-uri-http-dump at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=URI-http-Dump. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-uri-http-dump at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc URI::http::Dump
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=URI-http-Dump
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/URI-http-Dump
CPAN Ratings
http://cpanratings.perl.org/d/URI-http-Dump
Search CPAN
http://search.cpan.org/dist/URI-http-Dump
Special thanks goes out to nothingmuch for providing emotional support and being an all around nice guy. I <3 YOU BUDDY.
Copyright 2008 The man himself, Evan Carroll, no rights reserved -- have fun newbs.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install URI::http::Dump, copy and paste the appropriate command in to your terminal.
cpanm
cpanm URI::http::Dump
CPAN shell
perl -MCPAN -e shell install URI::http::Dump
For more information on module installation, please visit the detailed CPAN module installation guide.