Git Product home page Git Product logo

thedev132 / osintgram Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 0.0 3.52 MB

Osintgram is a OSINT tool on Instagram. It offers an interactive shell to perform analysis on Instagram account of any users by its nickname

License: GNU General Public License v3.0

Dockerfile 1.23% Makefile 2.94% Python 95.83%
analysis hacking information-gathering information-retrieval instagram instagram-account instagram-api osint osint-python osint-tool

osintgram's Introduction

Osintgram ๐Ÿ”Ž๐Ÿ“ธ

version-1.3 GPLv3 Python3 Docker

Osintgram is a OSINT tool on Instagram to collect, analyze, and run reconnaissance. This tool is a rewrite of Datalux's Osintgram

Disclaimer: FOR EDUCATIONAL PURPOSE ONLY! The contributors do not assume any responsibility for the use of this tool.

Warning: It is advisable to not use your own/primary account when using this tool.

Tools and Commands ๐Ÿงฐ

Osintgram offers an interactive shell to perform analysis on Instagram account of any users by its nickname. You can get:

Supported:
โŒ - addrs           Get all registered addressed by target photos 
โŒ - captions        Get user's photos captions 
โŒ - comments        Get total comments of target's posts 
โœ… - followers       Get target followers 
โœ… - followings      Get users followed by target 
โŒ - fwersemail      Get email of target followers 
โŒ - fwingsemail     Get email of users followed by target 
โŒ - fwersnumber     Get phone number of target followers 
โŒ - fwingsnumber    Get phone number of users followed by target 
โœ… - hashtags        Get hashtags used by target 
โœ… - info            Get target info 
โœ… - likes           Get total likes of target's posts 
โŒ - mediatype       Get user's posts type (photo or video) 
โŒ - photodes        Get description of target's photos 
โœ… - photos          Download user's photos in user output folder 
โœ… - propic          Download user's profile picture in user output folder 
โœ… - stories         Download user's stories in user output folder 
โœ… - highlights      Download user's highlights in user output folder 
โœ… - tagged          Get list of users tagged by target 
โŒ - wcommented      Get a list of user who commented target's photos 
โŒ - wtagged         Get a list of user who tagged target 

You can find detailed commands usage here.

Latest version | Commands | CHANGELOG

FAQ

  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!
  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)

Installation โš™๏ธ

  1. Fork/Clone/Download this repo

    git clone https://github.com/thedev132/Osintgram.git

  2. Navigate to the directory

    cd Osintgram

  3. Create a virtual environment for this project

    python3 -m venv venv

  4. Load the virtual environment

    • On Windows Powershell: .\venv\Scripts\activate.ps1
    • On Linux and Git Bash: source venv/bin/activate
  5. Run pip install -r requirements.txt

  6. Open the credentials.ini file in the config folder and write your Instagram account username and password in the corresponding fields

    Alternatively, you can run the make setup command to populate this file for you.

  7. Run the main.py script in one of two ways

    • As an interactive prompt python3 main.py <target username>
    • Or execute your command straight away python3 main.py <target username> --command <command>

Docker Quick Start ๐Ÿณ

This section will explain how you can quickly use this image with Docker or Docker-compose.

Prerequisites

Before you can use either Docker or Docker-compose, please ensure you do have the following prerequisites met.

  1. Docker installed - link
  2. Docker-composed installed (if using Docker-compose) - link
  3. Credentials configured - This can be done manually or by running the make setup command from the root of this repo

Important: Your container will fail if you do not do step #3 and configure your credentials

Docker

If docker is installed you can build an image and run this as a container.

Build:

docker build -t osintgram .

Run:

docker run --rm -it -v "$PWD/output:/home/osintgram/output" osintgram <target>
  • The <target> is the Instagram account you wish to use as your target for recon.
  • The required -i flag enables an interactive terminal to use commands within the container. docs
  • The required -v flag mounts a volume between your local filesystem and the container to save to the ./output/ folder. docs
  • The optional --rm flag removes the container filesystem on completion to prevent cruft build-up. docs
  • The optional -t flag allocates a pseudo-TTY which allows colored output. docs

Using docker-compose

You can use the docker-compose.yml file this single command:

docker-compose run osintgram <target>

Where target is the Instagram target for recon.

Alternatively you may run docker-compose with the Makefile:

make run - Builds and Runs with compose. Prompts for a target before running.

Makefile (easy mode)

For ease of use with Docker-compose, a Makefile has been provided.

Here is a sample work flow to spin up a container and run osintgram with just two commands!

  1. make setup - Sets up your Instagram credentials
  2. make run - Builds and Runs a osintgram container and prompts for a target

Sample workflow for development:

  1. make setup - Sets up your Instagram credentials
  2. make build-run-testing - Builds an Runs a container without invoking the main.py script. Useful for an it Docker session for development
  3. make cleanup-testing - Cleans up the testing container created from build-run-testing

Development version ๐Ÿ’ป

To use the development version with the latest feature and fixes just switch to development branch using Git:

git checkout development

and update to last version using:

git pull origin development

