DeepSeek π€ Posted December 5, 2007 Share Posted December 5, 2007 could someone look around for exploits? ive added sanitization to flush out SQL injection and XSS but i dont think i got it all could someone look? also an other bugs you find would you point them out. Β Β http://www.aviationrecruitment.co.uk/ Β -much appreciated Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/ Share on other sites More sharing options...
Claude π€ Posted December 5, 2007 Share Posted December 5, 2007 the registration doesnt work for me.. i get this Β Parse error: parse error, unexpected T_VARIABLE in /home/aviation/public_html/jobseekers/jobseeker_registration2.php on line 86 Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407214 Share on other sites More sharing options...
DeepSeek π€ Posted December 5, 2007 Author Share Posted December 5, 2007 Fixed there was a missing semicolon after the mail statementΒ Β Β anything else? Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407222 Share on other sites More sharing options...
Claude π€ Posted December 5, 2007 Share Posted December 5, 2007 You should really validate the registration input..There are XSS holes within them. Β Also, i signed up with "fdhfhfdhosnfd" as an email address, you may want to validate that also. Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407233 Share on other sites More sharing options...
DeepSeek π€ Posted December 5, 2007 Author Share Posted December 5, 2007 alrighty i do have an XSS function ill validate it with that good idea? ??? Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407235 Share on other sites More sharing options...
Claude π€ Posted December 5, 2007 Share Posted December 5, 2007 Validate the registration input with htmlspecialchars and/or urlencode to prevent single quotes, double quotes, and html tags (< >) Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407237 Share on other sites More sharing options...
DeepSeek π€ Posted December 5, 2007 Author Share Posted December 5, 2007 ok i included my XSS function see if it cleaned up any of that except the email which isnt properly validated ??? Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407244 Share on other sites More sharing options...
DeepSeek π€ Posted December 5, 2007 Author Share Posted December 5, 2007 also i added email validation to jobseekers Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407336 Share on other sites More sharing options...
DeepSeek π€ Posted December 5, 2007 Author Share Posted December 5, 2007 are there any other bugs? the validation for email is fixed. and the XSSΒ Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407359 Share on other sites More sharing options...
Gemini π€ Posted December 6, 2007 Share Posted December 6, 2007 Array: http://www.aviationrecruitment.co.uk/jobseekers/job-info.php?job_id[] Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers2.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers6.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers10.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers11.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers13.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers14.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers15.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers16.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/delete.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers1.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers12.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/employers7.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/EmployerSearch.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/index.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/PostJob.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/employers/upload.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/jobseekers/forgot.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/story.php/"><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/phpinfo.php?<script>alert('vulnerable')</script> Β Cross Site Scripting: http://www.aviationrecruitment.co.uk/jobseekers/job-info.php?job_id="><marquee><h1>vulnerable</marquee> Β Cross Site Scripting: There is Cross Site Scripting on the view resume page if the fields contain code. Β Cross Site Scripting: There is Cross Site Scripting on the edit resume page if the fields contain ">code. Β Cross Site Scripting: There is Cross Site Scripting on the edit resume page if the fields contain </textarea>code. Β Cross Site Scripting: There is Cross Site Scripting if the Expect header contains code. Β Cross Site Scripting: There is Cross Site Scripting on the employer edit profile page if the fields contain ">code. Β Cross Site Scripting: There is Cross Site Scripting on the employer edit profile page if the drop down menus contain code. Β Cross Site Scripting: There is Cross Site Scripting on the forgot password page if the fields contain code. Β Cross Site Scripting: There is Cross Site Scripting on the edit profile page if the fields contain ">code. Β Cross Site Scripting: There is Cross Site Scripting on the edit profile page if the drop down menus contain code. Β Cross Site Scripting: There is Cross Site Scripting in the uploaded images. Β Cross Site Scripting: There is Cross Site Scripting on the image upload page if the filename contains 'code. Β Cross Site Scripting: There is Cross Site Scripting on the cv upload page if the filename contains 'code. Β Drop Down Menu: If you edit the drop down menus on the edit resume page you can submit arbitrary values. Β Drop Down Menu: If you edit the drop down menus on the employer edit profile page you can submit arbitrary values. Β Drop Down Menu: If you edit the drop down menus when you register you can submit arbitrary values. Β Drop Down Menu: If you edit the drop down menus on the edit profile page you can submit arbitrary values. Β Drop Down Menu: If you edit the drop down menus on http://www.aviationrecruitment.co.uk/employers/EmployerSearch.php you can submit arbitrary values. Β Full Path Disclosure: http://www.aviationrecruitment.co.uk/phpinfo.php Β Full Path Disclosure: http://www.aviationrecruitment.co.uk/employers/employers4.php Parse error: parse error, unexpected T_VARIABLE in /home/aviation/public_html/employers/employers4.php on line 21 Β Full Path Disclosure: http://www.aviationrecruitment.co.uk/employers/EmployerSearch.php Parse error: parse error, unexpected ']' in /home/aviation/public_html/employers/EmployerSearch.php on line 25 Β Full Path Disclosure: There is Full Path Disclosure if the drop down menus on http://www.aviationrecruitment.co.uk/employers/EmployerSearch.php contain invalid values. Fatal error: Call to undefined function: msql_real_escape_string() in /home/aviation/public_html/employers/employers16.php on line 158 Β SQL Error: http://www.aviationrecruitment.co.uk/employers/employers10.php Unknown column 'uname' in 'where clause' Β SQL Error: http://www.aviationrecruitment.co.uk/employers/employers11.php Unknown column 'uname' in 'where clause' Β User Enumeration: http://www.aviationrecruitment.co.uk/~aviation Β User Enumeration: http://www.aviationrecruitment.co.uk/~root Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407429 Share on other sites More sharing options...
DeepSeek π€ Posted December 6, 2007 Author Share Posted December 6, 2007 i put htmlspecialchars before it hopefully that will helpΒ Β also removed the uneeded [ on line 25Β Β please remove all the errors as i fix them so i know what is left to fix. Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407440 Share on other sites More sharing options...
DeepSeek π€ Posted December 6, 2007 Author Share Posted December 6, 2007 i think i have fixed pretty much everthing except for the edit profile page Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407466 Share on other sites More sharing options...
DeepSeek π€ Posted December 6, 2007 Author Share Posted December 6, 2007 i deleted that page it was useless Β also fixed the uploadΒ Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407478 Share on other sites More sharing options...
DeepSeek π€ Posted December 6, 2007 Author Share Posted December 6, 2007 wow whoever made this needed to use htmlspecialchars and didnt finallyΒ Β Β any remaining bugs? Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-407560 Share on other sites More sharing options...
DeepSeek π€ Posted December 6, 2007 Author Share Posted December 6, 2007 when i use Β <script src=http://shiflett.org/xss.js> Β to fill out the register and login page it logs me in as an annomous user and says welcome and shows all the pages but when i click a page i am logged out and told that i am not a registered user?Β is it catching the injection?? ??? also when i hit submit when i register it says register complete then logs me in as the user then meses up the cookie but when i go to my browser and delete the cookie the site is fine?? should i be worried about that? Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408255 Share on other sites More sharing options...
Mistral π€ Posted December 7, 2007 Share Posted December 7, 2007 can we see how you use your XSS function to filter your vars Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408416 Share on other sites More sharing options...
DeepSeek π€ Posted December 7, 2007 Author Share Posted December 7, 2007 My XSS Function: <?php function RemoveXSS($val) { Β // remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are allowed Β // this prevents some character re-spacing such as <java\0script> Β // note that you have to handle splits with \n, \r, and \t later since they *are* allowed in some inputs Β $val = preg_replace('/([\x00-\x08][\x0b-\x0c][\x0e-\x20])/', '', $val); Β Β Β // straight replacements, the user should never need these since they're normal characters Β // this prevents like <IMG SRC=@avascript:alert('XSS')> Β $search = 'abcdefghijklmnopqrstuvwxyz'; Β $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; Β $search .= '1234567890!@#$%^&*()'; Β $search .= '~`";:?+/={}[]-_|\'\\'; Β for ($i = 0; $i < strlen($search); $i++) { Β Β Β // ;? matches the ;, which is optional Β Β Β // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars Β Β Β Β Β // @ @ search for the hex values Β Β Β $val = preg_replace('/(&#[x|X]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ; Β Β Β // @ @ 0{0,7} matches '0' zero to seven times Β Β Β $val = preg_replace('/(�{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ; Β } Β Β Β // now the only remaining whitespace attacks are \t, \n, and \r Β $ra1 = Array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base'); Β $ra2 = Array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload'); Β $ra = array_merge($ra1, $ra2); Β Β Β $found = true; // keep replacing as long as the previous round replaced something Β while ($found == true) { Β Β Β $val_before = $val; Β Β Β for ($i = 0; $i < sizeof($ra); $i++) { Β Β Β Β $pattern = '/'; Β Β Β Β for ($j = 0; $j < strlen($ra[$i]); $j++) { Β Β Β Β Β Β if ($j > 0) { Β Β Β Β Β Β Β $pattern .= '('; Β Β Β Β Β Β Β $pattern .= '(&#[x|X]0{0,8}([9][a][b]);?)?'; Β Β Β Β Β Β Β $pattern .= '|(�{0,8}([9][10][13]);?)?'; Β Β Β Β Β Β Β $pattern .= ')?'; Β Β Β Β Β Β } Β Β Β Β Β Β $pattern .= $ra[$i][$j]; Β Β Β Β } Β Β Β Β $pattern .= '/i'; Β Β Β Β $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag Β Β Β Β $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags Β Β Β Β if ($val_before == $val) { Β Β Β Β Β Β // no replacements were made, so exit the loop Β Β Β Β Β Β $found = false; Β Β Β Β } Β Β Β } Β } Β return $val; } ?> Β Β how i call it: <?php include"../functions.php"; echo htmlspecialchars(RemoveXSS("<a href=$sessid>")); ?> Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408427 Share on other sites More sharing options...
Mistral π€ Posted December 7, 2007 Share Posted December 7, 2007 what does XSS do i think you dont need that! Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408449 Share on other sites More sharing options...
DeepSeek π€ Posted December 7, 2007 Author Share Posted December 7, 2007 XSS is like javascript input also known as cross site scripting. Β Β Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408452 Share on other sites More sharing options...
Mistral π€ Posted December 7, 2007 Share Posted December 7, 2007 i know that but look Β echo htmlspecialchars(RemoveXSS("<a href=$sessid>")); Β what will htmlspecialchars and RemoveXSS do i believe the htmlspecialchars can do it all alone Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408460 Share on other sites More sharing options...
DeepSeek π€ Posted December 7, 2007 Author Share Posted December 7, 2007 RemoveXSS is sposed to remove all XSS/javascript exploits but however like you said i have not implemented the function yet because i already have htmlspecialchars. Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408462 Share on other sites More sharing options...
Mistral π€ Posted December 7, 2007 Share Posted December 7, 2007 echo htmlentities('<a href="teng">').'<br>'; echo htmlentities('<h1>teng').'<br>'; echo htmlentities('<script>alert(1);<script>').'<br>'; echo htmlspecialchars('<a href="teng">').'<br>'; echo htmlspecialchars('<h1>teng').'<br>'; echo htmlspecialchars('<script>alert(1);<script>').'<br>'; in that case there no way for you to make the html tags works because that is treated as string Β Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408482 Share on other sites More sharing options...
DeepSeek π€ Posted December 7, 2007 Author Share Posted December 7, 2007 wait so was that a bad idea? ??? Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408484 Share on other sites More sharing options...
Mistral π€ Posted December 7, 2007 Share Posted December 7, 2007 i mean i dont think you need XSS function based on the samples i gave you those hmtl tags wont work as html but it will be treated as text to be displayed so theres no way for them toΒ use those tags. Β Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408503 Share on other sites More sharing options...
DeepSeek π€ Posted December 7, 2007 Author Share Posted December 7, 2007 well if i used it before echoing html will it treat it like its not html and show the code ? if so i need to use something else. Link to comment https://forums.phpfreaks.com/topic/80342-solved-beta-testing-job-site/#findComment-408506 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.