mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-04 15:55:12 -04:00
WebHacking: README, urllib2 scripts
This commit is contained in:
parent
54d8d02892
commit
a36bde60b7
15 changed files with 209 additions and 99 deletions
25
Web_Security/urllib2/simple_get.py
Normal file
25
Web_Security/urllib2/simple_get.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
__author__ = "bt3"
|
||||
|
||||
import urllib2
|
||||
|
||||
def get(url):
|
||||
msg = urllib2.urlopen(url)
|
||||
print msg.read()
|
||||
|
||||
def get_user_agent(url):
|
||||
headers = {}
|
||||
headers['User-Agent'] = 'Googlebot'
|
||||
|
||||
request = urllib2.Request(url, headers=headers)
|
||||
response = urllib2.urlopen(request)
|
||||
|
||||
print response.read()
|
||||
response.close()
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
HOST = 'http://www.google.com'
|
||||
get_user_agent(HOST)
|
Loading…
Add table
Add a link
Reference in a new issue