Updating โฌ‡๏ธ

To update Osintgram with the stable release just pull the latest commit using Git.

  1. Make sure you are in the master branch running: git checkout master
  2. Download the latest version: git pull origin master

Contributing ๐Ÿ’ก

You can propose a feature request opening an issue or a pull request.

Here is a list of Osintgram's contributors:

External library ๐Ÿ”—

Instagram API

osintgram's People

Contributors

abdalrahmanhafez avatar ahmadfaizan965 avatar anatolykopyl avatar cclauss avatar charlesbel avatar chrisdafur3 avatar datalux avatar dependabot[bot] avatar fearfulspoon avatar friaca avatar grantbirki avatar kappuccino avatar mvarga6 avatar prince-shaikh avatar ritu-bhangale avatar shadow00 avatar thedev132 avatar tkuye avatar yves147 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

osintgram's Issues

401 unauthorized when target is another account - followers command

Hi

I log in with a "secondary" instagram account to gather data about my main account, @TastingSunsets. When performing the followers command, I get a 401 unauthorized error, followed by instagrapi.exceptions.PleaseWaitFewMinutes. The target account has 3k+ followers. When I perform the same command on the account that I log in with, the command works. This secondary account has 800 followers. The secondary account follows @tastinsunsets (which is a public account anyways).

Here's the complete traceback for when the command fails:

Run a command: followers
Searching for target followers (this may take a while) ...
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 168, in _send_public_request
response.raise_for_status()
File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://www.instagram.com/graphql/query/?variables=%7B%22id%22%3A%2251675445256%22%2C%22include_reel%22%3Atrue%2C%22fetch_mutual%22%3Afalse%2C%22first%22%3A12%7D&query_hash=5aefa9893005572d237da5068082d8d5

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 784, in user_followers
users = self.user_followers_gql(user_id, amount)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 689, in user_followers_gql
users, _ = self.user_followers_gql_chunk(str(user_id), amount)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 655, in user_followers_gql_chunk
data = self.public_graphql_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 240, in public_graphql_request
body_json = self.public_request(
^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 123, in public_request
raise e
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 100, in public_request
return self._send_public_request(url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 191, in _send_public_request
raise ClientUnauthorizedError(e, response=e.response)
instagrapi.exceptions.ClientUnauthorizedError: 401 Client Error: Unauthorized for url: https://www.instagram.com/graphql/query/?variables=%7B%22id%22%3A%2251675445256%22%2C%22include_reel%22%3Atrue%2C%22fetch_mutual%22%3Afalse%2C%22first%22%3A12%7D&query_hash=5aefa9893005572d237da5068082d8d5

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 360, in _send_private_request
response.raise_for_status()
File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://i.instagram.com/api/v1/friendships/51675445256/followers/?max_id=&count=200&rank_token=8021155557_3df401ed-a28c-4a57-8e6a-1ffd4920f1c5&search_surface=follow_list_page&query=&enable_groups=true

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/tasting.sunsets/sandbox/osint/Osintgram/main.py", line 173, in
_cmd()
File "/Users/tasting.sunsets/sandbox/osint/Osintgram/src/Osintgram.py", line 306, in get_followers
data = client.user_followers(str(self.target_id))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 788, in user_followers
users = self.user_followers_v1(user_id, amount)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 755, in user_followers_v1
users, _ = self.user_followers_v1_chunk(str(user_id), amount)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 717, in user_followers_v1_chunk
result = self.private_request(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 542, in private_request
raise e
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 527, in private_request
self._send_private_request(endpoint, **kwargs)
File "/opt/homebrew/lib/python3.11/site-packages/instagrapi/mixins/private.py", line 383, in _send_private_request
raise PleaseWaitFewMinutes(e, response=e.response, **last_json)
instagrapi.exceptions.PleaseWaitFewMinutes: Please wait a few minutes before you try again.

Any insights in how to fix this? Great tool by the way!

Error

I get this error and i can't lauch it. Can someone help please?
(venv) PS C:\Users\marti\Osintgram> python main.py xxxxxxxxxxxxx
Traceback (most recent call last):
File "C:\Users\marti\Osintgram\main.py", line 90, in
pyreadline.Readline().parse_and_bind("tab: complete")
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marti\Osintgram\venv\Lib\site-packages\pyreadline\rlmain.py", line 422, in init
BaseReadline.init(self)
File "C:\Users\marti\Osintgram\venv\Lib\site-packages\pyreadline\rlmain.py", line 62, in init
mode.init_editing_mode(None)
File "C:\Users\marti\Osintgram\venv\Lib\site-packages\pyreadline\modes\emacs.py", line 633, in init_editing_mode
self._bind_key('space', self.self_insert)
File "C:\Users\marti\Osintgram\venv\Lib\site-packages\pyreadline\modes\basemode.py", line 162, in _bind_key
if not callable(func):
^^^^^^^^^^^^^^
File "C:\Users\marti\Osintgram\venv\Lib\site-packages\pyreadline\py3k_compat.py", line 8, in callable
return isinstance(x, collections.Callable)
^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Callable'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.