Discovering the Power of ChatGPT: My Experiences and Insights

Shubham Bhamare
InfoSec Write-ups
Published in
8 min readFeb 8, 2023

--

Image source: https://openai.com/blog/chatgpt/

Hi guys, It’s Shubham Bhamare again. Today’s Medium story is quite different as it’s not a bug bounty write-up. It’s about ChatGPT. Since its launch, I have been playing with it and thought I should write a story to share my experiences with it.

For those who still don’t know, ChatGPT (Chat Generative Pre-trained Transformer) is a chatbot developed by OpenAI that uses the GPT-3 language model to generate responses to user input. It can be used for a variety of purposes, such as having casual conversations, answering questions, generating creative content for websites and social media, solving coding challenges, generating useful automation scripts, getting suggestions on various things, and so on.

When I first heard about ChatGPT, I was immediately intrigued by its capabilities. I started experimenting with it by having casual conversations with it and asking it various questions. I was really impressed by how well it was able to respond to my queries and carry on a conversation. It was almost like talking to a real person, except that the responses were generated by a machine.

Below are the things that I have tried with it so far 👇

Things I tried first:

When I heard about ChatGPT, I thought it is a virtual assistant just like Amazon Alexa, Apple’s Siri, and Google Assistant so the very first thing that I asked it was 👇 (Don’t laugh please🤭)

And it gave me the following results respectively 👇

Okay, now I got to know that it can’t access the internet and can only provide results based on internet data available till the year 2021. TBH, at that time I thought that it’s a useless thing as it can’t provide real-time results, and other services are far better than this. So I didn’t use it for the next few days even after hearing the news that it crossed 1M+ users in just 5 days. 🤯

Later I saw some Tweets and LinkedIn posts where people had generated some cool results with ChatGPT such as a python script to generate XSS payloads, python scripts to automate various tasks, creative content for websites and social media, creative tagline suggestions for businesses, and so on. So I thought to use it that way and it was time when I fall in love with ChatGPT and realized why many people are talking about it.

You can’t love the product until you fully understand how to use it.

— Shubham Bhamare 😇

I tried it from a security researcher’s perspective:

After understanding what things ChatGPT can do, the very first thing that came to my mind is to generate some useful python scripts so I asked ChatGPT 👇

And ta-da! I was really impressed by the result it gave 🤩👇

import re
import subprocess
import csv

def find_subdomains(url):
# Use the 'dig' command to find the subdomains of the given URL
output = subprocess.check_output(["dig", "NS", url]).decode("utf-8")
# Extract the subdomains from the output of the 'dig' command
subdomains = re.findall(r"\b[\w.-]+%s\b" % url, output)
return subdomains

def main():
# Get the URL from the user
url = input("Enter a URL: ")
# Add the appropriate protocol if the user hasn't already included it
if not url.startswith("http://") and not url.startswith("https://"):
url = "http://" + url
# Find the subdomains of the URL
subdomains = find_subdomains(url)
# Print the subdomains
print("Subdomains:")
for subdomain in subdomains:
print(subdomain)
# Ask the user if they want to export the subdomains to a CSV file
export = input("Export subdomains to CSV file? (y/n) ")
if export.lower() == "y":
# Get the filename from the user
filename = input("Enter a filename: ")
# Add the .csv extension if it's not already there
if not filename.endswith(".csv"):
filename += ".csv"
# Write the subdomains to the CSV file
with open(filename, "w", newline="") as csvfile:
writer = csv.writer(csvfile)
writer.writerow(["Subdomain"])
for subdomain in subdomains:
writer.writerow([subdomain])
print("Subdomains exported to %s" % filename)

if __name__ == "__main__":
main()

Another impressive thing was it not only gave me the python code but also explained how it actually works.

Okay, we should not ignore that warning given at the bottom too. (So these results are for educational purposes only. 😬)

Later, I tried many different things like 👇

  1. Python program for port scanning
  2. Python program for XSS payload generator
  3. Python program to find XSS vulnerabilities
  4. Python program to find SQLi vulnerabilities
  5. Writing a bug bounty PoC (Yeah, ChatGPT can write bug bounty PoC too. But you’ll have to give some details of your finding and I don’t think it’s a good idea)
  6. And this was EPIC… 😅👇

I tried it from a developer’s perspective:

I asked ChatGPT 👇

import 'package:flutter/material.dart';

