TODO: Need to pull web notes out of the OS Agnostic section (and then rename that to something better!)
Hack Responsibly.
Always ensure you have explicit permission to access any computer system before using any of the techniques contained in these documents. You accept full responsibility for your actions by applying any knowledge gained here.
# Use HTTP::Cookie library <https://github.com/sparklemotion/http-cookie># Following examples were taken from the readme.md from above repository## One cookie cookie =HTTP::Cookie.new("uid","u12345", domain: 'example.org', for_domain: true, path: '/', max_age: 7*86400) header['Set-Cookie'] = cookie.set_cookie_value## Several cookies jar =HTTP::CookieJar.new jar.load(filename) ifFile.exist?(filename) header["Set-Cookie"].each { |value| jar.parse(value, uri) } header["Cookie"] =HTTP::Cookie.cookie_value(jar.cookies(uri))
Python2
# python has a cookie library!# Following example taken from the python documentationimportcookielib,urllib2cj=cookielib.CookieJar()opener=urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))r=opener.open("http://example.com/")
Edit cookies in chrome
Settings -> Advanced Settings -> Privacy -> Content -> Cookies
or "Edit This Cookie" plugin
Edit cookies in firefox
Preferences -> Privacy -> Show Cookies
or "Cookies Manager+" addon
Local File Inclusion (LFI) / Remote File Inclusion (RFI)
# POST filecurl-XPOST-F"file=@/file/location/rev.php"http://$ip/upload.php--cookie"cookie"# POST binary data to web formcurl-F"field=<rev.zip"http://$ip/upload.php-F'k=v'--cookie"k=v;"-F"submit=true"-L-v
OpenVAS Vulnerability Scanner
#Install openvasaptupdateaptinstallopenvas#Run the setup scriptopenvas-setup#Check that it is running on port 939netstat-tulpn#Login by using a browser and navigating to: https://127.0.0.1:939
fe80::/10 - febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff Unique Link Local 169.254.x.x APIPA
(built from MAC address on Linux, 7th bit flips, adds ff:fe in the center)
fc00::/7 - fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff Unique Local Unicast 10.x.x.x, 172.16.x.x, 192.168.x.x
2000::/3 - Global Unicast routable
ff02::1 - Multicast All Nodes
ff02::2 Multicast ROUTER nodes
Web site "flyover" surveillance: Aquatone "is a tool for visual inspection of websites across a large amount of hosts and is convenient for quickly gaining an overview of HTTP-based attack surface" - from the author (see link). Visual dirbuster?
Crawl web pages for keywords - useful for password/vhost enumeration lists
# To spider a site and write all found words to a filecewl-w<file><url># To spider a site and follow links to other sitescewl-o<url># To spider a site using a given user-agent cewl-u<user-agent><url># To spider a site for a given depth and minimum word lengthcewl-d<depth>-m<minwordlength><url># To spider a site and include a count for each wordcewl-c<url># To spider a site inluding meta data and separate the meta_data wordscewl-a-meta_file<file><url># To spider a site and store email adresses in a separate filecewl-e-email_file<file><url>
Common checks
# robots.txtcurlhttp://example.com/robots.txt# headerswget--save-headershttp://www.example.com/# Strict-Transport-Security (HSTS)# X-Frame-Options: SAMEORIGIN# X-XSS-Protection: 1; mode=block# X-Content-Type-Options: nosniff# Cookies# Check Secure and HttpOnly flag in session cookie# If you find a BIG-IP cookie, app is behind a load balancer# SSL Ciphersnmap--scriptssl-enum-ciphers-p443www.example.com# HTTP Methodsnmap-p443--scripthttp-methodswww.example.com# Cross Domain Policycurlhttp://example.com/crossdomain.xml# allow-access-from domain="*"
IP conversion
Injecting IPs when '.' is disallowed: convert the standard "dotted decimal" format to decimal, or hex value using -ip2dh. The sending or receiving computer will usually automatically convert it to a format that it can use. This is a great way to bypass WAF, IDS, or other tools that filter on IPs.
If you like this content and would like to see more, please consider buying me a coffee!