Web Links Gatherer dengan Python

program sederhana ini digunakan untuk mengumpulkan link-link yang ada pada sebuah halaman web, bisa juga di kembangkan menjadi sebuah crawler.. 😀

#info: program untuk mendapatkan info link-link
#      yang terdapat dalam sebuah halaman web
# otoy(http://otoyrood.wordpress.com)
# 0x102010

from urllib import urlopen
import re,sys

peng = '''Penggunaan: python %s http://<alamat web> (jangan lupa http:// atau https://)
Contoh    : python %s http://otoyrood.wordpress.com''' %(sys.argv[0],sys.argv[0])

def main():
 if len(sys.argv) <=1:
 print peng

 pat = re.compile('href="([http:|https:].*?)"')

 urlscn = urlopen(sys.argv[1]).read()
 except IOError:
 print peng
 print "[+]Gathering links from the web"

 for url in pat.findall(urlscn):

fl = open("haslscan.txt","w")

for url in sorted(urls):
 hsl = '%s' % url,"n"

 print "[+]Gathering links done"

if __name__ == "__main__" :

in action:

the result:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

About Spentera

We are specializing in penetration test, vulnerability assessment, computer forensics, as well as intrusion analyst and malware analysis. Customers can contact us directly at contact[at]spentera[dot]id, or use Contact Our Team menu on the sidebar.