Skip to content

Instantly share code, notes, and snippets.

@AlexanderDzhoganov
Last active May 11, 2020 22:59
Show Gist options
  • Save AlexanderDzhoganov/5cbb04a3a3182b76d56a0f94e4394d0d to your computer and use it in GitHub Desktop.
Save AlexanderDzhoganov/5cbb04a3a3182b76d56a0f94e4394d0d to your computer and use it in GitHub Desktop.
// Harvest t1 loc's in under 500 symbols
// Syntax: script {t: #s.some_corp.loc }
// Use with targets from ada.fullsec { npc: true }
// By nlight
function(c, a)
{
var _ = (c, p) => { c.forEach(p) }, // loop utility method
r = a.t.call({}), // first call to get method names
k = /d with ([a-z]+):/.exec(r)[1], // extract command key
j = /y with [a-z]+:"([a-z]+)"/.exec(r)[1], // extract special command
o = / \"([a-z_]*)\"/g, // extract commands
n = [], // list of commands
p = /y ([a-zA-Z_]*) an/, // password regex
v, // password
x = [], // project names
b = [], // results
q = {},
z = [/ject ([a-zA-Z_.]*) /, /e for ([a-z_0-9.]+)\. /, /on ([a-z()0-9_]+) pr/] // project name patterns
while(c = o.exec(r)) {
n.push(c[1])
}
_(n, c => { // for each command
q[k] = c
r = a.t.call(q) // run the script
if((typeof r)[0]!="s") // if we get an array parse the individual items for projects
_(r, q => {
_(z, z => {
o = z.exec(q)
if(o) x.push(o[1])
})
})
else { // if we get a single item parse it for passwords
o = p.exec(r)
if(o) v = o[1]
}
})
_(x, h => { // for each project
p = {project: h, password: v, pass: v, p: v}
p[k] = j
r = a.t.call(p) // call the script to get the npc locs
_(r, g => { // for each npc loc push it in the results array
b.push(g)
})
})
return b
}
@Minikea
Copy link

Minikea commented May 11, 2020

could it be updated to recent patches?
need to a.t.call() somewhere to find commands.
maybe abuse of #fs.scripts.quine() and comments is somewhat possible to stay in 500char limit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment