Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Basic os detection functionality in xerosploit.py #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions xerosploit.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ def ping():
elif action_ping == "run":
print("\033[1;34m\n[++] PING " + target_ips + " (" + target_ips + ") 56(84) bytes of data ... \n\033[1;m")
ping_cmd = os.popen("ping -c 5 " + target_ips).read()

# adding this small os detection functionality to enhance the ping result
# so that it will also become able to detect the target os while execution of this ping option of the script

detect_os = os.system("nmap -sV -O " + target_ips)
fping = open('/opt/xerosploit/tools/log/ping.txt','w') #Save ping result , then grep some informations.
fping.write(ping_cmd)
fping.close()
Expand All @@ -305,8 +310,8 @@ def ping():
ping_time = os.popen("grep packets /opt/xerosploit/tools/log/ping.txt | awk '{print $10}'").read()

table_data = [
['Transmitted', 'Received', 'Loss','Time'],
[ping_transmited, ping_receive, ping_lost, ping_time]
['Transmitted', 'Received', 'Loss','Time' , 'Target_OS_Detection'],
[ping_transmited, ping_receive, ping_lost, ping_time , detect_os]
]
table = DoubleTable(table_data)
print("\033[1;36m\n[+]═════════[ " + target_ips +" ping statistics ]═════════[+]\n\033[1;m")
Expand Down