7
1
Introduction
Wardialing was a very interesting way to try to hack people back in the '80s and '90s. When everyone used dial-up, people would dial huge amounts of numbers to search for BBS's, computers, or fax machines. If it was answered by a human or answering machine, it hung up and forgot the number. If it was answered by a modem or a fax machine, it would make note of the number.
"Of course, you realize this means War...dialing?" <--- Pun made by @Shaggy
Challenge
Your job is to make a URL wardialer. Something that tests and checks if it's a valid website from one letter of the alphabet.
Constraints
- Program must take user input. This input has to be a letter of the alphabet, no numbers. Just one letter of the alphabet and form multiple URLs that start with the letter. Input letter will be lowercase, not uppercase.
- Standard loopholes apply.
- You must make 8 URLs from 1 letter, and test to see if it is a valid site.
- If you hit an error (not a response code), instead of leaving it blank, go ahead and return a 404
- If you hit a redirect (3xx), return a 200 instead.
- You may output the results in any reasonable format, as long as it includes the website name, status codes for all the websites and the redirects.
- This is code-golf, so shortest amount of bytes wins.
What counts as a URL for this challenge?
http://{domain-name}.{com or net or org}
For this challenge, the domain name should only be 4 letters long, no more, no less.
What should I test?
For each 4 letter domain name, test it against three top-level domains (.com, .net, .org). Record all the response codes from each URL, remember from the constraints that any (3xx) should return 200 and be recorded as a redirect in the output and any error getting to the website should result in a 404.
Input
a
Output
+---------+------+------+------+------------+
| Website | .com | .net | .org | Redirects? |
+---------+------+------+------+------------+
| ajoe | 200 | 200 | 200 | .com, .net |
+---------+------+------+------+------------+
| aqiz | 200 | 404 | 404 | no |
+---------+------+------+------+------------+
| amnx | 200 | 503 | 404 | .com |
+---------+------+------+------+------------+
| abcd | 200 | 404 | 200 | .com |
+---------+------+------+------+------------+
| ajmx | 200 | 503 | 404 | no |
+---------+------+------+------+------------+
| aole | 200 | 200 | 200 | .com |
+---------+------+------+------+------------+
| apop | 404 | 200 | 200 | .net |
+---------+------+------+------+------------+
| akkk | 200 | 200 | 200 | .com |
+---------+------+------+------+------------+
1As a more modern human, what exactly was the point of wardialing? What did you use the numbers for? – Beta Decay – 2017-05-23T15:42:35.663
1@BetaDecay Typically, they were used to find computers, BBS's, or pretty much anything that could be connected to a computer modem. Once a number was found that could, the user could try to guess the user account to gain access to the system over dialup. – KuanHulio – 2017-05-23T15:46:28.777
Are you sure it's only in the 80s or 90s? 'Cause I often get calls that hang up after one second... – feersum – 2017-05-23T16:01:37.207
4
If you've seen the movie WarGames, I believe the protagonist does some of this.
– Stephen – 2017-05-23T16:02:23.8771That's where the name wardialing came from, I assume @StephenS and well, it never really stopped but was more prominent in the 80s and 90s. Not a lot of people use dialup any more. – KuanHulio – 2017-05-23T16:04:12.027
Can the url contain numbers? – ovs – 2017-05-23T17:06:45.023
@ovs Yes it can contain numbers. – KuanHulio – 2017-05-23T17:10:08.287
How should we choose the 8 url's – ovs – 2017-05-23T20:58:49.700
At complete and utter randomness, the letter has to be at the beginning of each domain name – KuanHulio – 2017-05-23T21:00:20.167
I've heard the only winning move is not to play. – Bumpy – 2017-05-30T22:44:30.933
Apparently everyone thinks so too @Bumpy – KuanHulio – 2017-05-30T22:46:05.567
Oh? This one looked interesting. If I get a few moments when the boss isn't looking over my shoulder I'll give it a bash ;-) JS is my weapon of choice, and Justin's 249 is a tantalising target, though I'm sure I'll find he's removed every unnecessary byte. ;-) – Bumpy – 2017-05-30T22:59:26.253