class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {},
),
actions: <Widget>[
IconButton(
icon: Icon(Icons.search),
onPressed: () {},
),
],
),
body: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Colors.red,
Colors.pink,
],
),
),
child: Column(
children: <Widget>[
Container(
height: 100,
width: double.infinity,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Colors.red,
Colors.pink,
],
),
),
child: Padding(
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"FlutDate",
style: TextStyle(
color: Colors.white,
fontSize: 32,
fontWeight: FontWeight.bold,
fontFamily: "Poppins",
),
),
SizedBox(
height: 10,
),
Text(
"Find your match",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
fontFamily: "Poppins",
),
),
],
),
),
),
Expanded(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(40),
topRight: Radius.circular(40),
),
),
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(40),
child: Column(
children: <Widget>[
Container(
height: 300,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: 200,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(
"https://via.placeholder.com/200x300",
),
fit: BoxFit.cover,
),
borderRadius: Border
Radius.circular(20),
),
margin: EdgeInsets.only(right: 20),
),
Container(
width: 200,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(
"https://via.placeholder.com/200x300",
),
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(20),
),
margin: EdgeInsets.only(right: 20),
),
Container(
width: 200,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(
"https://via.placeholder.com/200x300",
),
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(20),
),
margin: EdgeInsets.only(right: 20),
),
],
),
),
SizedBox(
height: 20,
),
Container(
height: 50,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: 100,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20),
),
margin: EdgeInsets.only(right: 20),
child: Center(
child: Text(
"Home",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
fontFamily: "Poppins",
),
),
),
),
Container(
width: 100,
decoration: BoxDecoration(
color: Colors.pink,
borderRadius: BorderRadius.circular(20),
),
margin: EdgeInsets.only(right: 20),
child: Center(
child: Text(
"Date",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
fontFamily: "Poppins",
),
),
),
),
Container(
width: 100,
decoration: BoxDecoration(
color: Colors.pink,
borderRadius: BorderRadius.circular(20),
),
margin: EdgeInsets.only(right: 20),
child: Center(
child: Text(
"Chat",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
fontFamily: "Poppins",
),
),
),
),
Container(
width: 100,
decoration: BoxDecoration(
color: Colors.pink,
borderRadius: BorderRadius.circular(20),
),
margin: EdgeInsets.only(right: 20),
child: Center(
child: Text(
"Profile",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
fontFamily: "Poppins",
),
),
),
),
],
),
),
],
),
),
),
],
),
),
],
),
),
);
}

In this example, I have generated Dart code but you can try it with any programming language with your own prompts.

I tried it from a content writer’s perspective:

I asked ChatGPT 👇

You can try it with your own prompts to generate creative content for your company, as well as for your blogs as I have also generated some content for this article you are reading right now. Okay, but not everything, just 5–6 lines.😋 Furthermore, it’ll help you write professional emails too with custom prompts. Below is an example, I was really impressed by that result. 👇

And most important — I tried it from an entrepreneur’s perspective:

From an entrepreneur’s perspective, I tried various things like:

  1. Generating email responses
  2. Generating social media posts
  3. Generating ideas for product features
  4. Generating scripts to automate repetitive tasks
  5. Writing MOM (Minutes of Meeting)
  6. Writing SOP (Standard Operating Procedure)
  7. I found that ChatGPT can be used as a Decision Support System (DSS) to some extent
  8. I also found that it can provide some assistance to entrepreneurs in financial planning

Tell me in the comment section what other tasks can be done through ChatGPT to supercharge your productivity and get more done in less time as an entrepreneur.

Conclusion:

In conclusion, ChatGPT has many uses beyond what is mentioned in this article. One of its best features is the ability to generate custom code and content and make changes with prompts as needed. This is particularly useful for generating UI code, content, emails, and more. However, there are some limitations to consider as well. Currently, ChatGPT is based on internet data available until 2021, so the results it provides can sometimes be inaccurate or outdated. Additionally, there have been instances of the code generation process breaking down, but this can be remedied by simply asking ChatGPT to continue.

If ChatGPT were to have access to real-time data in the future, it could become even more powerful and useful. The information it uses would always be up-to-date, leading to more accurate results. The code generation process would be more efficient, with fewer errors or breaks. And, it could potentially provide even more advanced and innovative solutions to problems. In short, the potential for ChatGPT with real-time data access is exciting and opens up a world of possibilities.

Thank you for reading! Stay tuned for my next blog, and don’t forget to follow me on Facebook, Twitter, LinkedIn, and Instagram. 😊

--

--