Skip to content

Commit fb1c82f

Browse files
authored
Merge pull request #127 from Datalux/development
#version 1.2
2 parents c72652c + 80eac1d commit fb1c82f

18 files changed

+344
-75
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.github
2+
.img
3+
doc
4+
output
5+
.dockerignore
6+
.gitignore
7+
Docker-compose.yml
8+
Dockerfile
9+
LICENSE
10+
Makefile
11+
README.md

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ config/
22
__pycache__/
33
output/
44
*.pyc
5-
*.json
5+
*.json
6+
venv/
7+
credentials.ini

.img/banner.png

-1.24 MB
Binary file not shown.

.img/carbon.png

743 KB
Loading

.img/carbon.svg

Lines changed: 27 additions & 0 deletions
Loading

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM python:3.9.2-alpine3.13 as build
2+
WORKDIR /wheels
3+
RUN apk add --no-cache \
4+
ncurses-dev \
5+
build-base
6+
COPY docker_reqs.txt /opt/osintgram/requirements.txt
7+
RUN pip3 wheel -r /opt/osintgram/requirements.txt
8+
9+
10+
FROM python:3.9.2-alpine3.13
11+
WORKDIR /home/osintgram
12+
RUN adduser -D osintgram
13+
14+
COPY --from=build /wheels /wheels
15+
COPY --chown=osintgram:osintgram requirements.txt /home/osintgram/
16+
RUN pip3 install -r requirements.txt -f /wheels \
17+
&& rm -rf /wheels \
18+
&& rm -rf /root/.cache/pip/* \
19+
&& rm requirements.txt
20+
21+
COPY --chown=osintgram:osintgram src/ /home/osintgram/src
22+
COPY --chown=osintgram:osintgram main.py /home/osintgram/
23+
COPY --chown=osintgram:osintgram config/ /home/osintgram/config
24+
USER osintgram
25+
26+
ENTRYPOINT ["python", "main.py"]

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
SHELL := /bin/bash
2+
3+
setup:
4+
5+
@echo -e "\e[34m####### Setup for Osintgram #######\e[0m"
6+
@[ -d config ] || mkdir config || exit 1
7+
@echo -n "{}" > config/settings.json
8+
@read -p "Instagram Username: " uservar; \
9+
read -sp "Instagram Password: " passvar; \
10+
echo -en "[Credentials]\nusername = $$uservar\npassword = $$passvar" > config/credentials.ini || exit 1
11+
@echo ""
12+
@echo -e "\e[32mSetup Successful - config/credentials.ini created\e[0m"
13+
14+
run:
15+
16+
@echo -e "\e[34m######## Building and Running Osintgram with Docker-compose ########\e[0m"
17+
@[ -d config ] || { echo -e "\e[31mConfig folder not found! Please run 'make setup' before running this command.\e[0m"; exit 1; }
18+
@echo -e "\e[34m[#] Killing old docker processes\e[0m"
19+
@docker-compose rm -fs || exit 1
20+
@echo -e "\e[34m[#] Building docker container\e[0m"
21+
@docker-compose build || exit 1
22+
@read -p "Target Username: " username; \
23+
docker-compose run --rm osintgram $$username
24+
25+
build-run-testing:
26+
27+
@echo -e "\e[34m######## Building and Running Osintgram with Docker-compose for Testing/Debugging ########\e[0m"
28+
@[ -d config ] || { echo -e "\e[31mConfig folder not found! Please run 'make setup' before running this command.\e[0m"; exit 1; }
29+
@echo -e "\e[34m[#] Killing old docker processes\e[0m"
30+
@docker-compose rm -fs || exit 1
31+
@echo -e "\e[34m[#] Building docker container\e[0m"
32+
@docker-compose build || exit 1
33+
@echo -e "\e[34m[#] Running docker container in detached mode\e[0m"
34+
@docker-compose run --name osintgram-testing -d --rm --entrypoint "sleep infinity" osintgram || exit 1
35+
@echo -e "\e[32m[#] osintgram-test container is now Running!\e[0m"
36+
37+
cleanup-testing:
38+
@echo -e "\e[34m######## Cleanup Build-run-testing Container ########\e[0m"
39+
@docker-compose down
40+
@echo -e "\e[32m[#] osintgram-test container has been removed\e[0m"

README.md

Lines changed: 107 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
[![](https://img.shields.io/badge/version-1.1-green)](https://github.com/Datalux/Osintgram/releases/tag/1.1)
2-
[![](https://img.shields.io/badge/license-GPLv3-blue)](https://img.shields.io/badge/license-GPLv3-blue)
3-
[![](https://img.shields.io/badge/language-Python3-red)](https://img.shields.io/badge/language-Python3-red)
4-
[![](https://img.shields.io/badge/Telegram-Channel-blue.svg)](https://t.me/osintgram)
1+
# Osintgram 🔎📸
52

6-
# Osintgram
7-
Osintgram is a **OSINT** tool on Instagram.
3+
[![version-1.1](https://img.shields.io/badge/version-1.1-green)](https://github.com/Datalux/Osintgram/releases/tag/1.1)
4+
[![GPLv3](https://img.shields.io/badge/license-GPLv3-blue)](https://img.shields.io/badge/license-GPLv3-blue)
5+
[![Python3](https://img.shields.io/badge/language-Python3-red)](https://img.shields.io/badge/language-Python3-red)
6+
[![Telegram](https://img.shields.io/badge/Telegram-Channel-blue.svg)](https://t.me/osintgram)
7+
[![Docker](https://img.shields.io/badge/Docker-Supported-blue)](https://img.shields.io/badge/Docker-Supported-blue)
88

9-
**I don't assume any responsability for the use of this tool**
9+
Osintgram is a **OSINT** tool on Instagram to collect, analyze, and run reconnaissance.
10+
11+
<p align="center">
12+
<img align="center" src=".img/carbon.svg" width="900">
13+
</p>
14+
15+
Disclaimer: **The contributors do not assume any responsibility for the use of this tool**
16+
17+
Warning: It is advisable to **not** use your own/primary account when using this tool.
18+
19+
## Tools and Commands 🧰
1020

1121
Osintgram offers an interactive shell to perform analysis on Instagram account of any users by its nickname. You can get:
12-
```
22+
23+
```text
1324
- addrs Get all registered addressed by target photos
1425
- captions Get user's photos captions
1526
- comments Get total comments of target's posts
@@ -31,61 +42,126 @@ Osintgram offers an interactive shell to perform analysis on Instagram account o
3142
- wcommented Get a list of user who commented target's photos
3243
- wtagged Get a list of user who tagged target
3344
```
45+
3446
You can find detailed commands usage [here](doc/COMMANDS.md).
3547

36-
[**Latest version**](https://github.com/Datalux/Osintgram/releases/tag/1.1) |
48+
[**Latest version**](https://github.com/Datalux/Osintgram/releases/tag/1.1) |
49+
[Commands](doc/COMMANDS.md) |
3750
[CHANGELOG](doc/CHANGELOG.md)
3851

39-
## Tools
40-
<p align="center">
41-
<img align="center" src=".img/banner.png" width="700">
42-
</p>
43-
52+
## Installation ⚙️
4453

45-
# Installation
4654
1. Fork/Clone/Download this repo
4755

4856
`git clone https://github.com/Datalux/Osintgram.git`
4957

50-
5158
2. Navigate to the directory
5259

5360
`cd Osintgram`
5461

5562
3. Run `pip3 install -r requirements.txt`
5663

64+
4. Load the virtual environment
65+
- On Windows Powershell: `.\venv\Scripts\activate.ps1`
66+
- On Linux and Git Bash: `source venv/bin/activate`
67+
68+
5. Run `pip install -r requirements.txt`
69+
70+
6. Open the `credentials.ini` file in the `config` folder and write your Instagram account username and password in the corresponding fields
71+
72+
Alternatively, you can run the `make setup` command to populate this file for you.
5773

58-
4. Create a subdirectory `config`
74+
7. Run the main.py script
5975

60-
`mkdir config`
76+
`python3 main.py <target username>`
6177

62-
5. Create in `config` folder the file: `username.conf` and write your Instagram account username
78+
## Docker Quick Start 🐳
6379

64-
6. Create in `config` folder the file: `pw.conf` and write your Instagram account password
80+
This section will explain how you can quickly use this image with `Docker` or `Docker-compose`.
6581

66-
7. Create in `config` folder the file: `settings.json` and write the following string: "{}" without quotation marks
82+
### Prerequisites
6783

68-
8. Run the main.py script
84+
Before you can use either `Docker` or `Docker-compose`, please ensure you do have the following prerequisites met.
85+
86+
1. **Docker** installed - [link](https://docs.docker.com/get-docker/)
87+
2. **Docker-composed** installed (if using Docker-compose) - [link](https://docs.docker.com/compose/install/)
88+
3. **Credentials** configured - This can be done manually or by running the `make setup` command from the root of this repo
89+
90+
**Important**: Your container will fail if you do not do step #3 and configure your credentials
91+
92+
### Docker
93+
94+
If docker is installed you can build an image and run this as a container.
95+
96+
Build:
97+
98+
```bash
99+
docker build -t osintgram .
100+
```
101+
102+
Run:
103+
104+
```bash
105+
docker run --rm -it -v "$PWD/output:/home/osintgram/output" osintgram <target>
106+
```
107+
108+
- The `<target>` is the Instagram account you wish to use as your target for recon.
109+
- The required `-i` flag enables an interactive terminal to use commands within the container. [docs](https://docs.docker.com/engine/reference/commandline/run/#assign-name-and-allocate-pseudo-tty---name--it)
110+
- The required `-v` flag mounts a volume between your local filesystem and the container to save to the `./output/` folder. [docs](https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only)
111+
- The optional `--rm` flag removes the container filesystem on completion to prevent cruft build-up. [docs](https://docs.docker.com/engine/reference/run/#clean-up---rm)
112+
- The optional `-t` flag allocates a pseudo-TTY which allows colored output. [docs](https://docs.docker.com/engine/reference/run/#foreground)
113+
114+
### Using `docker-compose`
115+
116+
You can use the `docker-compose.yml` file this single command:
117+
118+
```bash
119+
docker-compose run osintgram <target>
120+
```
121+
122+
Where `target` is the Instagram target for recon.
123+
124+
Alternatively you may run `docker-compose` with the `Makefile`:
125+
126+
`make run` - Builds and Runs with compose. Prompts for a `target` before running.
127+
128+
### Makefile (easy mode)
129+
130+
For ease of use with Docker-compose, a `Makefile` has been provided.
131+
132+
Here is a sample work flow to spin up a container and run `osintgram` with just two commands!
133+
134+
1. `make setup` - Sets up your Instagram credentials
135+
2. `make run` - Builds and Runs a osintgram container and prompts for a target
136+
137+
Sample workflow for development:
138+
139+
1. `make setup` - Sets up your Instagram credentials
140+
2. `make build-run-testing` - Builds an Runs a container without invoking the `main.py` script. Useful for an `it` Docker session for development
141+
3. `make cleanup-testing` - Cleans up the testing container created from `build-run-testing`
142+
143+
## Development version 💻
69144

70-
`python3 main.py <target username>`
71-
72-
## Development version
73145
To use the development version with the latest feature and fixes just switch to `development` branch using Git:
74146

75147
`git checkout development`
76148

77-
## Updating
149+
## Updating ⬇️
150+
151+
and update to last version using:
78152

79-
Run `git pull` in Osintgram directory
153+
`git pull origin development`
154+
155+
## Contributing 💡
80156

81-
# Contributing
82157
You can propose a feature request opening an issue or a pull request.
83158

84-
Here is a list of Osintgram's contributors.
159+
Here is a list of Osintgram's contributors:
85160

86161
<a href="https://github.com/Datalux/Osintgram/graphs/contributors">
87162
<img src="https://contributors-img.web.app/image?repo=Datalux/Osintgram" />
88163
</a>
89164

90-
## External library
91-
Instagram API: https://github.com/ping/instagram_private_api
165+
## External library 🔗
166+
167+
[Instagram API](https://github.com/ping/instagram_private_api)

config/credentials.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Credentials]
2+
username =
3+
password =

config/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

doc/CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
**Enhancements**
2424
- Set itself as target (#53)
2525
- Get others info from user (`info` command):
26-
- Whats'App number (if avaible)
27-
- City Name (if avaible)
28-
- Address Street (if avaible)
29-
- Contact phone number (if avaible)
26+
- Whats'App number (if available)
27+
- City Name (if available)
28+
- Address Street (if available)
29+
- Contact phone number (if available)
3030

3131
**Bug fixes**
3232
- Fix login issue (#79, #80, #81)

doc/COMMANDS.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
```
33
- addrs Get all registered addressed by target photos
44
- captions Get user's photos captions
5+
- commentdata Get a list of all the comments on the target's posts
56
- comments Get total comments of target's posts
67
- followers Get target followers
78
- followings Get users followed by target
@@ -69,15 +70,15 @@ Show target info like:
6970
- followed
7071
- follow
7172
- is business account?
72-
- business catagory (if target has business account)
73+
- business category (if target has business account)
7374
- is verified?
7475
- business email (if available)
7576
- HD profile picture url
7677
- connected Facebook page (if available)
77-
- Whats'App number (if avaible)
78-
- City Name (if avaible)
79-
- Address Street (if avaible)
80-
- Contact phone number (if avaible)
78+
- Whats'App number (if available)
79+
- City Name (if available)
80+
- Address Street (if available)
81+
- Contact phone number (if available)
8182

8283
### JSON
8384
Can set preference to export commands output as JSON in output folder. It save output in `<target username>_<command>.JSON` file.
@@ -90,7 +91,7 @@ With `JSON=n` you can disable JSON exporting.
9091
Return the total number of likes in target's posts
9192

9293
### list (or help)
93-
Show all commands avaible.
94+
Show all commands available.
9495

9596
### mediatype
9697
Return the number of photos and video shared by target
@@ -101,7 +102,7 @@ Return a list with the description of the content of target's photos
101102
### photos
102103
Download all target's photos in output folder.
103104
When you run the command, script ask you how many photos you want to download.
104-
Type ENTER to download all photos avaible or type a number to choose how many photos you want download.
105+
Type ENTER to download all photos available or type a number to choose how many photos you want download.
105106
```
106107
Run a command: photos
107108
How many photos you want to download (default all):

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.7'
2+
3+
services:
4+
osintgram:
5+
container_name: osintgram
6+
build: .
7+
volumes:
8+
- ./output:/home/osintgram/output

docker_reqs.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
requests==2.24.0
2+
requests-toolbelt==0.9.1
3+
geopy>=2.0.0
4+
prettytable==0.7.2
5+
instagram-private-api==1.6.0
6+
gnureadline>=8.0.0

main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
32

43
from src.Osintgram import Osintgram
54
import argparse
@@ -26,9 +25,9 @@ def printlogo():
2625
print('\n')
2726
pc.printout("Version 1.1 - Developed by Giuseppe Criscione\n\n", pc.YELLOW)
2827
pc.printout("Type 'list' to show all allowed commands\n")
29-
pc.printout("Type 'FILE=y' to save results to files like '<target username>_<command>.txt (deafult is disabled)'\n")
28+
pc.printout("Type 'FILE=y' to save results to files like '<target username>_<command>.txt (default is disabled)'\n")
3029
pc.printout("Type 'FILE=n' to disable saving to files'\n")
31-
pc.printout("Type 'JSON=y' to export results to a JSON files like '<target username>_<command>.json (deafult is "
30+
pc.printout("Type 'JSON=y' to export results to a JSON files like '<target username>_<command>.json (default is "
3231
"disabled)'\n")
3332
pc.printout("Type 'JSON=n' to disable exporting to files'\n")
3433

@@ -42,6 +41,8 @@ def cmdlist():
4241
print("Get all registered addressed by target photos")
4342
pc.printout("captions\t")
4443
print("Get target's photos captions")
44+
pc.printout("commentdata\t")
45+
print("Get a list of all the comments on the target's posts")
4546
pc.printout("comments\t")
4647
print("Get total comments of target's posts")
4748
pc.printout("followers\t")
@@ -128,6 +129,7 @@ def _quit():
128129
'exit': _quit,
129130
'addrs': api.get_addrs,
130131
'captions': api.get_captions,
132+
"commentdata": api.get_comment_data,
131133
'comments': api.get_total_comments,
132134
'followers': api.get_followers,
133135
'followings': api.get_followings,

0 commit comments

Comments
 (0)