shell bypass 403

UnknownSec Shell

: /usr/lib64/python2.7/ [ drwxr-xr-x ]

name : Bastion.pyo
�
zfc@s�dZddlmZeddd�[ddgZddlmZddd	��YZd
�ded�Zd�Z	e
d
kr�e	�ndS(s�Bastionification utility.

A bastion (for another object -- the 'original') is an object that has
the same methods as the original but does not give access to its
instance variables.  Bastions have a number of uses, but the most
obvious one is to provide code executing in restricted mode with a
safe interface to an object implemented in unrestricted mode.

The bastionification routine has an optional second argument which is
a filter function.  Only those methods for which the filter method
(called with the method name as argument) returns true are accessible.
The default filter method returns true unless the method name begins
with an underscore.

There are a number of possible implementations of bastions.  We use a
'lazy' approach where the bastion's __getattr__() discipline does all
the work for a particular method the first time it is used.  This is
usually fastest, especially if the user doesn't call all available
methods.  The retrieved methods are stored as instance variables of
the bastion, so the overhead is only occurred on the first use of each
method.

Detail: the bastion class has a __repr__() discipline which includes
the repr() of the original object.  This is precomputed when the
bastion is created.

i����(twarnpy3ks1the Bastion module has been removed in Python 3.0t
stacklevelitBastionClasstBastion(t
MethodTypecBs)eZdZd�Zd�Zd�ZRS(sHelper class used by the Bastion() function.

    You could subclass this and pass the subclass as the bastionclass
    argument to the Bastion() function, as long as the constructor has
    the same signature (a get() function and a name for the object).

    cCs||_||_dS(s�Constructor.

        Arguments:

        get - a function that gets the attribute value (by name)
        name - a human-readable name for the original object
               (suggestion: use repr(object))

        N(t_get_t_name_(tselftgettname((s/usr/lib64/python2.7/Bastion.pyt__init__/s
	cCsd|jS(s�Return a representation string.

        This includes the name passed in to the constructor, so that
        if you print the bastion during debugging, at least you have
        some idea of what it is.

        s<Bastion for %s>(R(R((s/usr/lib64/python2.7/Bastion.pyt__repr__<scCs |j|�}||j|<|S(s�Get an as-yet undefined attribute value.

        This calls the get() function that was passed to the
        constructor.  The result is stored as an instance variable so
        that the next time the same attribute is requested,
        __getattr__() won't be invoked.

        If the get() function raises an exception, this is simply
        passed on -- exceptions are not cached.

        (Rt__dict__(RR	t	attribute((s/usr/lib64/python2.7/Bastion.pyt__getattr__Fs
(t__name__t
__module__t__doc__R
RR(((s/usr/lib64/python2.7/Bastion.pyR%s	
	
cCs|d dkS(Nit_((R	((s/usr/lib64/python2.7/Bastion.pyt<lambda>WtcCsLtd�||d�}|d�}|dkr?t|�}n|||�S(s�Create a bastion for an object, using an optional filter.

    See the Bastion module's documentation for background.

    Arguments:

    object - the original object
    filter - a predicate that decides whether a function name is OK;
             by default all names are OK that don't start with '_'
    name - the name of the object; default repr(object)
    bastionclass - class used to create the bastion; default BastionClass

    s/This code is not secure in Python 2.2 and latercSsA||�r4t||�}t|�tkr4|Snt|�dS(s6Internal function for Bastion().  See source comments.N(tgetattrttypeRtAttributeError(R	tobjecttfilterR
((s/usr/lib64/python2.7/Bastion.pytget1us
cSs
||�S(s6Internal function for Bastion().  See source comments.((R	R((s/usr/lib64/python2.7/Bastion.pytget2}sN(tRuntimeErrortNonetrepr(RRR	tbastionclassRR((s/usr/lib64/python2.7/Bastion.pyRWs	cBs�dd
d��Y}|�}e|�}d}|dUdGdGdGHddl}|j�}|jd	�}||_|j|�dS(
sTest the Bastion() function.tOriginalcBs,eZd�Zd�Zd�Zd�ZRS(cSs
d|_dS(Ni(tsum(R((s/usr/lib64/python2.7/Bastion.pyR
�scSs|j|�dS(N(t_add(Rtn((s/usr/lib64/python2.7/Bastion.pytadd�scSs|j||_dS(N(R!(RR#((s/usr/lib64/python2.7/Bastion.pyR"�scSs|jS(N(R!(R((s/usr/lib64/python2.7/Bastion.pyttotal�s(RRR
R$R"R%(((s/usr/lib64/python2.7/Bastion.pyR �s			s�if 1:
    b.add(81)
    b.add(18)
    print "b.total() =", b.total()
    try:
        print "b.sum =", b.sum,
    except:
        print "inaccessible"
    else:
        print "accessible"
    try:
        print "b._add =", b._add,
    except:
        print "inaccessible"
    else:
        print "accessible"
    try:
        print "b._get_.func_defaults =", map(type, b._get_.func_defaults),
    except:
        print "inaccessible"
    else:
        print "accessible"
    
Nt=isUsing rexec:i����t__main__(s====================s====================(RtrexectRExect
add_moduletbtr_exec(R toR+ttestcodeR(trtm((s/usr/lib64/python2.7/Bastion.pyt_test�s		
	R'N((RtwarningsRt__all__ttypesRRRRR1R(((s/usr/lib64/python2.7/Bastion.pyt<module>s2.	-

© 2025 UnknownSec
Web Design for Beginners | Anyleson - Learning Platform
INR (₹)
India Rupee
$
United States Dollar
Web Design for Beginners

Web Design for Beginners

in Design
Created by Linda Anderson
+2
5 Users are following this upcoming course
Course Published
This course was published already and you can check the main course
Course
Web Design for Beginners
in Design
4.25
1:45 Hours
8 Jul 2021
₹11.80

What you will learn?

Create any website layout you can imagine

Support any device size with Responsive (mobile-friendly) Design

Add tasteful animations and effects with CSS3

Course description

You can launch a new career in web development today by learning HTML & CSS. You don't need a computer science degree or expensive software. All you need is a computer, a bit of time, a lot of determination, and a teacher you trust. I've taught HTML and CSS to countless coworkers and held training sessions for fortune 100 companies. I am that teacher you can trust. 


Don't limit yourself by creating websites with some cheesy “site-builder" tool. This course teaches you how to take 100% control over your webpages by using the same concepts that every professional website is created with.


This course does not assume any prior experience. We start at square one and learn together bit by bit. By the end of the course you will have created (by hand) a website that looks great on phones, tablets, laptops, and desktops alike.


In the summer of 2020 the course has received a new section where we push our website live up onto the web using the free GitHub Pages service; this means you'll be able to share a link to what you've created with your friends, family, colleagues and the world!

Requirements

No prerequisite knowledge required

No special software required

Comments (0)

Report course

Please describe about the report short and clearly.

Share

Share course with your friends