!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/bin/X11/./../../share/rhn/up2date_client/   drwxr-xr-x
Free 5.48 GB of 27.03 GB (20.27%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     configUtils.py (3.41 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/python
#
# utility functions for RHN Configuration
# Copyright (c) 2002 Red Hat, Inc.
#  Distributed under GPL.
#
# Author: Adrian Likins <alikins@redhat.com>
#
#

import sys
sys.path.append("/usr/share/rhn/up2date_client/")

import config
import rpcServer
import up2dateErrors
import up2dateAuth
import string
import os
import re
from rhn import rpclib

#cfg = config.initUp2dateConfig()

def getServerUrls():
    # NOTE: this method talks to the current serverURL
    # setting to ask for a list of other available servers
    cfg = config.initUp2dateConfig()

    # see if we have a systemid
    systemid = None
    if cfg['useRhn']:
        systemid = up2dateAuth.getSystemId()
    s = rpcServer.getServer()
    returnList = []
    serverUrls = []
    # just try this call once, since we may be behind a proxy
    cfg["networkRetries"] = 1
    try:
    if systemid:
            serverUrls = rpcServer.doCall(s.servers.list, systemid)
    else:
        serverUrls = rpcServer.doCall(s.servers.list)
    except rpclib.Fault, f:
        if f.faultCode == -1:
            #this means were talking to a server that doesnt know this
            # call, shouldnt happen, but some satellites could do it
            print "this server does not implement the servers.list() call"
        else:
            # this is a little wrong... we tell the user there was a
            # fault, but keep on trucking...
            print """A xmlrpclib.fault was caught indicating there was
an error with the server. The error was: %s """ % f

        returnList = [cfg["serverURL"]]
    except up2dateErrors.CommunicationError:
    # we cant talk outsite the network yet, probabaly need
    # proxy stuff setup.
    returnList = [cfg["serverURL"]]

    cfg["networkRetries"] = 5
    #serverUrls is a list of hashes

    # make sure we always list the master rhn server as per request
    masterserver = "xmlrpc.rhn.redhat.com"
    masterhandler = "/XMLRPC"
    masterflag = 0
    defaultflag = 0

    defaultUrl = cfg["serverURL"]

    
    for i in serverUrls:
        if i['server'] == masterserver and i['handler'] == masterhandler:
            masterflag = 1

    if not masterflag:
        serverUrls.append({'server': masterserver, 'handler':masterhandler})

    for i in serverUrls:
        returnList.append( "https://%s%s" % (i['server'], i['handler']) )

    if defaultUrl not in returnList:
        returnList.insert(0, defaultUrl)
        
    return returnList


def writeUp2dateMacro(macroName, macroValue):

    if os.access("/etc/rpm/macros.up2date", os.R_OK):
        f = open("/etc/rpm/macros.up2date", "r")
        lines = f.readlines()
        f.close()
    else:
        lines = []
    comment_r = re.compile("\s*#.*")
    value_r = re.compile("%s.*" % macroName)
    blank_r = re.compile("\s*")
    newfile = []
    for line in lines:
        m = value_r.match(line)
        if m:
            continue

        m = comment_r.match(line)
        if m:
            newfile.append(line)
            continue

        newfile.append(line)
            
        # dont care about blank lines...

    newfile.append("\n")
    newfile.append("%s       %s" % (macroName, macroValue))


    f = open("/etc/rpm/macros.up2date", "w")
    for line in newfile:
        f.write(line)
    f.write("\n")
    f.close()

    
            
            
        

def main():
    writeUp2dateMacro("%__enableRollbacks", "blipppyfffffffff")
        #print getServerUrls()




if __name__ == "__main__":
    main()

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0041 ]--