Skip to content

Commit

Permalink
Merge pull request #10 from sundowndev/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sundowndev authored Dec 11, 2018
2 parents feddcbe + 92d1683 commit 30226cc
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions phoneinfoga.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def banner():
help='Use OSINT reconnaissance')

parser.add_argument('-u', '--update', action='store_true',
help='Update the tool & databases')
help='Update the project')

args = parser.parse_args()

Expand All @@ -53,10 +53,6 @@ def banner():
parser.print_help()
sys.exit()

if args.update:
print('update')
sys.exit()

try:
import time
import hashlib
Expand All @@ -76,6 +72,43 @@ def banner():
print('\033[91m[!] Missing requirements. Try running pip install -r requirements.txt')
sys.exit()

if args.update:
def download_file(url, target_path):
response = requests.get(url, stream=True)
handle = open(target_path, "wb")
for chunk in response.iter_content(chunk_size=512):
if chunk: # filter out keep-alive new chunks
handle.write(chunk)

print('Updating PhoneInfoga...')
print('Actual version: {}'.format(__version__))

# Fetching last github tag
new_version = json.loads(requests.get('https://api.github.com/repos/sundowndev/PhoneInfoga/tags').content)[0]['name']
print('Last version: {}'.format(new_version))

osintFiles = ['disposable_num_providers.json', 'individuals.json', 'reputation.json', 'social_medias.json']

try:
print('[*] Updating OSINT files')

for file in osintFiles:
url = 'https://raw.githubusercontent.com/sundowndev/PhoneInfoga/master/osint/{}'.format(file)
output_directory = 'osint/{}'.format(file)
download_file(url, output_directory)

print('[*] Updating python script')

url = 'https://raw.githubusercontent.com/sundowndev/PhoneInfoga/master/phoneinfoga.py'
output_directory = 'phoneinfoga.py'
download_file(url, output_directory)
except:
print('Update failed. Try using git pull.')
sys.exit()

print('The tool was successfully updated.')
sys.exit()

scanners = ['any', 'all', 'numverify', 'ovh']

uagent = []
Expand Down

0 comments on commit 30226cc

Please sign in to comment.