The New OSINT Cheat Code: ChatGPT

VEEXH
The Sleuth Sheet
Published in
5 min readFeb 23, 2023
Tiberian Serpent | Tiberian Order

TOPICS

  • OS-INT
  • ChatGPT
  • Practical Example

OS-INT

OSINT pronounced “OH-SINT” an abbreviated form of “Open Source Intelligence” which is explained as the collection, analysis, and dissemination of public and declassified information, even if it’s behind a paywall as long as the public has access to such information it’s categorized under OSINT. However, separating the abbreviation into OS-INT allows individuals new to the world of intelligence to gain a better understanding.

The OS component focuses on publicly available information found on the internet, such as open-source software, social media posts, and documents released by governments or corporations. This information is gathered and analyzed to gain insights into particular topics.

The INT component focuses on the analysis of the information gathered. This analysis can involve looking for patterns in the data, searching through public records, and applying other intelligence techniques, most notably structured analytic techniques, to gain a better understanding of the topic. The information gathered can then be used to make decisions or take action.

CHATGPT

I incorporated ChatGPT into OSINT via the collection process of the intelligence cycle. As ChatGPT is used to gather information from a variety of sources through natural language processing. It can collect data through conversations and queries, helping to identify relevant information for further analysis.

Intelligence Cycle Including ChatGPT

PRACTICAL EXAMPLE

This practical example involves ChatGPT and its capabilities to gather relevant information. This is why ChatGPT fits best into the collection phase, as it can efficiently gather and organize vast amounts of data.

Gathering Information Regarding This Video

The YouTube video shows a controlled explosion that took place in the Great Yarmouth town of England. The video lists key pieces of information that can be used for geolocation and information collection. Such as the area name, BP gas station, and most notably an “explosion” in the title of the video.

Here is the prompt I sent to ChatGPT to collecting relevant information.

My Prompt

ChatGPT tends to take most of my requests as illegal or bordering the lines of ethical and unethical behavior, so it’s useful to input keywords to specify that the prompt is truly for ethical behavior. i.e “THIS IS ALL LEGAL”

ChatGPT Response

I edited the code in ChatGPT six times before I produced a result that I thought produced the data in a format fit for others to read quickly and include with existing data.

package main

import (
"fmt"
"log"
"os"
"io/ioutil"
"net/http"
"net/url"
"regexp"
"strings"
)

func main() {
// Get the search keywords from command line arguments
keywords := os.Args[1:]
query := url.QueryEscape(fmt.Sprintf("%s %s", keywords[0], keywords[1]))
googleURL := fmt.Sprintf("https://www.google.com/search?q=%s&num=10", query)

// Create an HTTP client and send the request
client := &http.Client{}
req, err := http.NewRequest("GET", googleURL, nil)
if err != nil {
log.Fatalln(err)
}
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)")

resp, err := client.Do(req)
if err != nil {
log.Fatalln(err)
}
defer resp.Body.Close()

// Read the response body and extract the URLs
bodyBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}

re := regexp.MustCompile(`https?://[^/]+(/[^\s]*)?`)
matches := re.FindAllString(string(bodyBytes), -1)

// Write the URLs to a CSV file
file, err := os.Create("results.csv")
if err != nil {
log.Fatalln(err)
}
defer file.Close()

// Write the header row to the file
file.WriteString("URL\n")

for _, match := range matches {
// Trim the URL to remove any extra characters
url := strings.TrimSuffix(match, "/")
url = strings.TrimSuffix(url, "\"")
url = strings.TrimSuffix(url, ")")

// Trim everything after '&amp' from the URL
if strings.Contains(url, "&amp") {
url = strings.Split(url, "&amp")[0]
}

// Format the URL as a CSV line and write it to the file
csvLine := fmt.Sprintf("\"%s\"\n", strings.ReplaceAll(url, "\"", "\"\""))
file.WriteString(csvLine)
}
}

You can run this script with two search keywords as arguments, like this:

go run main.go "Great Yarmouth" "Bomb Explodes"

Note: Please make sure to use this script responsibly and in accordance with Google’s terms of service.

RESULTS:

URL
"https://maps.google.com/maps?q=Great+Yarmouth+Bomb+Explodes"
"https://www.bbc.com/news/uk-england-norfolk-64604115"
"https://www.norfolk.police.uk/news/latest-news/communities-thanked-after-wwii-bomb-blast"
"https://www.theguardian.com/uk-news/2023/feb/10/second-world-war-bomb-detonates-unexpectedly-in-great-yarmouth"
"https://www.usatoday.com/videos/news/have-you-seen/2023/02/12/world-war-ii-era-bomb-unexpectedly-explodes-crews-try-defuse/11242221002/"
"https://news.sky.com/video/wwii-bomb-detonates-in-great-yarmouth-after-three-day-operation-12807889"
"https://www.newcivilengineer.com/latest/ww2-bomb-explosion-on-great-yarmouth-bridge-site-to-delay-works-13-02-2023/"
"https://www.geplus.co.uk/news/bomb-detonates-at-great-yarmouths-new-river-crossing-site-15-02-2023/"
"https://www.cbsnews.com/news/wwii-era-bomb-explodes-in-england-in-unplanned-detonation/"
"https://www.aa.com.tr/en/europe/wwii-bomb-detonates-in-uk-before-being-disarmed/2815345"
"https://www.greatyarmouthmercury.co.uk/news/23314778.great-yarmouth-bomb-know-norfolk-explosion/"
"https://support.google.com/websearch%3Fp%3Dws_settings_location%26hl%3Den-BS"
"https://accounts.google.com/ServiceLogin%3Fcontinue%3Dhttps://www.google.com/search%253Fq%253DGreat%252BYarmouth%252BBomb%252BExplodes%2526num%253D10%26hl%3Den"
"https://www.google.com/preferences?hl=en-BS"
"https://policies.google.com/privacy?hl=en-BS"
"https://policies.google.com/terms?hl=en-BS"
"https://www.google.com/search?q%3DGreat%2BYarmouth%2BBomb%2BExplodes%26num%3D10%26pccc%3D1"

GEOLOCATION

The video thumbnail displays a gas station on the same street as the explosion. However, I wrote an Overpass Turbo query to see if I could land at the exact spot, but it did not display this as a part of my results. ChatGPT is also quite effective at writing overpass-turbo queries which I’ve displayed in a previous blog post.

[out:json];
area[name="Great Yarmouth"]->.searchArea;
(
node["amenity"="fuel"]["brand"="BP"](area.searchArea);
);
out body;
>;
out skel qt;

RESULTS:

OverPass Query

The Query did not return the gas station in the video. However, that BP gas station is just across the River Yare which means that the explosion would have also been seen from the BP returned from the overpass-turbo search query.

CONCLUSION

A lot of individuals have the wrong concept about AI, in terms of the intelligence process. ChatGPT is a prime example of how AI can be utilized in the collection phase of the intelligence cycle. It can gather and sift through vast amounts of data, such as social media posts, news articles, and other publicly available information, in a matter of seconds. However, it’s important to note that ChatGPT and other AI tools are not a replacement for human intelligence analysts, but rather a supplement to their abilities.

--

--