Skip to content

Commit

Permalink
updating portscan PR to capture all IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Nov 13, 2024
1 parent 35a2ffa commit 740126f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func NewHost(hostName string) (*host, error) {
if net.ParseIP(hostName) != nil {
return &host{
IP: hostName,
Hostname: hostName,
PrettyName: hostName,
mutex: mtx,
lock: semaphore.NewWeighted(100), // yeah i hardcoded don't @me
Expand All @@ -53,8 +54,7 @@ func NewHost(hostName string) (*host, error) {
if err != nil {
return nil, err
}
hostStr := fmt.Sprintf("%s (%s)", ips[0], hostName)

hostStr := strings.Join(ips, "\n")
return &host{
IP: ips[0],
Hostname: hostName,
Expand Down
14 changes: 11 additions & 3 deletions Payload_Type/poseidon/poseidon/browserscripts/portscan_new.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
function(task, response){
let tables = [];
let headers = [
{"plaintext": "ips", "type": "button", "width": 80, "disableSort": true},
{"plaintext": "hostname", "type": "string", "fillWidth": true, "disableSort": true},
{"plaintext": "ip", "type": "string", "fillWidth": true, "disableSort": true},
{"plaintext": "pretty name", "type": "string", "fillWidth": true, "disableSort": true},
{"plaintext": "open ports", "type": "string", "fillWidth": true,"disableSort": true}

];
Expand All @@ -16,9 +15,18 @@ function(task, response){
for(let j = 0; j < data.length; j++){
let rows = [];
for(let k = 0; k < data[j]["hosts"].length; k++){
if(data[j]["hosts"][k]["open_ports"] === null){continue}
rows.push({
"hostname": {"plaintext": data[j]["hosts"][k]['hostname']},
"ip": {"plaintext": data[j]["hosts"][k]["ip"]},
"ips": {
"button": {
"name": "View IPs",
"type": "string",
"value": data[j]["hosts"][k]["pretty_name"],
"hoverText": "View all IPs",
"title": "All IPs associated with this host",
}
},
"pretty name": {"plaintext":data[j]["hosts"][k]["pretty_name"]},
"open ports": {"plaintext": JSON.stringify(data[j]["hosts"][k]["open_ports"])}
});
Expand Down

0 comments on commit 740126f

Please sign in to comment.