Answer:
Following are the code to this question:
def binarynumber(num):#defining a method binarynumber that accepts a parameter num
x=""#defining a string variable x
if (num!=0):#defining if condition to check number not equal to 0
while (num>=1):#defining a loop that check value is grater then equal to one
if (num %2==0):#defining if condition to check num is even
x=x+"0" #add string value 0 in num variable
num=num/2 #divide the value by 2
else:#defining else block
x=x+"1"#add string value 1 in num variable
num=(num-1)/2#first subtract 1 into num variable then divide the value by 2
else:
x="0"#assign string value 0 in num variable
return "".join(reversed(x))#return value
num = int (input ("Enter any number: "))#defining num variable that input the integer value
print (binarynumber(num))#using print method to call method binarynumber with passing num parameter
Output:
Enter any number: 12
1100
Explanation:
- In the above python code a method "binarynumber" is declared, in which the "num" variable passes as the parameter inside the method a string variable "x" is declared that stores all converted values.
- Inside the method and if the block is declared that checks number value is not equal to 0 if this condition is false then it will add string value and reverse its value.
- Or if the condition is true it defines a while loop that calculates the given number binary digits and returns its value.
- At the last step, the num variable is declared that inputs the integer value from the user end and calls the method by using the print method.
The most likely vulnerability that the attacker might have exploited is file system permissions.
Further explanation:
This hack is most likely a case of improper file system permissions. The attacker took advantage of this vulnerability and was able to read, right, and execute the content that was inside the FTP server. The network admin had most likely not configured the FTP server well enough and had incorrect file system permissions lying around which led to the anonymous user accessing restricted files and directories and modifying them.
Even worse is the fact that the anonymous user account was able to breach and maintain persistence. If the ps command shows that the nc file is running as process, and the netstat command shows the nc process is listening on a network port, then this means that the anonymous user is most likely still inside and is listening and waiting for an admin to log in so that he is able to establish a shell session.
Somehow, the Linux FTP server has allowed people to upload files and this can open doors to malicious attacks. If the anonymous user account has Read, write, modify, execute, list folder contents, traverse folder, list folder, read attributes, and many more file permissions, he will be able to modify the content that is inside the FTP server in many undesirable ways.
Learn more about security vulnerabilities in Information security.
brainly.com/question/11212666
brainly.com/question/2211853
brainly.com/question/13677934
#LearnWithBrainly
It could be any thing of your chose