Skip to content

Commit c46ace2

Browse files
committed
OSINT for Instagram
0 parents  commit c46ace2

19 files changed

Lines changed: 3228 additions & 0 deletions

.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

.github/workflows/lint_python.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: lint_python
2+
on: [pull_request, push]
3+
jobs:
4+
lint_python:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-python@v2
9+
- run: pip install bandit black codespell flake8 isort mypy pytest pyupgrade safety
10+
- run: bandit -r . || true
11+
- run: black --check . || true
12+
- run: codespell --ignore-words-list="followings" --quiet-level=2
13+
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
14+
- run: isort --check-only --profile black . || true
15+
- run: pip install -r requirements.txt
16+
- run: mypy --ignore-missing-imports .
17+
- run: pytest . || true
18+
- run: pytest --doctest-modules . || true
19+
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
20+
- run: safety check

.gitignore

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

.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"]

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

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: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Osintgram 🔎📸
2+
3+
[![version-1.3](https://img.shields.io/badge/version-1.3-green)](https://github.com/Datalux/Osintgram/releases/tag/1.3)
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)
8+
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.png" width="900">
13+
</p>
14+
15+
Disclaimer: **FOR EDUCATIONAL PURPOSE ONLY! 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 🧰
20+
21+
Osintgram offers an interactive shell to perform analysis on Instagram account of any users by its nickname. You can get:
22+
23+
```text
24+
- addrs Get all registered addressed by target photos
25+
- captions Get user's photos captions
26+
- comments Get total comments of target's posts
27+
- followers Get target followers
28+
- followings Get users followed by target
29+
- fwersemail Get email of target followers
30+
- fwingsemail Get email of users followed by target
31+
- fwersnumber Get phone number of target followers
32+
- fwingsnumber Get phone number of users followed by target
33+
- hashtags Get hashtags used by target
34+
- info Get target info
35+
- likes Get total likes of target's posts
36+
- mediatype Get user's posts type (photo or video)
37+
- photodes Get description of target's photos
38+
- photos Download user's photos in output folder
39+
- propic Download user's profile picture
40+
- stories Download user's stories
41+
- tagged Get list of users tagged by target
42+
- wcommented Get a list of user who commented target's photos
43+
- wtagged Get a list of user who tagged target
44+
```
45+
46+
You can find detailed commands usage [here](doc/COMMANDS.md).
47+
48+
[**Latest version**](https://github.com/Datalux/Osintgram/releases/tag/1.3) |
49+
[Commands](doc/COMMANDS.md) |
50+
[CHANGELOG](doc/CHANGELOG.md)
51+
52+
## FAQ
53+
1. **Can I access the contents of a private profile?** No, you cannot get information on private profiles. You can only get information from a public profile or a profile you follow. The tools that claim to be successful are scams!
54+
2. **What is and how I can bypass the `challenge_required` error?** The `challenge_required` error means that Instagram notice a suspicious behavior on your profile, so needs to check if you are a real person or a bot. To avoid this you should follow the suggested link and complete the required operation (insert a code, confirm email, etc)
55+
56+
57+
## Installation ⚙️
58+
59+
1. Fork/Clone/Download this repo
60+
61+
`git clone https://github.com/Datalux/Osintgram.git`
62+
63+
2. Navigate to the directory
64+
65+
`cd Osintgram`
66+
67+
3. Create a virtual environment for this project
68+
69+
`python3 -m venv venv`
70+
71+
4. Load the virtual environment
72+
- On Windows Powershell: `.\venv\Scripts\activate.ps1`
73+
- On Linux and Git Bash: `source venv/bin/activate`
74+
75+
5. Run `pip install -r requirements.txt`
76+
77+
6. Open the `credentials.ini` file in the `config` folder and write your Instagram account username and password in the corresponding fields
78+
79+
Alternatively, you can run the `make setup` command to populate this file for you.
80+
81+
7. Run the main.py script in one of two ways
82+
83+
* As an interactive prompt `python3 main.py <target username>`
84+
* Or execute your command straight away `python3 main.py <target username> --command <command>`
85+
86+
## Docker Quick Start 🐳
87+
88+
This section will explain how you can quickly use this image with `Docker` or `Docker-compose`.
89+
90+
### Prerequisites
91+
92+
Before you can use either `Docker` or `Docker-compose`, please ensure you do have the following prerequisites met.
93+
94+
1. **Docker** installed - [link](https://docs.docker.com/get-docker/)
95+
2. **Docker-composed** installed (if using Docker-compose) - [link](https://docs.docker.com/compose/install/)
96+
3. **Credentials** configured - This can be done manually or by running the `make setup` command from the root of this repo
97+
98+
**Important**: Your container will fail if you do not do step #3 and configure your credentials
99+
100+
### Docker
101+
102+
If docker is installed you can build an image and run this as a container.
103+
104+
Build:
105+
106+
```bash
107+
docker build -t osintgram .
108+
```
109+
110+
Run:
111+
112+
```bash
113+
docker run --rm -it -v "$PWD/output:/home/osintgram/output" osintgram <target>
114+
```
115+
116+
- The `<target>` is the Instagram account you wish to use as your target for recon.
117+
- 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)
118+
- 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)
119+
- 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)
120+
- The optional `-t` flag allocates a pseudo-TTY which allows colored output. [docs](https://docs.docker.com/engine/reference/run/#foreground)
121+
122+
### Using `docker-compose`
123+
124+
You can use the `docker-compose.yml` file this single command:
125+
126+
```bash
127+
docker-compose run osintgram <target>
128+
```
129+
130+
Where `target` is the Instagram target for recon.
131+
132+
Alternatively you may run `docker-compose` with the `Makefile`:
133+
134+
`make run` - Builds and Runs with compose. Prompts for a `target` before running.
135+
136+
### Makefile (easy mode)
137+
138+
For ease of use with Docker-compose, a `Makefile` has been provided.
139+
140+
Here is a sample work flow to spin up a container and run `osintgram` with just two commands!
141+
142+
1. `make setup` - Sets up your Instagram credentials
143+
2. `make run` - Builds and Runs a osintgram container and prompts for a target
144+
145+
Sample workflow for development:
146+
147+
1. `make setup` - Sets up your Instagram credentials
148+
2. `make build-run-testing` - Builds an Runs a container without invoking the `main.py` script. Useful for an `it` Docker session for development
149+
3. `make cleanup-testing` - Cleans up the testing container created from `build-run-testing`
150+
151+
## Development version 💻
152+
153+
To use the development version with the latest feature and fixes just switch to `development` branch using Git:
154+
155+
`git checkout development`
156+
157+
and update to last version using:
158+
159+
`git pull origin development`
160+
161+
162+
## Updating ⬇️
163+
164+
To update Osintgram with the stable release just pull the latest commit using Git.
165+
166+
1. Make sure you are in the master branch running: `git checkout master`
167+
2. Download the latest version: `git pull origin master`
168+
169+
170+
## Contributing 💡
171+
172+
You can propose a feature request opening an issue or a pull request.
173+
174+
Here is a list of Osintgram's contributors:
175+
176+
<a href="https://github.com/Datalux/Osintgram/graphs/contributors">
177+
<img src="https://contributors-img.web.app/image?repo=Datalux/Osintgram" />
178+
</a>
179+
180+
## External library 🔗
181+
182+
[Instagram API](https://github.com/ping/instagram_private_api)

0 commit comments

Comments
 (0)