...

View Full Version : perl mysql injection



absoleet
11-23-2009, 05:42 AM
Hello All,

Experienced PHP, new to Perl.... Getting a 500 error..


#!/usr/bin/perl -w

$|++;

use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI;
use Mysql;

#mysql vars
my $user="dbo294796910";
my $password="jdJPCkss";
my $database="db294796910";
my $server = "db414.perfora.net";

# connect to DB
my $connect = Mysql->connect($server, $database, $user, $password);
$connect->selectdb($database);

# insert file vars into DB
my $updatefiles = "INSERT INTO `files`
( `id` , `show` , `game` , `menuid`, `category` , `item` , `filename` , `imagename` , `title` , `artist` , `submitter` , `colour` , `downloads` , `comments` )
VALUES
('', '0', 'game', 'menuid', 'category', 'item', 'newfilename', 'newimagename', 'title', 'artist', 'submitter', 'colour', '0', 'message')";


# execute query
my $execute = $connect->query($updatefiles);

any help or refferenes would be appreciated.

When starting out with PHP i used php.net, lots of explanaitons and examples of functions on that site. Is there anything like that for Perl?

FishMonger
11-23-2009, 06:08 AM
Since you're using:

use CGI::Carp qw(fatalsToBrowser);You should have recieced a more descriptive error. What was the exact wording of the error message?

Mysql is a depreciated module. Instead, you should be using the DBI module.

The 2 primary Perl resources are the Perl documentation files that should be installed on your system and are accessible via the perldoc command and CPAN:

Example:

[root@fc4dev ~]# perldoc perl
PERL(1) User Contributed Perl Documentation PERL(1)

NAME
perl - Practical Extraction and Report Language

SYNOPSIS
perl [ -sTuU ] [ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[:debugger] ] [ -D[number/list] ]
[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal] ]
[ -Idir ] [ -m[-]module ] [ -M[-]‚module...‚ ]
[ -P ] [ -S ] [ -x[dir] ]
[ -i[extension] ] [ -e ‚command‚ ] [ -- ] [ programfile ] [ argu-
ment ]...

If you‚re new to Perl, you should start with perlintro, which is a general
intro for beginners and provides some background to help you navigate the
rest of Perl‚s extensive documentation.

For ease of access, the Perl manual has been split up into several sec-
tions.

Overview

perl Perl overview (this section)
perlintro Perl introduction for beginners
perltoc Perl documentation table of contents

Tutorials

perlreftut Perl references short introduction
perldsc Perl data structures intro
perllol Perl data structures: arrays of arrays
...
...
...

or via the web:
http://perldoc.perl.org/http://perldoc.perl.org/

CPAN:
http://search.cpan.org/

oesxyl
11-23-2009, 07:06 AM
Hello All,

Experienced PHP, new to Perl.... Getting a 500 error..
any help or refferenes would be appreciated.

When starting out with PHP i used php.net, lots of explanaitons and examples of functions on that site. Is there anything like that for Perl?
don't post sensitive information on public forums! You can remove it from your post by editing the post and change them on your server.

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum