Step 1: Create an option for input
var username = prompt("Enter a username: ");
The result should look something like this.
Step 2: Plug that username into a URL
For this example, we're going to create a bookmarklet for Facebook. To start, create a variable called fb and add the Facebook URL, including https://, as the value and append the username variable you created in Step 1 to the end of it. It should look something like this.
var fb = "https://facebook.com" + username;
We can test this the same way we tested the username variable in Step 1, in the console.
We added the console.log(fb) to the end just so we can get a record of the output after appending the username variable to facebook.com. If all goes well, it should look something like this.
Step 3: Open the URL in a New Tab
We can test this, again, in the console. It should look something like this.
If the test goes well, you'll find that the desired Facebook profile is now opened in a new tab. Now, it's time to convert that into a bookmarklet.
The end result should look something like this:
var username=prompt("Enter a username: "),fb="https://facebook.com/"+username;window.open(fb,"_blank");
We're still not ready to make this a bookmarklet. Now that the code is compatible, we have to format it correctly in the next step.
Step 5: Create the Bookmarklet
If you prefer to do it manually, here's the formula for creating a bookmarklet:
Step 6: Add more Functionality
You can add additional variables for checking multiple websites and add additional functions to open those websites with one motion. You can also add Google search URLs to automate Google Dorking. The possibilities are endless. Here's an example of a very complex and robust bookmarklet for expanding all comments and replies on Facebook.
Step 7: Share your Project
Once you have something that's actually valuable in your own workflow, make sure to share it with the rest of the OSINT community. Check out this collection of bookmarklets I've been working on with @BOsintBlanc. It's a great place to start when thinking about ideas for your next tool.
Thanks for reading. If you enjoyed this post, make sure to subscribe. A new one just like this will be posted every Wednesday at 6:00 PM UTC-5:00.