Skip to content

Commit

Permalink
Update hackingtoolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
shliu888 authored Jan 17, 2025
1 parent 5cf6ff3 commit e71faab
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions hackingtoolkit
Original file line number Diff line number Diff line change
@@ -1,10 +1,85 @@
#!/usr/bin/env python3
import socket
import requests
import subprocess
from subprocess import Popen
from scapy.all import *
import argparse
import time

def utilities():
print('''
[1] Netcat
[2] Start an Apache Web server
[3] Start a PostgreSQL server
[BACK] Back to main menu
''')
utilitiesOption=input('Select an option: ')
if utilitiesOption=='1':
netcat()
elif utilitiesOption=='2':
apache()
elif utilitiesOption=='3':
postgresql()
elif utilitiesOption=='BACK':
main()
else:
print('Invalid option.')
def public_ip():
try:
response = requests.get('https://api.ipify.org?format=json')
public_ip = response.json()['ip']
return public_ip
except requests.RequestException as error:
print('Error fetching public IP:',str(error))
return None
def private_ip():
hostname = socket.gethostname()
private_ip = socket.gethostbyname(hostname)
return private_ip
def apache():
try:
subprocess.Popen(['sudo','service','apache2','start'],text=True,check=True)
private_ip = private_ip()
public_ip = public_ip()
print('Apache server started.')
print('Private IP:',str(private_ip))
if public_ip:
print('Public IP:',str(public_ip))
except subprocess.SubprocessError as error:
print('Encountered an error: ',str(error))
def beef_framework():
try:
subprocess.Popen(['sudo','beef-xss'],text=True,check=True)
except subprocess.SubprocessError as error:
print('Encountered an error: ',str(error))
def setoolkit():
try:
subprocess.Popen(['sudo','setoolkit'],text=True,check=True)
except subprocess.SubprocessError as error:
print('Encountered an error: ',str(error))

def socialEngineering():
while True:
print('''
[1] Use the Social-Engineering Toolkit
[2] Use BeEF
[3] Set up an Apache web server to serve pages
[BACK] Back to main menu
''')
socEngineeringOption=input('Select an option: ')
if socEngineeringOption=='1':
setoolkit()
elif socEngineeringOption=='2':
beef_framework()
elif socEngineeringOption=='3':
apache()
elif socEngineeringOption=='BACK':
main()
else:
print('Invalid option.')
def nikto(host,port,if_ssl,output):
if if_ssl=='-ssl':
try:
Expand Down Expand Up @@ -578,6 +653,8 @@ def main():
passwdAttacks()
elif choice1=='6':
wordlist()
elif choice1=='7':
utilities()
else:
print('Invalid option')
#-----------------------------------
Expand Down

0 comments on commit e71faab

Please sign in to comment.