Browse Source

small changes

aidmar.wainakh 6 years ago
parent
commit
53769d17ca
3 changed files with 5 additions and 4 deletions
  1. 0 1
      code/Attack/JoomlaRegPrivExploit.py
  2. 1 1
      code/Attack/PortscanAttack.py
  3. 4 2
      code/Attack/SQLiAttack.py

+ 0 - 1
code/Attack/JoomlaRegPrivExploit.py

@@ -84,7 +84,6 @@ class JoomlaRegPrivExploit(BaseAttack.BaseAttack):
             destination_mac = self.generate_random_mac_address()
         self.add_param_value(Param.MAC_DESTINATION, destination_mac)
 
-    @property
     def generate_attack_pcap(self):
         def update_timestamp(timestamp, pps, maxdelay):
             """

+ 1 - 1
code/Attack/PortscanAttack.py

@@ -264,7 +264,7 @@ class PortscanAttack(BaseAttack.BaseAttack):
             # Aidmar
             request.time = timestamp_next_pkt
 
-            # 2) Build reply package
+            # 2) Build reply (for open ports) package
             if dport in ports_open:  # destination port is OPEN
                 reply_ether = Ether(src=mac_destination, dst=mac_source)
                 reply_ip = IP(src=ip_destination, dst=ip_source, flags='DF')

+ 4 - 2
code/Attack/SQLiAttack.py

@@ -171,8 +171,6 @@ class SQLiAttack(BaseAttack.BaseAttack):
                 eth_frame.payload = b''
                 ip_pkt.payload = b''
                 tcp_pkt.payload = b''
-                #temp = "GET / HTTP/1.0\r\n\r\n"
-                #temp = "GET / HTTP/1.1\r\nHost: 192.168.189.1\r\nUser-Agent: Mozilla/4.0(compatible;MSIE6.0;WindowsNT5.1)\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n"
 
                 if len(str_http_pkt) > 0:
                     # convert payload bytes to str => str = "b'..\\r\\n..'"
@@ -181,6 +179,8 @@ class SQLiAttack(BaseAttack.BaseAttack):
                     str_http_pkt = str_http_pkt.replace(orig_ip_dst, target_host)
                     str_http_pkt = str_http_pkt.replace("\\n", "\n")
                     str_http_pkt = str_http_pkt.replace("\\r", "\r")
+                    str_tcp_seg = str_tcp_seg.replace("\\t", "\t")
+                    str_tcp_seg = str_tcp_seg.replace("\\\'", "\'")
 
                 new_pkt = (eth_frame / ip_pkt/ tcp_pkt / str_http_pkt)
                 new_pkt.time = timestamp_next_pkt
@@ -211,6 +211,8 @@ class SQLiAttack(BaseAttack.BaseAttack):
                     str_http_pkt = str_http_pkt.replace(orig_ip_dst, target_host)
                     str_http_pkt = str_http_pkt.replace("\\n", "\n")
                     str_http_pkt = str_http_pkt.replace("\\r", "\r")
+                    str_tcp_seg = str_tcp_seg.replace("\\t", "\t")
+                    str_tcp_seg = str_tcp_seg.replace("\\\'", "\'")
 
                 new_pkt = (eth_frame / ip_pkt / tcp_pkt / str_http_pkt)
                 timestamp_next_pkt = timestamp_next_pkt + uniform(replyDelay, 2 * replyDelay)