User Tag List

Results 1 to 2 of 2

Thread: [Python]Web Security

  1. #1

    Default [Python]Web Security

    Been bored and skimmed through my old pc. Found some python scripts and was like, "Haven't posted in BG for awhile."

    import webbrowser
    import urllib
    import rexec
    import tkMessageBox
    #Created by: Saibal
    class web_security(object):
        """Web Security Module"""
        def __init__(self):
            the_url = str(raw_input("Address: "))
                tempfile = urllib.urlopen(the_url).read()
            except IOError:
                print "Error finding file."
            if the_url[-3:] == ".py":
                    print tempfile
                except UnboundLocalError:
                    print "Invalid web address."
        def runCode(self, statement):
            except AttributeError, name:
                tkMessageBox.showerror( "Error",
                                        "Restricted code tried to access forbidden " + \
                                        "attribute:" + str( name ) )
    start = web_security()
    Amazed that it's not obsolete yet..

    What this does is exactly, is allow you to enter a url you surf. Once the program connects it the website it displays the websites source, but if the URL has the extension .py it connects and runs the python script. This is a big security hole, and must be fixed. That is why we imported rexec to scan the code, and compare it to the python program. If there are similar objects it will display a message box with the attribute the url .py script tried to access, and won't run the code.

    Use it on your python applications, it comes in handy, trust me on that.

  2. #2

    Default Re: [Python]Web Security


    Still useable. I honestly don't know how people haven't patched it.

Similar Threads

  1. i want to buy genious gp
    By mr_08 in forum Shop - Gadgets
    Replies: 4
    Last Post: June 4th, 2009, 13:08

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Page generated in 0.10500 seconds with 14 queries.