[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 12-21-2005, 05:12 PM   #1 (permalink)
NamePros Regular
 
Zubair1's Avatar
 
Join Date: Mar 2005
Posts: 874
159.45 NP$ (Donate)

Zubair1 is just really niceZubair1 is just really niceZubair1 is just really niceZubair1 is just really nice

AIDS/HIV
Urgent help please (Experts)

Hello,
I need help on a security filter script / access logging.
A script that will filter all incomming $_POST and $_GET data. Check every variable for data manipulation, cross site scripting vulnerabilities, sql injection and all standard php vulnerabilities.
Script should output original $_POST and $_GET arrays with malicious characters/code removed or replaced by it's equivalent. The script should not die() or exit(). If malicious code found, issue javascript alert and redirect to page where it came from, notify admin via email. Also, create an array for variables which shouldn't be processed by the script which can be passed to the script in terms of global variables.
This script will be included in files.
It has to contain routine for access logging. IP,DATE,TIME,REFERRER,URI_STRING,QUERY_STRING,GET, POST,
SESSION data. Storing --- DB. Design DB table for it.

Please help or make a sort of script and i can give the person
points about 100 $NP or maybe even 200 $NP

Would really appreicate any help


Regards,
__________________
Live Support : Zubair11 [at] hotmail.com
Free SEO Directory! || Free Games and Songs || eBloggy.net
Zubair.info || Mixcat Interactive
Zubair1 is offline  
Old 12-21-2005, 05:44 PM   #2 (permalink)
Senior Member
 
Join Date: Nov 2005
Location: Hong Kong
Posts: 1,150
2,523.40 NP$ (Donate)

aznchong91 is a jewel in the roughaznchong91 is a jewel in the roughaznchong91 is a jewel in the rough


well, here's a simple script to screen the incoming $_POST and $_GET variables, I don't know what else you need:

PHP Code:
<?php
foreach($_GET as $key=>$value) {
    
$_GET[$key] = addslashes(trim(htmlspecialchars($value)));
}
foreach(
$_POST as $key=>$value) {
    
$_POST[$key] = addslashes(trim(htmlspecialchars($value)));
}
?>
__________________
-----------------------------------------------------
|-----FREE BANNER EXCHANGE! 1:1 RATIO!!!!-----|
|-------------www.bannercenter.info-------------|
-----------------------------------------------------
aznchong91 is offline  
Old 12-21-2005, 07:27 PM   #3 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
SQL Injection Prevention, basic:

mysql_real_escape_string($variable);
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 12-21-2005, 08:24 PM   #4 (permalink)
NamePros Regular
 
ninedogger's Avatar
 
Join Date: Jun 2004
Location: Iowa
Posts: 669
31.10 NP$ (Donate)

ninedogger is a name known to allninedogger is a name known to allninedogger is a name known to allninedogger is a name known to allninedogger is a name known to allninedogger is a name known to all

Save The Children
i think hes asking how to CHECK if somone is trying to "hack"

not prevent it
ninedogger is offline  
Old 12-21-2005, 08:39 PM   #5 (permalink)
NamePros Regular
 
Zubair1's Avatar
 
Join Date: Mar 2005
Posts: 874
159.45 NP$ (Donate)

Zubair1 is just really niceZubair1 is just really niceZubair1 is just really niceZubair1 is just really nice

AIDS/HIV
Quote:
Originally Posted by ninedogger
i think hes asking how to CHECK if somone is trying to "hack"

not prevent it
no i am not needing it to hack,
i need it to secure my script it will be included in the files
I need a script to check for incoming data by GET & POST super globals
and check for every variable data manuplation, cross site scripting vunerabilities, sql injections and all the other standard php vunerabilities.

the script should output the variables removing all the malicous stuff from it
or replacing it with its equalvent.

Also, create an array for variables in the script which shouldn't be processed by the script which can be passed to the script in terms of global variables.

Would really appreicate some one can do this for me

Regards,
__________________
Live Support : Zubair11 [at] hotmail.com
Free SEO Directory! || Free Games and Songs || eBloggy.net
Zubair.info || Mixcat Interactive
Zubair1 is offline  
Old 12-21-2005, 10:33 PM   #6 (permalink)
Senior Member
 
Join Date: Nov 2005
Location: Hong Kong
Posts: 1,150
2,523.40 NP$ (Donate)

aznchong91 is a jewel in the roughaznchong91 is a jewel in the roughaznchong91 is a jewel in the rough


well, to do the first part of what you wanted, just use the code I posted earlier. Somebody else that knows how can add the rest you need, because I don't.
__________________
-----------------------------------------------------
|-----FREE BANNER EXCHANGE! 1:1 RATIO!!!!-----|
|-------------www.bannercenter.info-------------|
-----------------------------------------------------
aznchong91 is offline  
Old 12-22-2005, 04:49 AM   #7 (permalink)
NamePros Regular
 
Zubair1's Avatar
 
Join Date: Mar 2005
Posts: 874
159.45 NP$ (Donate)

Zubair1 is just really niceZubair1 is just really niceZubair1 is just really niceZubair1 is just really nice

AIDS/HIV
Quote:
Originally Posted by aznchong91
well, to do the first part of what you wanted, just use the code I posted earlier. Somebody else that knows how can add the rest you need, because I don't.
ok thanks aznchong91
i am donating some $np's to your account.....really appreicate the help

can anyone else complete this?

Regards,
__________________
Live Support : Zubair11 [at] hotmail.com
Free SEO Directory! || Free Games and Songs || eBloggy.net
Zubair.info || Mixcat Interactive
Zubair1 is offline  
Old 12-24-2005, 10:19 AM   #8 (permalink)
New Member
 
Join Date: Dec 2005
Posts: 3
0.00 NP$ (Donate)

idreaminhex is an unknown quantity at this point


The first object of good script design is to only handle what you expect. If your script creates / processes a form. Then you know what to expect. The second object of good script design is to CAST name value pairs so they only contain what they should. People spend to much time on testing variables when they should auto CAST them so they don't need to worry about them during the rest of the script process!


So what I am saying...

If it by POST then use POST, if it's by GET use GET, if a value is INT, cast as INT, if a value is a STR, NO HTML, then strip it so it only contains what you want it to. If it's a STR, HTML then encode it. If a element is missing then create it. After unset() all the SUPER GLOBALS to maintain smart memory usage and continue with the script process!

You can create a simple 7 or 8 line function to do this, it will save you much time but more importantly it will make your scripts faster and much easier to manage!

John
idreaminhex is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
please, urgent! www.CiberArt.com sabbella Domain Appraisals 1 05-27-2005 04:36 AM
Urgent Vbulletin Forum Help Required! Please Help! Billy! Programming 6 01-12-2005 03:25 AM
hackbox.com , Please appraise, Urgent suthra Domain Appraisals 4 10-13-2004 06:59 PM
Urgent! Wanted! Forum Skin Design, Hacks, For a Car Forum! Urgent! Billy! Web Design Discussion 0 10-13-2004 02:50 AM
==== URGENT !!! MAMBO fans or experts wanted === johnn For Sale / Advertising Board 1 04-02-2004 04:29 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 08:05 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85