Skip to content

Commit

Permalink
package fully implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelob committed Aug 31, 2022
1 parent 302c483 commit d27657f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
Binary file removed packet/Alpha-0.1.2.zip
Binary file not shown.
12 changes: 8 additions & 4 deletions packet/PnetPbus/FlashLED.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
#810000008892fefd04000000000400000008050300040000010000000000000000000000000000000000000000000000 Payload + Others (Do not change)

# Change org mac address and merge 3 parts into one hex string and replace the one below
raw_pkt = binascii.unhexlify('2863369a210400e04c680628810000008892fefd04000000000400000008050300040000010000000000000000000000000000000000000000000000')
pn_dcp = Ether(raw_pkt)
pn_dcp.show()
sendp(pn_dcp,iface="en8")
class FlashLED(macog,macdst):
def __init__(self, macog,macdst):
Hex = macdst + macog + '810000008892fefd04000000000400000008050300040000010000000000000000000000000000000000000000000000'
raw_pkt = binascii.unhexlify(Hex)
pn_dcp = Ether(raw_pkt)
pn_dcp.show()
sendp(pn_dcp,iface="en8")
print("Flash LED packet sent")
21 changes: 20 additions & 1 deletion packet/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from numpy import character
from S7comm import mainS7comm
from PnetPbus import Discovery
from PnetPbus import FlashLED
import sys, socket, pickle, struct,time, threading, snap7
from tkinter import *
from pymodbus.client.sync import ModbusTcpClient
Expand Down Expand Up @@ -140,7 +142,24 @@ def menuPandP():

g = SCADA_LAB.GUI(plc,client)
elif option == 4:
P&P()
while(True):
clearScreen()
menuPandP()
try:
choice = int(input('Enter your choice: '))
except:
print('Wrong input. Please enter a number ...')
if choice == 1:

MAC = str(input('Please, type in your MAC address without colons (example: 001122334455): '))
Discovery(MAC)
elif choice == 2:
Macdst = str(input('Please, type in the destination MAC address without colons (example: 001122334455): '))
Macog = str(input('Please, type in your MAC address without colons (example: 001122334455): '))
FlashLED(Macdst,Macog)
elif choice == 3:
print('Thanks message before exiting')
break
elif option == 5:
print('Thanks for using the package. For more info, refer to the GitHub Repo.')
exit()
Expand Down

0 comments on commit d27657f

Please sign in to comment.