⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
webmin
/
View File Name :
group_chooser.cgi
#!/usr/bin/perl # group_chooser.cgi # This CGI generated the HTML for choosing a group or list of groups. BEGIN { push(@INC, "."); }; use WebminCore; &init_config(); if (&get_product_name() eq 'usermin') { &switch_to_remote_user(); } &ReadParse(undef, undef, 2); %access = &get_module_acl(); # Build list of primary groups setpwent(); while(@uinfo = getpwent()) { push(@{$members{$uinfo[3]}}, $uinfo[0]); } endpwent() if ($gconfig{'os_type'} ne 'hpux'); if ($in{'multi'}) { # selecting multiple groups. if ($in{'frame'} == 0) { # base frame &PrintHeader(); print "\n"; print "
$text{'groups_title1'}
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; } elsif ($in{'frame'} == 1) { # list of all groups to choose from &popup_header(); print "\n"; print "
"; print &ui_textbox("filter",$text{'ui_filterbox'}, 50, 0, undef,"style='width:100%;color:#aaa;' onkeyup=\"filter_match(this.value);\" onfocus=\"if (this.value == '".$text{'ui_filterbox'}."') {this.value = '';this.style.color='#000';}\" onblur=\"if (this.value == '') {this.value = '".$text{'ui_filterbox'}."';this.style.color='#aaa';}\""); print &ui_hr("style='width:100%;'")."
"; print "
$text{'groups_all'}
\n"; print "
\n"; my $cnt = 0; foreach $u (&get_groups_list()) { if ($in{'group'} eq $u->[0]) { print "
\n"; } else { print "
\n"; } $u->[0] =~ s/\\/\\\\/g; print "
[3], \"'\")]}\")'>@{[&html_escape($u->[0])]}
\n"; print "
@{[&html_escape($u->[3])]}
\n"; $cnt++; } print "
\n"; if ( $cnt >= 10 ) { print ""; print ""; } &popup_footer(); } elsif ($in{'frame'} == 2) { # show chosen groups &popup_header(); print "
$text{'groups_sel'}
\n"; print <<'EOF';
EOF &popup_footer(); } elsif ($in{'frame'} == 3) { # output OK and Cancel buttons &popup_header(); print "\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; &popup_footer(); } } else { # selecting just one group .. display a list of all groups to # choose from &popup_header($text{'groups_title2'}); print "\n"; print "
"; print &ui_textbox("filter",$text{'ui_filterbox'}, 50, 0, undef,"style='width:100%;color:#aaa;' onkeyup=\"filter_match(this.value);\" onfocus=\"if (this.value == '".$text{'ui_filterbox'}."') {this.value = '';this.style.color='#000';}\" onblur=\"if (this.value == '') {this.value = '".$text{'ui_filterbox'}."';this.style.color='#aaa';}\""); print &ui_hr("style='width:100%;'")."
";; print "
\n"; my $cnt = 0; foreach $u (&get_groups_list()) { if ($in{'group'} eq $u->[0]) { print "
\n"; } else { print "
\n"; } print "
@{[&html_escape($u->[0])]}
\n"; print "
@{[&html_escape($u->[3])]}
\n"; $cnt++; } print "
\n"; if ( $cnt >= 10 ) { print ""; print ""; } &popup_footer(); } sub get_groups_list { local(@ginfo, @groups, %gcan, %found); if ($access{'gedit_mode'} == 2 || $access{'gedit_mode'} == 3) { map { $gcan{$_}++ } split(/\s+/, $access{'gedit'}); } setgrent(); local %doneg; while(@ginfo = getgrent()) { next if ($doneg{$ginfo[0]}++); @mems = &unique( split(/ /, $ginfo[3]), @{$members{$ginfo[2]}} ); if (@mems > 3) { @mems = (@mems[0..1], "..."); } $ginfo[3] = join(' ', @mems); if ($access{'gedit_mode'} == 0 || $access{'gedit_mode'} == 2 && $gcan{$ginfo[0]} || $access{'gedit_mode'} == 3 && !$gcan{$ginfo[0]} || $access{'gedit_mode'} == 4 && (!$access{'gedit'} || $ginfo[2] >= $access{'gedit'}) && (!$access{'gedit2'} || $ginfo[2] <= $access{'gedit2'})) { push(@groups, [ @ginfo ]) if (!$found{$ginfo[0]}++); } } endgrent() if ($gconfig{'os_type'} ne 'hpux'); return sort { $a->[0] cmp $b->[0] } @groups; }