Coder Social home page Coder Social logo

azel's Introduction

Azel

Or how to have fun with the internet

Azel is a python library equivalent to the Elza Perl macro-language (HTTP scripting)

It basically allows you to automatize sequences of HTTP requests and to script around it (without having to care about sessions / redirections / randomly generated input fields)...

Usage

Initialization

import azel
a = azel.Azel()

Query a website

a.get('http://www.lescigales.org') # promo never hurts !

Specify a proxy to use

a.proxyHost = '10.7.0.1'
a.proxyPort = 8118

Collect links from a web page:

getLink(re.pattern) will return the href of the first link match getLinks(re.pattern) will return a list of links

a.get('http://sk.php.net/')
dl = a.getLink('downloads')
a.get(dl)
links = a.getLinks('PHP 5.')
for link in links:
    print link.href, link.value, link.title

    # Download the first link                                                                    
    a.get(link.href)
    l = a.getLink('sk.php.net')
    a.get(l)

    tarball = a.read() # thats right babe, we just got php's tarball                              
    break

Pre-fill a form

a.get('https://gist.github.com/')
a.fillForm()
print a.data # this will return the prefilled form data

Post a form (and publish cool stuff on gist)

a.get('http://gist.github.com/')
a.fillForm()

a.data['file_ext[gistfile1]'] = '.py'
a.data['file_name[gistfile1]'] = __file__.strip('./')
a.data['description'] = 'This was published by awesome azel!'
a.data['file_contents[gistfile1]'] = content

a.post('') # will post the first form

will produce the following output:

-> GET http://gist.github.com/
<- 301 Moved Permanently
-> GET https://gist.github.com/
<- 200 OK
-> POST https://gist.github.com/gists
<- 302 Found
-> GET https://gist.github.com/2491246
<- 200 OK

Annoy the hell of an asshole by trashing his blog:

blog = azel.Azel()
final = []
blog.get('http://strepoetlo.legtux.org/')
links = blog.getLinks('/#respond')
for l in links: final.append(l.href)
links = blog.getLinks('/#comments')
for l in links: final.append(l.href)
previous = blog.getLink('Previous')
blog.get(previous)
links = blog.getLinks('/#respond')
for l in links: final.append(l.href)
links = blog.getLinks('/#comments')
for l in links: final.append(l.href)

for link in final:
    print link
    blog.get(link)
    blog.fillForm()
    post = 'http://strepoetlo.legtux.org/wp-comments-post.php'
    s = 'http://forum.lescigales.org/topic1638-site-de-phishing-httpstrepoetlolescigalesorg-par-strepoetlo.html'
    blog.data['author'] = 'Paul Gonsolin'
    blog.data['url'] = 'http://strepoetlo.lescigales.org/'
    blog.data['email'] = '[email protected]'
    blog.data['comment'] = 'Createur de sites de phishing Facebook, priere de ne plus venir sur lesCigales.ORG. -> <a href="'+s+'">'+s+'</a>'
    blog.post(post)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.