ArashLari Week 3

From LMU BioDB 2017
Jump to: navigation, search

Hacking A Webpage

I replaced an image and edited some text on the White House website.

With Developer Tools

BoratWithDev.png

With No Developer Tools

BoratNoDev.png

The Genetic Code

curl command

curl -d "pre_text=cgatggtacatggagtccagtagccgtagtgatgagatcgatgagctagc&submit=Submit" http://web.expasy.org/cgi-bin/translate/dna_aa

Question Response

  1. The page referred to a couple of stylesheets (sib.css, base.css, sib_print.css) which from what I can tell control the formatting of the webpage. The main internal server it communicates with would be http://web.expasy.org/cgi-bin/translate/dna_aa which talks to a few internal servers for each step of the translation as well, this is the part of the web app that does all the heavy lifting.
  1. While there are lots of identifiers throughout the html document, the one's we really used were "textarea name=pre_text" and "action=/cgi-bin/translate/dna_aa". However there were plenty of other identifiers like anything with "sib" in the title, or the "select name=code" and "select name=output" which control the kind of genetic code and output format respectively.

Curl Command for Extracting Answer (tentative)

curl -d "pre_text=cgatggtacatggagtccagtagccgtagtgatgagatcgatgagctagc&submit=Submit" http://web.expasy.org/cgi-bin/translate/dna_aa | sed "1,47d" | sed 's/<[^>]*>//g' | sed "14,50d" | sed "2s/[A-Z]/& /g" | sed "4s/[A-Z]/& /g" | sed "6s/[A-Z]/& /g" | sed "8s/[A-Z]/& /g" | sed "10s/[A-Z]/& /g" | sed "12s/[A-Z]/& /g" | sed "s/-/STOP /g" | sed "s/M/Met/g"

Notebook

Hacking a page

For the page hacking, I went on whitehouse.gov and changed a quote and the picture by inspecting the page and finding where they had "img src =" and replaced it with my own url, and for changing the text I simply inspected the text area of the page and edited what was in the highlighted section.

curl

We used curl -d to enter data into the correct field and changed the content of pre_text and submit in order to input our desired string and also load the proper page. We used it in conjunction with several sed commands that removed the unnecessary lines before and after our answer and things in between the "<" and ">" symbols (getting rid of almost all the html). We also added a space between all the capital letters on the evenly numbered lines, but that isn't our final answer, it's the best we could come up with for now though.

Acknowledgments

I worked with Corinne Wong on this assignment and together we figured out the best strategy for strategically removing all the necessary information on the webpage using Unix Bash.

References

  1. LMU BioDB 2017. (2017). Week 3. Retrieved September 12, 2017, from https://xmlpipedb.cs.lmu.edu/biodb/fall2017/index.php/Week_3
  2. White House (2017). Retrieved September 17, 2017 from https://www.whitehouse.gov/

Arash Lari

BIOL/CMSI 367-01: Biological Databases Fall 2017

Assignments


Journal Entries:

Shared Journals: