Daily learning part eleven
Today I started at 12:30 with the 350 pages of reading and finished the entire book at 17:30. During that time I also reviewed my history lessons.
I started my daily cybersecurity grind at 17:50. First I did the JS debugging section—I’m almost at the end of the course. I also wrote two scripts: one in JavaScript and one in Python. Yesterday I made an IP address extractor and a hostname extractor, so I figured why not combine both. I did it first in JavaScript, which was pretty easy:
let inputs = [
"https://example.com/login",
"192.168.1.1:80",
"http://test.example.com/admin",
"10.0.0.5:443",
"https://example.com/dashboard"
];
let result = [];
for (let i = 0; i< inputs.length; i++){
let item = inputs[i]
if (item.includes("://")) {
let hostnames = item.split("://")[1].split("/")[0];
result.push(hostnames)
}
else if (item.includes(":")){
let ips = item.split(":")[0];
result.push(ips)
}
else {
result.push(item)
}
}
newResult = [...new Set(result)]
console.log(newResult)
Then I did the same in Python to see if I still got it:
inputs = [
"https://example.com/login",
"192.168.1.1:80",
"http://test.example.com/admin",
"10.0.0.5:443",
"https://example.com/dashboard"
]
result = []
for item in inputs:
if "://" in item:
hostname = item.split("://")[1]
hostname = hostname.split("/")[0]
result.append(hostname)
elif ":" in item:
ips = item.split(":")[0]
result.append(ips)
else:
result.append(item)
print(result)
I started doing small projects to refresh my memory on things I forget, like when to use dictionaries. I did this code counter:
status_codes = [200, 404, 200, 301, 404, 500, 200, 301, 404]
counts = {}
for code in status_codes:
if code in counts:
counts[code] += 1
else:
counts[code] = 1
print(counts)
I also spent some time planning my summer project. I’m keeping it to myself for now, but I was thinking about the name, the first version, and how to make it genuinely useful. That’s all I’ll say for now.
I forgot to mention in yesterday’s blog that I bought a PDF from Hacker Joe on YouTube: Network Scanning Beginner to Pro - The No-BS Edition. The PDF was really good and I really liked it. I ended the session by watching a video about web hacking. Now I’m going to study for my history test tomorrow.
Top comments (0)