shramos / polymorph

Polymorph is a real-time network packet manipulation framework with support for almost all existing protocols
GNU General Public License v2.0
445 stars 61 forks source link

Trying to delete a existing function returns "function is not in the list" #16

Closed mygeone closed 3 years ago

mygeone commented 3 years ago

Dear @shramos, when i try to delete an existing function it returns there's no function in the list. Only fix at the moment is restart Polymorph to unset list of applying functions.

PH:cap/t10 > functions -s
+-------+----------------------------------------------------------------------+
| Order |                              Functions                               |
+=======+======================================================================+
| 0     | def icmpReader(packet):                                              |
|       |     if packet['IP']['proto'] == 1:                                   |
|       |         if packet['ICMP']['type'] == 8:                              |
|       |             print("Request from "+ packet['IP']['src']+ " to         |
|       | "+packet['IP']['addr'])                                              |
|       |             return packet                                            |
|       |         elif packet['ICMP']['type'] == 0:                            |
|       |             print("Reply from "+ packet['IP']['src']+ " to           |
|       | "+packet['IP']['addr'])                                              |
|       |             return packet                                            |
|       |     return None                                                      |
|       |                                                                      |
|       |                                                                      |
|       |                                                                      |
+-------+----------------------------------------------------------------------+
| 1     | def TTLModifier(packet):                                             |
|       |     from random import randint                                       |
|       |     if packet['IP']['proto'] == 1 and packet['IP']['src'] ==         |
|       | '172.17.0.2':                                                        |
|       |         packet['IP']['ttl'] = random.randint(100, 120)               |
|       |         return packet                                                |
|       |     return None                                                      |
|       |                                                                      |
|       |                                                                      |
+-------+----------------------------------------------------------------------+
| 2     | def sniff_icmp(packet):                                              |
|       |     from random import randint                                       |
|       |     packet['IP']['ttl'] = randint(120,124)                           |
|       |     return packet                                                    |
|       |                                                                      |
+-------+----------------------------------------------------------------------+

PH:cap/t10 > functions -d sniff_icmp
[!] The function sniff_icmp is not in the list

PH:cap/t10 > functions -d 2
[!] The function 2 is not in the list

Thanks for helping!

shramos commented 3 years ago

Hi @mygeone,

This problem arises because the functions were deleted using the name of the function, not the name of the file.

To remove this ambiguity, I have updated Polymorph to version 2.0.4 and from this version the functions are removed by indicating the function order number.

Remove the old version of Polymorph, install the new version and use the following command to remove functions.

PH:cap/t10 > functions -d 2