Skip to content

Commit

Permalink
Cross-sequence variable references
Browse files Browse the repository at this point in the history
This allows accessing variables (e.g. cookie set during login)
from other Sequences. Uses the same logic as the MessageProcessor.
SequenceManager made accessible by making it static.
  • Loading branch information
b committed Jun 9, 2022
1 parent 2056757 commit ab65260
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/coreyd97/stepper/Stepper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class Stepper implements IBurpExtender {
public static IBurpExtenderCallbacks callbacks;
public static IGsonProvider gsonProvider = new DefaultGsonProvider();
private static Preferences preferences;
private static SequenceManager sequenceManager;

private StateManager stateManager;
private MessageProcessor messageProcessor;
private SequenceManager sequenceManager;

public Stepper(){
Stepper.instance = this;
Expand All @@ -40,6 +40,10 @@ public static Stepper getInstance() {
return instance;
}

public static SequenceManager getSequenceManager(){
return sequenceManager;
}

@Override
public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) {
Stepper.callbacks = callbacks;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/coreyd97/stepper/step/Step.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public StepExecutionInfo executeStep(List<StepVariable> replacements) throws Seq
// if(result == JOptionPane.NO_OPTION) throw new SequenceCancelledException("Binary data, user cancelled.");
// }
builtRequest = MessageProcessor.makeReplacementsForSingleSequence(requestWithoutReplacements, replacements);
HashMap<StepSequence, List<StepVariable>> allVariables = Stepper.instance.getSequenceManager().getRollingVariablesFromAllSequences();
builtRequest = MessageProcessor.makeReplacementsForAllSequences(builtRequest, allVariables);
}else{
builtRequest = Arrays.copyOf(requestWithoutReplacements, requestWithoutReplacements.length);
}
Expand Down

0 comments on commit ab65260

Please sign in to comment.