Skip to content

Instantly share code, notes, and snippets.

@gberche-orange
Last active August 29, 2015 14:15
Show Gist options
  • Save gberche-orange/0fd51fe126d41f8e2c20 to your computer and use it in GitHub Desktop.
Save gberche-orange/0fd51fe126d41f8e2c20 to your computer and use it in GitHub Desktop.
openhub repo creation brute force script
#!/bin/bash
#might need to add oauth to avoid running into github rate limiting quotas
curl https://api.github.com/orgs/cloudfoundry/repos?page=1 >> repos.yml
curl https://api.github.com/orgs/cloudfoundry/repos?page=2 >> repos.yml
curl https://api.github.com/orgs/cloudfoundry-incubator/repos?page=2 >> incubator_repos.yml
REPOS=$(cat repos* *incu* | grep git_url | cut -f 4 -d'"');
#manually test with a single repo instead
#REPOS=git://github.com/cloudfoundry-incubator/fezzik.git
for REPO in $REPOS;
do echo REPO is $REPO;
curl -D new_headers.txt -b cookies.txt -c s_cookies.txt -L "https://www.openhub.net/p/cloudfoundry/enlistments/new" -H "Host: www.openhub.net" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3" --compressed -H "Referer: https://www.openhub.net/p/cloudfoundry/enlistments" -H "Cookie: uid=rB0lM1TT7Bt+jCu3A4QXAg==; _ga=GA1.2.1490667206.1423174688; auth_token=[ommited]; __atuvc=2"%"7C5; _ohloh_session=BAh7CzoPc2Vzc2lvbl9pZCIlYzZlMmZhZjg3ZGZiZGVjMDMyMjllMTJiZmRmMjUxNzg6DGFjY291bnRpA"%"2FDTCzoQbGFzdF9hY3RpdmV1OglUaW1lDbfEHMBAOzcgOgtmb3J1bXN7ADoLdG9waWNzQAhJIgpmbGFzaAY6BkVGSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7BjoMc3VjY2Vzc0kiUlN1Y2Nlc3NmdWxseSBhZGRlZCBnaXQ6Ly9naXRodWIuY29tL2Nsb3VkZm91bmRyeS1pbmN1YmF0b3IvbmF0YmVhdC5naXQgbWFzdGVyBjsLRgY6CkB1c2VkewY7DVQ"%"3D--1b09b101ae58fefd8961a94a2d18229ea6981f84; _gat=1" -H "Connection: keep-alive" -H "If-None-Match: ""4be0c5ffefda01b40d5ac81caaf70517""" -o new.html ;
# -vvv --trace-ascii /dev/stdout
curl -D post_headers.txt -L -b s_cookies.txt "https://www.openhub.net/p/cloudfoundry/enlistments" -H "Host: www.openhub.net" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3" --compressed -H "Referer: https://www.openhub.net/p/cloudfoundry/enlistments/new" -H "Cookie: uid=rB0lM1TT7Bt+jCu3A4QXAg==; _ga=GA1.2.1490667206.1423174688; auth_token=[omited]; __atuvc=2"%"7C5; _ohloh_session=BAh7CjoPc2Vzc2lvbl9pZCIlYzZlMmZhZjg3ZGZiZGVjMDMyMjllMTJiZmRmMjUxNzg6DGFjY291bnRpA"%"2FDTCzoQbGFzdF9hY3RpdmV1OglUaW1lDbfEHMBAOzcgOgtmb3J1bXN7ADoLdG9waWNzQAg"%"3D--fb4c2b7a79a5e8be313fc6390ac8da83e623e873" -H "Connection: keep-alive" --data-urlencode "repository[url]=${REPO}" --data "repository"%"5Btype"%"5D=GitRepository&repository"%"5Busername"%"5D=&repository"%"5Bpassword"%"5D=&repository"%"5Bmodule_name"%"5D=&repository"%"5Bbranch_name"%"5D=&commit=Save+Code+Location" -o post.html ;
#sleep 5
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment